𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

Microservices with Go

✍ Scribed by Alexander Shuiskov


Publisher
Packt Publising Pvt Ltd
Year
2022
Tongue
English
Leaves
329
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Mastering the art of Go microservice development
Key Features

Helps to create and organize well-structured Go microservices
Provides industry best practices and insights on Go microservice development tools, patterns, and solutions
Covers hands-on Golang examples in each chapter

Book Description

This book is covering the key benefits and common issues of microservices, helping the readers to understand which problems microservice architecture helps to solve and which issues it usually introduces.

The chapter highlights the importance of using the right principles and standards in order to achieve the key benefits of microservice architecture, emphasizing the role of the Go programming language as one of the most popular languages for microservice development and laying down the foundation for the next chapters of the book. The foundational aspects of Go microservice development include service scaffolding, service discovery, data serialization, synchronous and asynchronous communication, deployment, and orchestration and testing. The part is primarily focusing on the development aspects while the following part is covering maintenance and reliability topics. The last part is covering more advanced topics of Go microservice development including system reliability, observability, maintainability, and scalability.

The part includes lots of best practices and examples which illustrate how to apply the key ideas to the existing applications, using two applications scaffolded in the previous part as examples.
What you will learn

Learn to build scalable and reliable Go microservices
Get familiar with the industry’s best practices and solutions in microservice development
Learn the advanced microservice reliability techniques
Understand service discovery in the microservices environment
Explore reliability and observability principles

Who This Book Is For

This book is for all types of developers: from people interested in learning how to write microservices and applications in Go to seasoned professionals who want to take the next step in mastering the art of writing scalable and reliable microservice-based systems.
Table of Contents

Introduction to microservices
Scaffolding a Go microservice
Service discovery
Serialization
Synchronous communication
Asynchronous communication
Deployment and orchestration
Unit and Integration Testing
Reliability overview
Observability
Setting up Service Alerting
Advanced Topics

✦ Table of Contents


Cover
Title Page
Copyright and Credits
Contributors
Table of Contents
Preface
Part 1: Introduction
Chapter 1: Introduction to Microservices
What is a microservice?
Motivation to use microservices
Pros and cons of microservices
Benefits of microservices
Common issues of microservices
When to use microservice architecture
Role of Go in microservice development
Summary
Further reading
Part 2: Foundation
Chapter 2: Scaffolding a Go Microservice
Technical requirements
Go basics
Core principles
Writing idiomatic Go code
Interfaces
Tests
Context
Project structure
Private packages
Public packages
Executable packages
Other commonly used directories
Common files
Best practices
Scaffolding an example application
Movie application
Application code structure
Movie metadata service
Movie service
Summary
Further reading
Chapter 3: Service Discovery
Technical requirements
Service discovery overview
Registry
Service discovery models
Service health monitoring
Service discovery solutions
HashiCorp Consul
Kubernetes
Adopting service discovery
Preparing the application
Implementing the discovery logic
Using the discovery logic
Summary
Further reading
Chapter 4: Serialization
Technical requirements
The basics of serialization
Popular serialization formats
Using Protocol Buffers
Best practices for serialization
Summary
Further reading
Chapter 5: Synchronous Communication
Technical requirements
Introduction to synchronous communication
Go RPC frameworks and libraries
Defining a service API using Protocol Buffers
Implementing gateways and clients
Metadata service
Rating service
Movie service
Summary
Further reading
Chapter 6: Asynchronous Communication
Technical requirements
Asynchronous communication basics
Benefits and challenges of asynchronous communication
Techniques and patterns of asynchronous communication
Using Apache Kafka for messaging
Adopting Kafka for our microservices
Asynchronous communication best practices
Versioning
Leveraging partitioning
Summary
Further reading
Chapter 7: Storing Service Data
Technical requirements
Introduction to database
Using MySQL to store our service data
Summary
Further reading
Chapter 8: Deployment with Kubernetes
Technical requirements
Preparing application code for deployments
Deployment basics
Application configuration
Deploying via Kubernetes
Introduction to Kubernetes
Setting up our microservices for Kubernetes deployments
Deployment best practices
Automated rollbacks
Canary deployments
Replace with Continuous Deployment (CD)
Summary
Further reading
Chapter 9: Unit and Integration Testing
Technical requirements
Go testing overview
Unit tests
Mocking
Implementing unit tests
Integration tests
Testing best practices
Using helpful messages
Avoiding the use of Fatal in your logs
Making a comparison using a cmp library
Summary
Further reading
Part 3: Maintenance
Chapter 10: Reliability Overview
Technical requirements
Reliability basics
Achieving reliability through automation
Communication error handling
Graceful shutdown
Achieving reliability through development processes and culture
On-call process
Incident management
Reliability drills
Summary
Further reading
Chapter 11: Collecting Service Telemetry Data
Technical requirements
Telemetry overview
Collecting service logs
Choosing the logging library
Using logging features
Storing microservice logs
Logging best practices
Collecting service metrics
Storing metrics
Popular Go metrics libraries
Emitting service metrics
Metrics best practices
Tracing
Tracing tools
Collecting tracing data with the OpenTelemetry SDK
Summary
Further reading
Chapter 12: Setting Up Service Alerting
Technical requirements
Alerting basics
Alerting use cases
Introduction to Prometheus
Setting up Prometheus alerting for our microservices
Alerting best practices
Summary
Further reading
Chapter 13: Advanced Topics
Technical requirements
Profiling Go services
Creating microservice dashboards
Frameworks
Storing microservice ownership data
Securing microservice communication with JWT
JWT basics
Implementing authentication and authorization with JWTs
Summary
Further reading
Index
Other Books You May Enjoy


πŸ“œ SIMILAR VOLUMES


Microservices with Go
✍ Alexander Shuiskov πŸ“‚ Library πŸ“… 2022 πŸ› Packt Publising Pvt Ltd 🌐 English

Mastering the art of Go microservice development Key Features Helps to create and organize well-structured Go microservices Provides industry best practices and insights on Go microservice development tools, patterns, and solutions Covers hands-on Golang examples in each chapter Book Descri

Advent of Go Microservices
✍ Tit Petric πŸ“‚ Library πŸ“… 2020 πŸ› Lean Publishing 🌐 English

Writing good services in Go can be a challenge - you have to write out your database structures, unit and integration testing with CI to see what breaks, keep them updated with migrations, define your API endpoints and routing, update your documentation - all of these things keep you from building y