Architecture
Systems thinking decoupled from any specific technology — how multiple nodes cooperate, how services are structured, how systems stay reliable
Architecture
This section is the macro counterpart to Code Craft. Where Code Craft asks "how do I write this line well?", Architecture asks "how should the whole system be put together?" — and the answers live above any specific language, framework, or vendor.
The material here is deliberately technology-agnostic. Concrete tooling — Kafka, Kubernetes, Redis, Postgres — lives under infrastructure/ and database/. This section is about the ideas that survive the next platform migration.
Topics
Distributed Systems
The theory and mechanisms that make multi-node systems correct: CAP, consensus, consistency models, ordering, idempotency, distributed transactions, leader election. If your problem has more than one process, this is the math you cannot escape.
Software Architecture
The styles and patterns for organizing services and code: microservices vs monolith, DDD and bounded contexts, event-driven, CQRS / event sourcing, Clean / Hexagonal layering, BFF. These are design choices — you can pick a different flavor and still ship.
Comparison
Side-by-side comparisons of architectural tools and platforms — workflow orchestration, eventing, and other tooling where the choice itself is an architectural decision.
How These Relate
A useful distinction when something feels like it belongs to both:
If it has a proof or an invariant, it's distributed systems. If it's a way to organize code or services, it's software architecture.
Saga, for example, lives in two places: as a protocol (compensation correctness) in distributed systems, and as a pattern (long-running business workflows) in software architecture.
Scope and Boundaries
| Concern | Lives here | Lives elsewhere |
|---|---|---|
| Consensus, CAP, consistency models, ordering | ✓ (distributed-systems) | — |
| Microservices, DDD, event-driven, CQRS | ✓ (software-architecture) | — |
| A specific Kafka topic layout, a Redis cache strategy | — | infrastructure/ |
| Code-level design (SOLID, naming, function shape) | — | code-craft/ |
| Database internals (sharding, replication mechanics) | partly cross-linked | database/advanced/ |
| Operational practice (SLOs, on-call, incident response) | — | (planned: architecture/reliability/) |
How to Read This Section
The two subsections are independent: you can read either without the other and get value. But the topics relate, and which one you start with depends on what you are trying to do.
If You Have Time for One Page
- Starting from scratch in software architecture? Read Software Architecture › Monolith. The default that more systems should have stayed.
- Starting from scratch in distributed systems? Read Distributed Systems › Consistency Models. Every other distributed-systems conversation assumes its vocabulary.
Reading Tracks by Goal
Different starting points use different parts of the chapter. Pick the track whose premise matches yours.
Track A — Designing a new system. Greenfield project, choosing a starting shape.
- Software Architecture › Monolith — the default; understand it before splitting.
- Software Architecture › Modular Monolith — the underrated middle ground for most systems.
- Software Architecture › DDD Strategic Design — bounded contexts decide where your modules go.
- Software Architecture › Conway's Law — check your team structure supports your architecture.
- Software Architecture › Anti-Patterns — read this before making the mistakes, not after.
Track B — Splitting an existing monolith. Operational pain has built up; thinking about service extraction.
- Software Architecture › When to Split — the decision itself, with real vs false signals.
- Software Architecture › Microservices — what you're committing to and what it costs.
- Distributed Systems › Idempotency — the everyday tool you'll use at every boundary.
- Software Architecture › Outbox Pattern — the reliable bridge between database and message bus.
- Software Architecture › Saga Pattern — multi-service workflows once you've split.
Track C — Building a service that calls other services. Designing or reviewing a new microservice.
- Distributed Systems › Idempotency — make every external call safe to retry.
- Distributed Systems › Exactly-Once Semantics — what your messaging layer cannot give you, and what to do instead.
- Software Architecture › Event-Driven Architecture — the three flavors, and how to pick.
- Software Architecture › Saga Pattern ↔ Distributed Systems › Saga Protocol — read both sides of saga.
- Software Architecture › Anticorruption Layer — keep external models from polluting yours.
Track D — Operating distributed infrastructure. On-call for a Kafka, etcd, Cassandra, or similar cluster.
- Distributed Systems › Failure Models — the taxonomy you need before any post-mortem.
- Distributed Systems › CAP & PACELC — decode the trade-off you're operating against.
- Distributed Systems › Raft or Paxos — whichever your cluster runs.
- Distributed Systems › Leader Election — the single most common source of incidents.
- Distributed Systems › Membership & Failure Detection — why your cluster thinks a healthy node is dead.
Track E — Picking a database, broker, or workflow engine. Evaluating vendors; trying to decode marketing claims.
- Distributed Systems › CAP & PACELC — read CP/AP labels honestly.
- Distributed Systems › Consistency Models — when "strongly consistent" is meaningful.
- Distributed Systems › Quorum Systems — what
R + W > Ndoes and does not give. - Distributed Systems › Exactly-Once Semantics — what brokers actually deliver.
- Comparison › Inngest vs Trigger.dev — for the specific workflow-engine question.
Track F — Diagnosing a system that is not working. The existing architecture has stopped serving the team well.
- Software Architecture › Anti-Patterns — the diagnostic catalogue.
- Software Architecture › Conway's Law — many architectural problems are organizational.
- Distributed Systems › Failure Models — many "weird production issues" are unnamed failure classes.
- Software Architecture › When to Split — applies both ways: when to split, and when to recombine.
Cross-Chapter Pairs to Read Together
Some topics deliberately split between the two subsections, with a different angle on each side:
| Topic | Distributed Systems (theory / correctness) | Software Architecture (pattern / structure) |
|---|---|---|
| Saga | Saga Protocol | Saga Pattern |
| Idempotency | Idempotency | Outbox Pattern |
| Events | Exactly-Once Semantics | Event-Driven Architecture |
| Locks / Leadership | Distributed Locks, Leader Election | (used in service designs across the chapter) |
If something feels like it belongs in both places, it usually does — read both.
Practitioner Reality Check
A short list of pages that show up in day-to-day engineering work more than the others:
- Idempotency — used in every cross-service call.
- Consistency Models — used in every "is this safe?" conversation.
- CAP & PACELC — used to decode every database's marketing page.
- Failure Models — used in every post-mortem.
- Monolith + When to Split — used in every "should we go to microservices?" conversation.
- Conway's Law — used in every "why doesn't our architecture match the org chart?" conversation.
- Anti-Patterns — used to diagnose what your team is in the middle of doing wrong.
The rest are tools you pull off the shelf when a specific problem calls for them.