Redowan's Reflections
Recent writing
Translating errors at layer boundaries so storage details don't leak into the handler or, worse, into client responses.
Key takeaways from Amazon's 2007 Dynamo paper.
Why logging at every layer of a service produces noise, and how to log only at the handler level while propagating context from below.
Switch, map of functions, and interface registry for dispatching in Go.
Why & backgrounds execution but doesn't stop output from flooding your terminal.
How to test unary gRPC services in Go - handler logic, interceptors, deadlines, metadata propagation, and rich error details - all in-memory with bufconn.
Decoupling business logic from storage in Go, adding transaction support without leaking SQL details, and coordinating atomic writes across multiple repositories using a unit of work.
Adding transaction support to a repository interface without leaking storage details.
Why the middleware-to-handler boundary is a special case for context values.
A simple litmus test for when to use context values in Go.
Decoupling business logic from storage with a small interface 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.
Why the etcd codebase is my go-to reference for building gRPC services in Go.
Exploring the tradeoffs between wrapping errors at every return site versus wrapping only at boundaries, with no definitive answer - just honest tradeoffs for the kind of software I write.
Why your mutex wrapper should accept a closure for mutation instead of a plain value, with examples from the standard library and Tailscale.