small medium large xlarge

Distributed Services with Go: Your Guide to Reliable, Scalable, and Maintainable Systems


Cover image for Distributed Services with Go

Distributed Services with Go

Your Guide to Reliable, Scalable, and Maintainable Systems


You know the basics of Go and are eager to put your knowledge to work. This book is just what you need to apply Go to real-world situations. You’ll build a distributed service that’s highly available, resilient, and scalable. Along the way you’ll master the techniques, tools, and tricks that skilled Go programmers use every day to build quality applications. Level up your Go skills today.

Choose Your Format(s)

  • $24.95 In Stock
    • Beta: What do I get?

  • Ebooks are DRM free.

  • Ebook delivery options.

About this Title

Pages: 225 (est)
Published: 2020-10-10
Release: B1.0 (2020-03-23)
ISBN: 978-1-68050-760-7

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.

Lay out your applications and libraries to be modular and easy to maintain. Build networked, secure clients and servers with gRPC. Monitor your applications with metrics, logs, and traces to make them debuggable and reliable. Test and benchmark your applications to ensure they’re correct and fast. Build your own distributed services with service discovery and consensus. Write CLIs to configure your applications. Deploy applications to the cloud with Kubernetes and manage them with your own Kubernetes Operator.

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.17

Contents & Extracts

This book is currently in beta, so the contents and extracts will change as the book is developed.

  • Introduction
  • Get Started
    • Let’s Go
      • How JSON over HTTP Services Fits into Distributed Systems
      • Set Up the Project
      • Build a Commit Log Prototype
      • Build a JSON over HTTP Server
      • Run Your Server
      • Test Your API
      • What You Learned
    • Structure Data with Protocol Buffers excerpt
      • Why Use Protocol Buffers?
      • Install the Protocol Buffer Compiler
      • Define Your Domain Types as Protocol Buffers
      • Compile Protocol Buffers
      • Work with the Generated Code
      • What You Learned
    • Write a Log Package
      • The Log Is a Powerful Tool
      • How Logs Work
      • Build a Log
      • What You Learned
  • Network
    • Serve Requests with gRPC excerpt
      • What Is gRPC?
      • Goals When Building a Service
      • Define a gRPC Service
      • Compile with the gRPC Plugin
      • Implement a gRPC Server
      • Register Your Server
      • Test a gRPC Server and Client
      • What You Learned
    • Secure Your Services
      • Secure Services in Three Steps
      • Authenticate the Server with TLS
      • Authenticate the Client with Mutual TLS Authentication
      • Authorize with Access Control Lists
      • What You Learned
  • Distribute
    • Server-to-Server Service Discovery
      • Why Use Service Discovery? excerpt
      • Embed Service Discovery
      • Discover Services with Serf
      • Request Discovered Services and Replicate Logs
      • Test Discovery and the Service End-to-End
      • What You Learned
    • Coordinate Your Services with Consensus
      • What Is Raft and How Does It Work?
      • Implement Raft in Our Service
      • Multiplex to Run Multiple Services on One Port
      • What You Learned
    • Discover Servers and Load Balance From the Client
      • Three Load-Balancing Strategies
      • Load Balance on the Client in gRPC
      • Make Servers Discoverable
      • Resolve the Servers
      • Route and Balance Requests with Pickers
      • Test Discovery and Balancing End-to-End
      • What You Learned
  • Deploy
    • Deploy Applications with Kubernetes
    • Manage Your Applications with an Operator
  • Test
    • Unit Test Your Applications
    • System Test Your Applications
    • Write Fast Go


Travis Jeffery is a Canadian designer, programmer, and writer. He has been creating software for over 15 years, writing open source software and building several startups from the ground up, including Segment and Confluent.