Software architecture
Software architecture: bounded contexts, monolith vs microservices, ports and adapters, monorepos, events, feature flags, the strangler fig and decision records.
8 lessons
Boundaries and structure
- 1Bounded contexts (DDD-lite)Give each context one meaning per term and its own model; map the links, and translate where an outside model enters.
- 2Modular monolith vs microservicesOne deployable with enforced modules first; move a module out only for a named difference, and pay for every call that then crosses the network.
- 3Layers, ports and adaptersKeep the rules in a core that imports nothing outside it; plug the outside in through ports, and port only what lives outside.
- 4Monorepos and workspace boundariesOne repository, many deployables: the declared dependency graph decides what each change rebuilds.
Integration between parts
Changing architecture safely
- 6Feature flags and their lifecycleDeploy ships code switched off; a flag edit releases it or takes it back; each kind has a lifetime, and a leftover flag is debt.
- 7Strangler fig migrationRoute at the front, move one slice at a time, prove each slice by shadow comparison, then delete what the old path no longer serves.
- 8Architecture decision recordsAn ADR is a short, dated record of one decision, kept beside the code; a changed decision gets a new record, not an edit.