Planning a migration.
Migrations fail on the intermediate states, which is exactly the part nobody draws.
Draw both ends first
Generate the current architecture from the code and infrastructure as it is, and draw the target as you intend it. Having both in the same notation makes the difference legible, and it is common for the current-state diagram to be the surprise: the thing you are migrating from is usually not quite what people believed it was.
The intermediate states are the plan
The interesting question is not where you end up but what runs during the migration, because that is where dual writes, backfills and consistency problems live. Drawing the intermediate states makes the sequencing explicit, and the sequence is the plan. A migration document with only a before and an after has skipped the difficult part.
Find what depends on what you are moving
The usual cause of a migration overrunning is discovering a consumer nobody knew about. A generated diagram of the current state surfaces the dependencies that are expressed in code, which is most of them, early enough to be scheduled rather than discovered.
Then keep it current
A migration runs for months and the diagram drifts within weeks unless regenerating is cheap. Because this generates from the code, the current-state picture can be refreshed as often as the migration progresses, which is what makes it usable as a status artifact rather than a launch artifact.
Both states
Questions
Related
- Onboarding Engineers to a CodebaseThe first week is spent building a mental model that somebody already has. A diagram transfers it in an afternoon.
- Documenting Legacy CodeIncluding the newest kind of legacy code: what a coding agent wrote for you over several sessions that nobody has looked at as a whole.
- Architecture ReviewMost of the effort in an architecture review goes into producing the diagrams, and most of those diagrams describe the system as remembered rather than as built.
- System Design Interview PreparationThe diagram is the easy part. Interviews are decided by the tradeoffs you can defend when the interviewer pushes.