Microservices
microservices
System Design
gRPC, GraphQL & API Gateway Patterns
REST is the default API style, but it is not always the best fit. gRPC excels at internal microservice communication with its binary protocol, strong typing, and streaming support. GraphQL solves the over-fetching and under-fetching problems of REST by letting clients request exactly the data they need. API Gateways unify multiple backend services behind a single entry point. This lesson covers when and why to use each technology, how they work at a protocol level, and how to combine them in a real-world architecture.
Distributed Transactions (2PC, Saga Pattern)
When a single business operation spans multiple services or databases, you cannot rely on a single ACID transaction. This lesson covers the two dominant patterns for keeping consistency across services: Two-Phase Commit (2PC) for synchronous, atomic, blocking transactions, and the Saga pattern (orchestration vs choreography) for long-running asynchronous workflows with compensating actions. We also cover Three-Phase Commit, idempotency keys, the outbox pattern, and the trade-offs that explain why 2PC is rare in microservices and Sagas are everywhere. By the end you can pick the right pattern for an order checkout, a money transfer, or a multi-step booking flow.
Microservices vs Monolith: When to Choose What
Microservices are not a maturity badge. Monoliths are not a code smell. The honest interview answer is that architecture is a continuum (monolith, modular monolith, services, microservices) and the right point on it is set by team size, deployment frequency, and the cost of distribution, not by what the cool kids at Netflix did. This lesson walks through the trade-offs concretely: latency tax, operational overhead, organizational coupling (Conway's Law), data consistency, and the migration paths that work. By the end you can defend either choice for a given product without reaching for buzzwords.
Community
API Gateway vs BFF vs Reverse Proxy
Three terms, three distinct concerns, three different owners. Most teams collapse them and end up with one thing pretending to be all three.
The Saga Pattern: When Distributed Transactions Aren't an Option
Why 2PC is rarely available, what a saga actually is, and the compensation design rules that separate working sagas from stuck ones.
Microservices vs Monolith: An Honest Comparison
Modular monolith is the right default for most teams. Microservices earn their cost only past a specific organizational scale, and the bar is higher than the literature suggests.
