Integrating With Legacy Systems Without Rewriting Them

The system everyone wants replaced is usually the one holding the data everything else needs. There is a well-worn set of techniques for integrating with it that does not require touching it, and they buy years of room.

10 min read
Integrating With Legacy Systems Without Rewriting Them

Why the Rewrite Keeps Not Happening

Every estate has one. A system that is fifteen or twenty years old, that everything depends on, that nobody fully understands, and that has survived three replacement programs. The usual diagnosis is organizational inertia. More often it is that the system encodes a great deal of hard-won behavior (edge cases, exceptions, local rules) that nobody has written down, and every replacement attempt discovers this halfway through.

Meanwhile, new work needs that system's data. The pragmatic question is not how to replace it but how to build against it without making the eventual replacement harder. There is a good answer, and it starts with refusing to let new systems talk to it directly.

A Facade, Not a Fork

The foundational move is a layer in front of the legacy system that presents a clean, modern interface and hides everything behind it. New consumers integrate with the facade. Nothing new ever connects to the legacy system directly.

The discipline matters more than the technology. The facade is only valuable if it is the only door. The moment a second consumer connects directly, because it was quicker that week, you have two integration surfaces and the replacement becomes twice as hard. Make the legacy system's network reachability match this rule rather than relying on convention, because conventions lose to deadlines.

What the facade buys you is an interface that outlives what is behind it. When the legacy system is eventually replaced, consumers do not change; the facade's implementation does. That is the entire strategy in one sentence, and it is what makes the integration layer an asset rather than more plumbing. The contract design rules in our piece on versioning apply with full force here, because this interface is going to be long-lived by design.

Read and Write Are Different Problems

Almost everyone starts with reads, and they are right to.

Reads are low risk. If the facade returns something wrong, you have a bad response, not a corrupted record. You can cache aggressively, you can degrade to stale data, and you can build read-only value quickly: a public-facing status lookup, a reporting feed, a search index.

Writes are where the difficulty lives, because the legacy system almost certainly enforces rules that are not documented and not reproducible from outside. Validation embedded in screen logic. Side effects that fire on certain state transitions. Fields that are technically optional but break a downstream batch job if absent.

Several stances work, and choosing deliberately matters more than which you pick:

  • Reads through the facade, writes through the legacy interface. Unglamorous, safe, and often correct for a long time.
  • Writes through the facade into a staging area, applied to the legacy system by its own mechanisms. Slower, but the legacy rules still run.
  • Full write-through, which requires genuinely understanding the legacy rules. Only attempt this where the behavior has been proven by observation rather than assumed from documentation.

Find Out What Changed

Almost every integration eventually needs to know when something changed. The options, in descending order of preference:

  • Native events, if the system emits them. Rare in this class of system, but check before assuming.
  • Database change data capture, reading the transaction log. Low impact, catches everything including changes made by batch jobs and direct database edits, which is usually where the surprises are.
  • Timestamp polling, querying for rows modified since a watermark. Simple and widely applicable, but it silently misses hard deletes and anything updated without touching the timestamp column.
  • Full extract and compare. Crude, expensive, and completely reliable. A reasonable nightly backstop underneath a faster mechanism.

A frequent and effective combination is frequent polling for responsiveness with a nightly full comparison to catch what polling misses. The comparison also tells you how often polling is wrong, which is information worth having.

Translate Once, at the Boundary

Legacy data models carry accumulated peculiarities: codes whose meaning changed in 2011, status values that are no longer used but still appear in old records, dates stored as text in two different formats, a field repurposed for something unrelated to its name.

All of that translation belongs in the facade, expressed explicitly and commented with why. It should not leak outward into consumers, where it would be reimplemented slightly differently each time. That mapping layer, written down, is also the most valuable documentation of the legacy system anyone has ever produced. It is the undocumented knowledge, finally in a file.

Which is the real return. The facade solves today's integration problem, and the mapping inside it becomes the specification for the replacement that has failed three times for want of exactly that document. We build these boundaries as API and integration engineering work, usually alongside the new application that needed the data in the first place.

The mapping layer inside the facade is the most valuable documentation of the legacy system anyone has ever produced: undocumented knowledge, finally written in a file.

- Nexaces Team

Integrating around a legacy system is often treated as avoidance, a way of not doing the replacement. Done with discipline it is the opposite: it is the work that makes the replacement feasible.

Buy Time Deliberately

One door in, a clean contract facing outward, and every legacy quirk translated explicitly at the boundary. When the system behind it is finally replaced, the consumers do not notice, which is the only version of a migration that ever goes smoothly.

We design and build these integration layers, including the unglamorous archaeology of working out what the old system actually does.

Tags:
  • Legacy Systems
  • Integration
  • API Design
  • Modernization
  • Middleware
  • Government IT

Share This Post

Search Here

Recent Posts