Skip to content

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

  1. 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.
  2. 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.
  3. 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.
  4. 4Monorepos and workspace boundariesOne repository, many deployables: the declared dependency graph decides what each change rebuilds.

Integration between parts

  1. 5Event-driven architecturePublish facts, not requests: consumers come and go freely, but the event's fields and order become the contract.

Changing architecture safely

  1. 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.
  2. 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.
  3. 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.