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.
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
【One-Line Pitch】
This is the hands-on guide for Go developers who want to build production-grade distributed systems from scratch—covering storage, networking, security, consensus, and deployment—by constructing a complete service called "proglog" chapter by chapter.
【Book Arc】
- **Opening (~0%–6%)**: Sets up the project and explains why Go is ideal for building JSON/HTTP services, using the standard library's encoding/json and net/http to create a simple commit log server.
- **Early (~6%–19%)**: Introduces Protocol Buffers (protobuf) for structured data, covering schema design, field versioning, and code generation—then builds a log package as the core storage layer.
- **Early (~19%–34%)**: Implements the commit log library with segments, memory-mapped indexes, and append/read operations, including testing and handling edge cases like out-of-range offsets.
- **Middle (~38%–47%)**: Transitions to gRPC for network communication, defining service APIs in protobuf, building client and server, and adding custom error handling for robust RPC interactions.
- **Late (~47%–60%)**: Focuses on security—encrypting data in-flight with TLS, authenticating clients, and authorizing access—by operating a custom Certificate Authority.
- **Ending (~60%–100%)**: Covers advanced topics like service discovery, Raft consensus for replicated state machines, observability (metrics, logs, traces), CLI tools, Kubernetes deployment, and testing/benchmarking.
【Key Takeaways】
- **Go's standard library is a distributed-systems powerhouse** (Opening): encoding/json and net/http make building JSON/HTTP services straightforward, with declarative struct tags eliminating boilerplate marshaling code.
- **Protobuf ensures consistent schemas across services** (Early): defining messages in .proto files with field numbers enables versioning and type checking, preventing inconsistent data models in production.
- **The commit log is the heart of distributed systems** (Early): write-ahead logs (also called commit logs) provide durability and ordering, making them essential for building reliable, scalable services.
- **Memory-mapped files optimize index performance** (Early): using gommap for index storage allows fast reads/writes with minimal system calls, crucial for handling high-throughput log operations.
- **gRPC offers performance and scalability advantages** (Middle): built on protobuf and HTTP/2, it provides efficient serialization and long-lasting connections, reducing server costs and enabling multi-language clients.
- **Security must be built in from the start** (Late): tacking on encryption, authentication, and authorization later is painful—designing them in three steps (encrypt, authenticate, authorize) is far easier.
- **Custom errors improve RPC debugging** (Middle): returning structured error types with status codes and localized messages lets clients type-switch and handle failures gracefully.
- **Distributed coordination requires consensus algorithms** (Ending): Raft-powered replicated state machines handle node additions/removals automatically, ensuring system reliability without manual intervention.
【Reading Tips】
- **Skim the JSON/HTTP chapter** (~6%–9%) if you're already comfortable with Go's net/http—it's foundational but straightforward; focus instead on the protobuf setup that follows.
- **Deep-read the log package chapters** (~19%–34%): this is the most intricate code, covering segments, indexes, and concurrency—take time to understand the store and index implementations.
- **Pay attention to the security chapter** (~47%–60%): the three-step approach (encrypt, authenticate, authorize) is a reusable pattern; the Certificate Authority setup is practical for real-world internal services.
- **Use the test-driven approach**: the book includes extensive tests (e.g., TestLog, TestIndex)—run them as you code to verify each component, and use them as templates for your own projects.
- **Skip ahead if you need deployment quickly**: the Kubernetes and CLI sections (~60%+) can be skimmed initially; return to them after mastering the core service logic.
【Coverage Limits】
The excerpts cover the book's opening through the security chapter (~47%), with later sections on service discovery, Raft, observability, and Kubernetes mentioned but not detailed. Deployment specifics and advanced consensus implementation are not fully covered in this guide.
Excerpt 1
ragmatic Bookshelf Raleigh, North Carolina Contents • vii 9. Discover Servers and Load Balance from the Client . . . 171 Three Load-Balancing Strategies 171...
n right followed by its name (with an additional field ID). Following the package declarations in the protobuf code, we define our Record type. Protocol buff...
mplement authorization is with an access control list (ACL).6 An ACL is a table of rules where each row says something like “Subject A is permitted to do act...
egrate your service discovery with many platforms. You sink a lot of effort into that kind of work, and that’s likely a poor use of your time when you could...
n the snapshot store you configured Raft with, could be in- memory, a file, an S3 bucket—something to store the bytes in. We’re using the file snapshot store...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Distributed Services with Go Your Guide to Reliable, Scalable, and Maintainable Systems (Travis Jeffery)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Distributed Services with Go Your Guide to Reliable, Scalable, and Maintainable Systems (Travis Jeffery)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment