Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Microservices with Go

You're reading from   Microservices with Go The expert's guide to building secure, scalable, and reliable microservices with Go

Arrow left icon
Product type Paperback
Published in Jun 2025
Publisher Packt
ISBN-13 9781836207337
Length 428 pages
Edition 2nd Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Alexander Shuiskov Alexander Shuiskov
Author Profile Icon Alexander Shuiskov
Alexander Shuiskov
Arrow right icon
View More author details
Toc

Table of Contents (23) Chapters Close

Preface 1. Introduction FREE CHAPTER
2. Introduction to Microservices 3. Foundation
4. Scaffolding a Go Microservice 5. Service Discovery 6. Serialization 7. Synchronous Communication 8. Asynchronous Communication 9. Storing Service Data 10. Setting Up Service Deployments 11. Unit and Integration Testing 12. Security and Compliance 13. Maintenance
14. Reliability Overview 15. Collecting Service Telemetry Data 16. Setting Up Service Alerting 17. Performance Monitoring 18. Advanced Topics
19. Implementing Distributed System Scenarios 20. Advanced Topics 21. Other Books You May Enjoy
22. Index

What this book covers

Chapter 1, Introduction to Microservices, covers the key benefits of and common issues with a microservice architecture, helping you understand which problems microservices solve and which challenges they usually introduce. The chapter emphasizes the role of the Go programming language in microservice development and lays down the foundation for the rest of the book.

Chapter 2, Scaffolding Go Microservices, introduces you to the main principles of the Go programming language and provides the most important recommendations for writing Go code. It covers the process of setting up the right structure to organize the microservice code in Go and introduces you to an example application consisting of three microservices. Finally, the chapter illustrates how to scaffold the code for each of the example microservices. The example microservices implemented in this chapter are going to be used throughout the book, with each chapter adding new features to them.

Chapter 3, Service Discovery, talks about the problem of service discovery and illustrates how different services can find each other in a microservice environment. It covers the most popular service discovery tools and walks you through the steps of adding service discovery logic to the example microservices from the previous chapter.

Chapter 4, Serialization, brings us to the concept of data serialization, which is required for understanding upcoming chapters covering microservice communication. It introduces the Protocol Buffers data format, which is going to be used for encoding and decoding the data transferred between our example microservices. The chapter provides examples of how to define serializable data types and generate code for them, and how to use the generated code in Go microservices.

Chapter 5, Synchronous Communication, covers the topic of synchronous communication between microservices. It illustrates how to define service APIs using the Protocol Buffers format and introduces you to gRPC, a service communication framework. The chapter wraps up with examples of how to implement microservice gateways and clients and perform remote calls between our microservices.

Chapter 6, Asynchronous Communication, talks about asynchronous communication between microservices. It introduces you to a popular asynchronous communication tool, Apache Kafka, and provides examples of sending and receiving messages, using it for our example microservices. The chapter wraps up with an overview of best practices for using asynchronous communication in microservice environments.

Chapter 7, Persistence and Databases, covers the topic of persisting service data in databases. You will learn about the common types of databases and the benefits they bring to software developers. The chapter walks you through the process of implementing the logic for storing service data in a MySQL database.

Chapter 8, Setting Up Service Deployments, talks about service deployment and provides an overview of a popular deployment and orchestration platform, Kubernetes. The chapter illustrates how to prepare service code for deployment and how to deploy it using Kubernetes. It also includes best practices for deploying microservice applications.

Chapter 9, Unit and Integration Testing, describes the common techniques of testing Go microservice code. It covers the basics of Go unit and integration testing and demonstrates how to test the microservice code from the previous chapters. The chapter wraps up with the industry’s best practices for writing and organizing tests.

Chapter 10, Security and Compliance, covers the main aspects of Go microservice security, such as authentication, authorization, secret management, and vulnerability analysis. The chapter illustrates how to implement service-level authentication and access control with JSON Web Tokens.

Chapter 11, Reliability Overview, introduces you to the topic of system reliability and describes the core principles, instruments, and industry best practices for building reliable and highly available microservices. It illustrates how to automate service responses to various types of failures, as well as how to establish the processes for keeping service reliability under control.

Chapter 12, Collecting Service Telemetry Data, provides a detailed overview of modern instruments and solutions for collecting service telemetry data, such as logs, metrics, and traces. The chapter provides lots of detailed examples of collecting all different types of telemetry data and lists some of the best practices for working with them.

Chapter 13, Setting Up Service Alerting, illustrates how to set up automated incident detection and notification for microservices, using the telemetry data collected in the previous chapter. It introduces you to a popular alerting and monitoring tool, Prometheus, and shows how to set up Prometheus alerts for our example microservices.

Chapter 14, Performance Monitoring, describes the common techniques of tracking Go microservice performance, such as memory and CPU profiling and dashboarding. The chapter provides practical examples of setting up service performance dashboards using a popular Grafana tool.

Chapter 15, Implementing Distributed System Scenarios, covers some common distributed system problems and solutions that Go service developers might face while building advanced applications.

Chapter 16, Advanced Topics, wraps up the last part of the book and covers some of the advanced topics in microservice development, such as static code analysis, data validation, streaming APIs, service ownership, and frameworks. The chapter includes examples of data validation techniques, static code checks, and streaming API client and server logic.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime