Distributed Systems

Request coalescing with Go singleflight

A hot cache key expires and a hundred requests issue the same query at once, saturating the database. Go's singleflight package coalesces those duplicate calls into one. How to wire it up, how to measure whether it's firing, and why per-pod coalescing is usually enough.

Testing unary gRPC services in Go

How to test unary gRPC services in Go - handler logic, interceptors, deadlines, metadata propagation, and rich error details - all in-memory with bufconn.

Wrapping a gRPC client in Go

How to wrap a generated gRPC client behind a clean Go API so users never have to touch protobuf types or connection management directly.

Notes on building event-driven systems

Deep dive into event-driven architecture patterns. Learn publish-subscribe, CQRS, outbox pattern, eventual consistency, and handling microservice coupling.

Protobuffed contracts

Define service contracts with Protocol Buffers for non-gRPC systems. Generate serializers, maintain self-documented APIs, and ensure cross-language compatibility.