Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Microservices with Go
  • Table Of Contents Toc
Microservices with Go

Microservices with Go - Second Edition

By : Alexander Shuiskov
close
close
Microservices with Go

Microservices with Go

By: Alexander Shuiskov

Overview of this book

Microservices with Go, Second Edition explains the key benefits and common issues faced by developers when working with microservices, helping you understand the problems microservice architecture solves, the issues it introduces, and how to tackle them. The author distils his 18+ years of experience in building scalable and reliable infrastructure to help you grasp the importance of using the right principles and standards to achieve all that microservice architecture has to offer. You'll see why Go is a popular choice for microservice development, as well as navigate its foundational aspects, including service scaffolding, discovery, data serialization, communication, deployment, and testing. After covering development, you'll move to maintenance and reliability. This second edition is fully updated with newly added topics, including security and compliance, distributed system challenges, and performance monitoring. The final section focuses on advanced concepts, such as system reliability, observability, maintainability, and scalability. Through best practices and practical examples, you'll learn how to apply key ideas to existing applications using previously scaffolded services. By the end of this book, you'll have gained hands-on experience in developing scalable, reliable, and high-performance microservices with Go.
Table of Contents (23 chapters)
close
close
Lock Free Chapter
1
Introduction
3
Foundation
13
Maintenance
18
Advanced Topics
21
Other Books You May Enjoy
22
Index

Using Protocol Buffers

In this section, we are going to illustrate how you can use Protocol Buffers for your applications. We will use the microservice examples from the previous chapters and define our data model in Protocol Buffers format. Then, we will use code generation tools alongside Protocol Buffers to generate our data structures. Finally, we will illustrate how to use our generated code to serialize and deserialize our data.

First, let’s prepare our application. Create a directory called api under our application’s src directory. Inside this directory, create a movie.proto file and add the following to it:

syntax = "proto3";
option go_package = "/gen";
message Metadata {
    string id = 1;
    string title = 2;
    string description = 3;
    string director = 4;
}
message MovieDetails {
    double rating = 1;
    Metadata metadata = 2;
}

In the first line of our schema definition, we set the syntax to proto3, the latest version...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Microservices with Go
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon