An integration is not simply a connection between two tools. It is an operating agreement about which system owns each fact, who may change it, what happens when a dependency fails, and how the team can reconstruct an event later. This guide provides a reference architecture for making those decisions before implementation.
Start with the operating boundary
List the actors, decisions, records, exceptions, and handoffs in the workflow. Then identify what must remain in an existing product and what belongs in the internal system. A useful boundary reduces duplicate ownership: customer identity may live in one system, invoices in another, and operational status in the internal application.
Do not begin with a diagram of technologies. Begin with an ownership table: record, system of record, allowed writers, readers, validation rules, retention need, and failure impact.
Minimum ownership table
| Question | Decision to record | Why it matters |
|---|---|---|
| Source of truth | One authoritative system per business fact | Prevents conflicting values |
| Change authority | Roles or systems allowed to write | Limits accidental or unauthorized changes |
| Sync expectation | Immediate, scheduled, or manual | Sets latency and failure expectations |
| Failure owner | Person or team responsible for recovery | Avoids silent operational debt |
| Audit need | Events and context that must be retained | Supports investigation and accountability |
Define the contract, not only the endpoint
An API contract should define fields, formats, required values, authentication, errors, and version behavior. OpenAPI offers a standard, language-agnostic way to describe HTTP APIs. The contract should be reviewed alongside business rules because technically valid data can still be operationally wrong.
Use a consistent error shape, make retry behavior explicit, and decide which operations must be idempotent. RFC 9457 defines a machine-readable problem-details format for HTTP APIs; it is a useful baseline when the participating systems can support it.
Design for failure before the happy path
- Set timeouts and bounded retries instead of waiting indefinitely.
- Use idempotency or deduplication where repeated requests could create duplicate actions.
- Record correlation identifiers so one operation can be traced across systems.
- Send irrecoverable events to a review queue with enough context for a human decision.
- Make partial states visible to operators; do not present stale data as successfully synchronized.
- Define replay and reconciliation procedures before launch.
Permissions and audit trails are different controls
Authorization determines whether an actor may perform an action. An audit trail records what occurred: actor, time, action, affected record, and relevant before/after context. One does not replace the other.
Use least privilege and separate administrative actions from everyday workflow roles. Apply controls according to actual data and business risk. The OWASP API Security project is a useful threat-oriented checklist, but a checklist does not replace project-specific security review.
Observability must answer operational questions
Logs, metrics, and alerts are useful only when someone can act on them. Define health signals such as failed synchronization count, oldest pending event, retry exhaustion, invalid payload count, and reconciliation variance. Assign each alert an owner and an action.
Avoid placing sensitive payloads in logs by default. Retain only what the investigation and compliance context require, with access and retention decisions documented.
Plan migration and reconciliation together
Before importing data, profile duplicates, missing identifiers, conflicting formats, orphan records, and fields without an accountable owner. Establish mapping rules and a rejected-row workflow. Keep a reproducible migration record rather than correcting production data invisibly.
For phased launches, define which system may write during each stage. A temporary dual-running period can help validate behavior, but two uncontrolled writers create ambiguity. Reconciliation criteria and rollback conditions should be agreed before the cutover.
Build, buy, or integrate?
| Option | Best fit | Primary risk to test |
|---|---|---|
| Configure an existing product | Common workflow and acceptable constraints | Process distortion or vendor lock-in |
| Integrate existing products | Capabilities already fit, but data is fragmented | API limits, ownership, and recovery |
| Build an internal system | Differentiating rules or workflow do not fit standard tools | Scope, adoption, maintenance, and lifecycle ownership |
Architecture review checklist
- Name the source of truth for every important record.
- Define writers, readers, roles, and exceptional approvals.
- Document API contracts and version assumptions.
- Specify timeout, retry, idempotency, replay, and reconciliation behavior.
- Define audit events without over-collecting sensitive data.
- Assign monitoring alerts and recovery ownership.
- Test migration, cutover, rollback, and ongoing data reconciliation.
- Record what is configured, integrated, and custom-built—and why.
Primary technical references
These sources support the standards and security concepts used above. The architectural recommendations are The Agency Costa Rica's editorial synthesis.
- OpenAPI SpecificationOpenAPI Initiative
- RFC 9457: Problem Details for HTTP APIsRFC Editor
- OWASP API Security ProjectOWASP Foundation
A reliable internal system makes ownership, state, exceptions, and recovery visible. The right architecture is the smallest one that handles the real workflow and its failure conditions without creating a second source of operational confusion.