In most cases, tightening API boundaries is safer than rebuilding the database first
If the legacy ERP is still running, the usual constraint is that the business cannot stop. A direct database overhaul often drags in every integration point, report, sync script, and downstream tool at once. That blast radius is hard to control. In contrast, tightening the API layer first makes it easier to define which actions are allowed externally, which fields are writable, and which state changes must go through explicit workflows, all without forcing a full stop on operations.
Once API boundaries are clearer, many hidden problems reveal themselves. You can see which data should never have been edited from multiple places, which business logic is hiding in frontend code or scripts, and which fields survive only because of historical baggage. In that sense, the API layer is often the best place to stop the bleeding first. It is not the deepest layer, but it is often the fastest way to contain chaos.
Restrict critical write paths before multiple systems keep changing the same states independently
Pull risky business actions into explicit interfaces instead of allowing more scripts to hit the database directly
Build observability and traceability at the API layer before deciding how the data model should evolve