Most companies do not need to replace their legacy ERP this year. They need it to talk to things: a customer portal, an ecommerce store, a CRM, a warehouse app, a reporting tool. And the usual way that happens is that each new system gets its own direct connection into the ERP’s database, until the ERP is surrounded by a dozen fragile integrations that all break whenever anything changes.
There is a better pattern, and it does not require touching the ERP’s core at all.
Why direct database integrations go wrong
Reading and writing straight into the ERP’s tables is the fastest way to ship the first integration. It is also how every later change becomes dangerous:
- The tables were never designed as an interface. Column meanings drift, status codes get reused, and one field quietly means three things depending on another field.
- Business rules get skipped. The ERP enforces rules in its application code. A direct write bypasses all of them, so data that the ERP would never create starts appearing.
- Every integration copies the same knowledge. Five systems each learn what a “closed” order looks like in the database, and each gets it slightly wrong.
- Upgrades become impossible. Once enough outside systems depend on the exact schema, nobody can change it, which is how a legacy system gets more legacy every year.
The facade: one door in, one door out
The fix is to put a single integration layer in front of the ERP and route every outside system through it. In architecture terms this is an API facade, sometimes called an anti-corruption layer. In practical terms it is a small, modern service that:
- exposes clean, documented endpoints in your business’s own language (orders, customers, invoices, stock),
- translates those calls into whatever the ERP actually needs, whether that is a stored procedure, a vendor API, a file drop, or a carefully controlled table write,
- validates inputs so outside systems cannot create data the ERP would reject,
- logs every call so you can see who changed what and when.
The ERP itself does not change. The knowledge of how it works lives in one place instead of being spread across every system that touches it.
Reads, writes, and events
Not every integration needs the same treatment.
Reads are usually the easiest win. Portals and dashboards mostly need to look things up. A facade can serve those from a read replica or a cache so a busy customer portal never slows down the warehouse team.
Writes need the most care. Route them through whatever path the ERP itself uses to enforce its rules. If that path is slow or awkward, queue the writes and process them in order, so outside systems get a fast acknowledgement and the ERP gets data it can trust.
Events solve the “how do other systems find out” problem. Instead of every system polling the ERP every five minutes, the facade publishes events when something changes: order shipped, invoice paid, stock below threshold. Other systems subscribe. Change data capture on the ERP’s database is a common way to generate those events without modifying the ERP’s code.
A typical first project
A common starting point looks like this: customers want to check order status and download invoices without emailing someone, and the sales team wants the CRM to show what each customer has actually bought.
- Build the facade with a small set of read endpoints: customers, orders, invoices.
- Put a customer portal on top of it.
- Publish order and invoice events so the CRM stays in sync without polling.
- Add write endpoints later, one at a time, once the read side has proven stable.
The ERP keeps running exactly as before. The business gets a modern front door within weeks instead of waiting on a multi-year replacement.
How this sets up modernization later
The facade is not just an integration convenience. It is the first step of a legacy ERP modernization. Once every outside system talks to the facade instead of the database, you can move one domain at a time behind it, say invoicing onto a new service, and none of the systems in front need to know. The facade keeps the same endpoints; only what sits behind them changes.
That is the core idea behind the strangler fig approach we describe in legacy .NET modernization without a rewrite: wrap the old system, then replace it piece by piece from behind the wrapper.
Mistakes to avoid
- Mirroring the ERP’s schema in the API. If the endpoints look exactly like the tables, you have only moved the coupling, not removed it.
- Building the facade with no owner. It becomes critical infrastructure the moment the second system depends on it. Give it tests, monitoring, and someone responsible.
- Letting “just this one” integration skip the facade. Every exception becomes permanent.
- Syncing everything both ways. Two-way sync between systems that both think they own the same data is a reliable source of conflicts. Decide which system is the source of truth for each record type.
Next step
If your ERP is surrounded by integrations nobody fully understands, a short audit can map them and tell you which ones to move behind a facade first. See legacy system modernization or get an estimate on a free scope call.