CAP & PACELC
What the CAP theorem actually says, why PACELC is the more useful everyday lens, and how to choose consistency vs availability for a bank ledger versus a product catalog.
Consistency Models
The spectrum from linearizable to eventual consistency, the session guarantees users actually notice, and the concrete techniques (leader reads, sticky routing, version tokens) that deliver them.
Replication
Single-leader, multi-leader and leaderless replication; synchronous vs asynchronous commits; quorums, hinted handoff, read repair and Merkle-tree anti-entropy; failover, split brain and replication-lag problems.
Consensus & Raft
Why distributed systems need consensus, how Raft elects leaders and replicates a log safely, Paxos at a glance, quorum math, where consensus is used (etcd, Consul, Kafka KRaft, CockroachDB) and what it costs.
Time, Clocks & Ordering
Why wall clocks lie in distributed systems, monotonic vs wall-clock time, Lamport and vector clocks, hybrid logical clocks, the TrueTime idea, fencing tokens, and how to order payment events safely.
Distributed Transactions: 2PC, TCC, Saga
How to keep money and orders consistent across services and databases β two-phase commit and its blocking problem, 3PC and XA, Try-Confirm-Cancel, and Sagas with compensations, semantic locks and pivot transactions.
Transactional Outbox & CDC
Why "write to the database and publish an event" is broken, how the transactional outbox fixes it, polling publishers vs log tailing with Debezium, consumer-side inbox deduplication, ordering guarantees and event schema evolution.
Idempotency & Exactly-Once
Delivery semantics, why exactly-once means at-least-once plus idempotent processing, idempotency keys done properly (storage, TTL, concurrent duplicates, response replay), dedup tables, Kafka's idempotent producer and transactions, and a Go middleware sketch.
Distributed Locks & Leases
When a distributed lock is the right tool and when a conditional write is better, Redis SET NX PX, the Redlock debate, leases and fencing tokens, etcd and ZooKeeper locks, and database row and advisory locks.
Resilience Patterns
Timeouts and deadline propagation, retries with exponential backoff and jitter, retry budgets, circuit breakers, bulkheads, load shedding, backpressure, graceful degradation and hedged requests β and how they combine to stop a cascading failure during a sale.
Observability & SLOs
Logs, metrics and traces with structured logging, RED and USE, OpenTelemetry and trace-context propagation, SLIs/SLOs/SLAs, error budgets and burn-rate alerting, a payment-service dashboard, and why audit logs are not observability logs.
Security for Architects
Authentication vs authorization, OAuth 2.0 and OIDC flows, JWT pitfalls, sessions vs tokens, mTLS and SPIFFE service identity, RBAC/ABAC, encryption and envelope encryption with KMS/HSM, tokenization, secrets management, OWASP API Top 10, zero trust and STRIDE threat modeling.