0%

This is the book for Gophers who want to learn how to build distributed systems. You know the basics of Go and are eager to put your knowledge to work. Build distributed services that are highly available, resilient, and scalable. This book is just what you need to apply Go to real-world situations. Level up your engineering skills today.

Take your Go skills to the next level by learning how to design, develop, and deploy a distributed service. Start from the bare essentials of storage handling, then work your way through networking a client and server, and finally to distributing server instances, deployment, and testing. All this will make coding in your day job or side projects easier, faster, and more fun.

Create your own distributed services and contribute to open source projects. Build networked, secure clients and servers with gRPC. Gain insights into your systems and debug issues with observable services instrumented with metrics, logs, and traces. Operate your own Certificate Authority to authenticate internal web services with TLS. Automatically handle when nodes are added or removed to your cluster with service discovery. Coordinate distributed systems with replicated state machines powered by the Raft consensus algorithm. Lay out your applications and libraries to be modular and easy to maintain. Write CLIs to configure and run your applications. Run your distributed system locally and deploy to the cloud with Kubernetes. Test and benchmark your applications to ensure they're correct and fast.

Dive into writing Go and join the hundreds of thousands who are using it to build software for the real world.

What You Need:

Go 1.13+ and Kubernetes 1.16+

Table of Contents

  1.  Acknowledgments
  2.  Introduction
    1. Who This Book Is For
    2. What’s in This Book
    3. Online Resources
  3. Part I. Get Started
    1. 1. Let’s Go
    2. How JSON over HTTP Services Fits into Distributed Systems
    3. Set Up the Project
    4. Build a Commit Log Prototype
    5. Build a JSON over HTTP Server
    6. Run Your Server
    7. Test Your API
    8. What You Learned
    9. 2. Structure Data with Protocol Buffers
    10. Why Use Protocol Buffers?
    11. Install the Protocol Buffer Compiler
    12. Define Your Domain Types as Protocol Buffers
    13. Compile Protocol Buffers
    14. Work with the Generated Code
    15. What You Learned
    16. 3. Write a Log Package
    17. The Log Is a Powerful Tool
    18. How Logs Work
    19. Build a Log
    20. What You Learned
  4. Part II. Network
    1. 4. Serve Requests with gRPC
    2. What Is gRPC?
    3. Goals When Building a Service
    4. Define a gRPC Service
    5. Compile with the gRPC Plugin
    6. Implement a gRPC Server
    7. Register Your Server
    8. Test a gRPC Server and Client
    9. What You Learned
    10. 5. Secure Your Services
    11. Secure Services in Three Steps
    12. Authenticate the Server with TLS
    13. Authenticate the Client with Mutual TLS Authentication
    14. Authorize with Access Control Lists
    15. What You Learned
    16. 6. Observe Your Systems
    17. Three Types of Telemetry Data
    18. Make Your Service Observable
    19. What You Learned
  5. Part III. Distribute
    1. 7. Server-to-Server Service Discovery
    2. Why Use Service Discovery?
    3. Embed Service Discovery
    4. Discover Services with Serf
    5. Request Discovered Services and Replicate Logs
    6. Test Discovery and the Service End-to-End
    7. What You Learned
    8. 8. Coordinate Your Services with Consensus
    9. What Is Raft and How Does It Work?
    10. Implement Raft in Our Service
    11. Multiplex to Run Multiple Services on One Port
    12. What You Learned
    13. 9. Discover Servers and Load Balance from the Client
    14. Three Load-Balancing Strategies
    15. Load Balance on the Client in gRPC
    16. Make Servers Discoverable
    17. Resolve the Servers
    18. Route and Balance Requests with Pickers
    19. Test Discovery and Balancing End-to-End
    20. What You Learned
  6. Part IV. Deploy
    1. 10. Deploy Applications with Kubernetes Locally
    2. What Is Kubernetes?
    3. Install kubectl
    4. Use Kind for Local Development and Continuous Integration
    5. Write an Agent Command-Line Interface
    6. Build Your Docker Image
    7. Configure and Deploy Your Service with Helm
    8. Advertise Raft on the Fully Qualified Domain Name
    9. What You Learned
    10. 11. Deploy Applications with Kubernetes to the Cloud
    11. Create a Google Kubernetes Engine Cluster
    12. Create Custom Controllers with Metacontroller
    13. Deploy to the Internet
    14. What You Learned
18.191.234.62