Architecture Patterns
Structural and integration patterns — how systems are shaped and how parts talk.
Layered (N-Tier) Architecture
Split an application into horizontal layers — presentation, application, domain, data — where each layer only calls the one below it.
Hexagonal Architecture (Ports & Adapters)
Put the business core at the centre and talk to the outside world — HTTP, DB, queues, third-party APIs — only through ports (interfaces) implemented by swappable adapters.
Clean Architecture
Concentric rings — entities, use cases, interface adapters, frameworks — with one rule: source-code dependencies only point inward.
Modular Monolith
One deployable unit, internally split into strongly bounded modules with explicit public APIs — microservice-style boundaries without the distributed-systems tax.
Microservices Architecture
Structure a system as independently deployable services, each owning a business capability and its data, communicating over the network.
Event-Driven Architecture
Services announce facts ("EntryPublished") and others react asynchronously — decoupling producers from consumers in time, space and knowledge.
CQRS (Command Query Responsibility Segregation)
Use one model to change data (commands) and a different, optimised model to read it (queries) — often kept in sync by events.
Event Sourcing
Store every state change as an immutable event; current state is derived by replaying events. The log is the source of truth.
Saga Pattern
Keep data consistent across services without distributed transactions — a sequence of local transactions, each with a compensating action if a later step fails.
Transactional Outbox
Write the business change and the outgoing event in the same local transaction, then relay the event to the broker — no more "saved to DB but message lost".
Strangler Fig Migration
Replace a legacy system incrementally — route traffic slice by slice to the new system behind a facade until the old one can be switched off.
API Gateway & Backend-for-Frontend (BFF)
A single entry point that handles cross-cutting concerns (auth, rate limits, routing); BFFs go further with one tailored backend per client type.
Circuit Breaker, Retry, Timeout & Bulkhead
The resilience toolkit — fail fast, retry safely, bound waiting, and isolate resources so one slow dependency can't take down the whole system.
Sidecar & Service Mesh
Move networking concerns — mTLS, retries, traffic splitting, telemetry — out of application code into a proxy deployed next to every service.
Multi-Tenant SaaS Architecture
Serve many customers from shared infrastructure while guaranteeing isolation of data, performance and configuration per tenant.