05.1.2 · Skill in Iterative delivery

Incremental architecture

Growing the architecture step by step as real needs appear.

Incremental architecture builds what the product needs now and leaves room to change. It avoids big upfront designs based on guesses. Techniques like feature toggles and the strangler pattern let it evolve safely.

Your status · Incremental architecture

Saved in this browser. Sign in to keep it on every device.It colours this skill's tile on your map.

Why it matters for a product engineer

Most architecture decisions are made before anyone knows how the product will be used. Incremental architecture builds what the product needs now and keeps the next change possible. When a real need appears, the system changes in small, safe steps, while users keep working.

How to do it

  1. Start simple: one well-structured application, with clear modules inside it. Split it only when a boundary is clear and the split solves a real problem.
  2. Name the part that must change, and the reason: cost, outages, scale or a new kind of feature.
  3. Change it in parallel. Expand: add the new path next to the old one. Migrate: move callers and data across. Contract: remove the old path.
  4. Run the old and the new path side by side, and compare their answers before you trust the new one.
  5. Keep each step deployable and reversible, with a feature flag or a router in front.
  6. Delete the old path when nothing uses it. Two paths kept forever are a cost, not a safety net.

Common mistakes

  • A big rewrite that stops all other work and ships months later.
  • Splitting into services before the boundaries are known.
  • Building the new path inside the old code, when the old code is the problem.
  • Skipping the comparison, so the differences appear in production.

Example

The Guardian’s content system stored articles in MongoDB, and two outages had stopped publication on the site. In 2017 the team chose PostgreSQL. The old API had MongoDB details even in its controllers, so adding a second database there was too risky. Instead the team duplicated the API, put a proxy in front of both, and kept the old one as the primary. Records moved across, the new database became the primary, and the MongoDB cluster was switched off in April 2018.

Flow

How the Guardian moved its content off MongoDB

WriteRouteStoreCompareCMS appsJournalists atworkProxySends to bothOld APIMongoDB, primaryNew APIPostgreSQLDifferencesLogged per requestWriteRouteStoreCompareCMS appsJournalistsat workProxySends to bothOld APIMongoDB,primaryNew APIPostgreSQLDifferencesLogged perrequest

Both APIs answered every request, and the old one stayed in charge. Each logged difference was a bug found before the switch, not after.

ReportedThe Guardian engineering blog, 30 Nov 2018

Sources: Bye bye Mongo, hello Postgres (The Guardian) ↗ · Parallel change (Danilo Sato) ↗ · Monolith first (Martin Fowler) ↗

Resources

2
  • articleStart here
    Parallel change ↗
    Danilo Sato (martinfowler.com) · 6 min

    Expand, migrate, contract. The pattern behind changing schemas and APIs without breaking running code.

  • articleStart here
    Monolith first ↗
    Martin Fowler · 2015 · 6 min

    Why most successful systems start as one well-structured application and split only when boundaries are clear.