Software architecture
Overview
Software architecture captures the major structures of a system, the relationships among components, and the principles guiding design and evolution. Good architecture balances functional requirements with -ilities (scalability, reliability, security, maintainability) under organizational constraints.
Key concepts
- Architectural styles — Layered, microservices, event-driven, modular monolith.
- Boundaries — Encapsulation, APIs, and data ownership between modules.
- Trade-off analysis — Performance vs simplicity; consistency vs availability (CAP intuition).
- Architecture decision records (ADRs) — Lightweight log of context, decision, consequences.
- Evolution — Strangler patterns and incremental refactors vs big rewrites.
Request path in a layered web app
Sample: ADR template
# ADR 0007: Use PostgreSQL for transactional store
## Status
Accepted
## Context
We need ACID transactions and complex queries for billing.
## Decision
Use PostgreSQL 16 managed instance; no document store for money paths.
## Consequences
+ Strong consistency, mature tooling
- Operational cost vs SQLite / serverless DB