Reading and writing against a system you do not own
Building on top of an ERP means accepting somebody else's model of the world. The fields you want may not exist, the validation you need may live in a screen rather than in the data layer, and a direct database write can bypass logic that keeps the ledger consistent. The first task is establishing what is genuinely safe to write, which is a question for the ERP owner and sometimes for the vendor, and it is worth settling before design rather than during testing.
Where a supported interface exists, use it even when it is slower than the alternative. Direct table writes are tempting and they are the reason some organisations can no longer upgrade. Where no interface exists, an adapter isolating the integration into one component keeps the awkwardness contained, so when the underlying system is upgraded the change lands in one place. Caching reference data locally is reasonable. Caching transactional data usually is not, and that distinction deserves an explicit argument.
Failure behaviour needs deciding at design time rather than in production. If the ERP is unavailable, does the application refuse the action, queue it, or record it locally and reconcile later. All three are legitimate and they suit different processes. What causes real damage is not deciding at all, because the default in that situation is that the application appears to succeed while the data quietly diverges, and somebody in finance discovers it several weeks later.
- Safe write paths agreed with the system owner before design, not discovered during testing
- Supported interfaces preferred over direct table access, even where slower
- Integration isolated into an adapter so an upgrade touches one component
- Reference data cached locally where appropriate, transactional data generally not
- Explicit agreed behaviour for the case where the source system is unavailable