Resources

Choosing an enterprise integration pattern

Integration patterns solve different problems. Match the pattern to the required interaction and document the failure behavior at each boundary.

Start with what crosses the boundary.

An order query, command, event and extract carry different responsibilities. Define the interaction before selecting the technology.

What is the order status now?

Query

Meaning

Read a source observation. An API or federated query may fit when the source supports the access pattern.

Completion evidence

Record the responding source, observed version or time, and the scope of the result.

Operating question

If the source is unavailable, may the consumer use an older observation? Make its age and limits explicit.

Can we reserve capacity for this order?

Command

Meaning

Request a change under an explicit authority and business precondition.

Completion evidence

Distinguish submitted, accepted and completed. Preserve the operation reference and verify the resulting state.

Operating question

If confirmation is lost, could retrying reserve twice? Use the provider’s actual concurrency, idempotency and reconciliation behavior.

How do consumers learn that dispatch occurred?

Fact / event

Meaning

Publish a recorded business occurrence for independent consumers. Define the producer and the fact separately from its transport.

Completion evidence

Retain event identity within its source namespace, occurrence time and schema. Define delivery, ordering and retention in the operating contract.

Operating question

How are duplicates, late arrival and replay handled? An event envelope does not establish those guarantees.

Which records belong to the closed period?

Bounded extract

Meaning

Exchange a reproducible population with a stated entity, period and inclusion rule.

Completion evidence

Retain the extract boundary, manifest, completeness check and run identity. A file’s presence alone is insufficient.

Operating question

How is a partial delivery detected, and what happens when a corrected extract replaces the earlier one?

Classify the interaction before the technology

Start by asking whether the consumer needs to request current information, issue a command, learn that something happened or obtain a reproducible data extract. Those interactions have different expectations. A synchronous request gives the caller an immediate response path. An event decouples publication from the timing of downstream processing. A batch extract defines a bounded population that may be easier to reconcile.

Record acceptable latency, consistency requirements and the source system’s supported interfaces. Consider whether the integration may influence an operational transaction or only observe it. A preferred technology should not force an unsupported access pattern onto a critical source.

Source assessment recording the business scope, ownership and unresolved operating questions.
Assess the source boundary and its evidence before selecting an integration method.

Use APIs for explicit request boundaries

An API is useful when a consumer needs an explicit operation with a defined request and response. Document its resources or commands with an appropriate interface description such as OpenAPI. Specify authentication, authorization, validation errors and pagination where relevant. Avoid assuming that a successful transport response means a business operation has fully completed if processing continues asynchronously.

HTTP semantics distinguish method properties such as safety and idempotency. Use those properties correctly, and define retry behavior for the actual operation. A timeout can leave the caller uncertain about whether a command succeeded. Where the provider supports an operation identifier or idempotency mechanism, preserve it across retries and expose a way to reconcile the final state.

Use events for independently consumed facts

Events allow multiple consumers to react to a recorded change without requiring the producer to call each one directly. Define the business fact, producer authority and schema independently from the transport. CloudEvents provides common envelope attributes, while AsyncAPI can describe asynchronous interfaces. These standards improve clarity but do not determine the application’s delivery, ordering or retention guarantees.

Design consumers for duplicates, late delivery and replay. Choose ordering keys based on the entity whose sequence matters. Keep projection updates separate from external side effects where possible. A stream is not automatically a complete historical record: retention, compaction and source publication gaps affect what can be reconstructed. Document those limits for consumers that depend on recovery or audit evidence.

Translate database changes into business events

Change data capture can expose committed database changes without requiring every application operation to publish a separate business event. It is useful when the source supports the mechanism and its operational impact is acceptable. However, a changed row may describe an implementation detail rather than a stable business fact. Consumers need a deliberate translation from storage structure to domain meaning.

Plan for initial snapshots, schema changes, deletes and restart positions. Understand how transactional boundaries appear in the selected connector. Where the application can be changed, an outbox can record explicit publication intent alongside the business transaction; Debezium documents a corresponding routing pattern. Neither approach removes the need for reconciliation and visible handling of malformed or incompatible records.

Use batch for extracts and federation for queries

Batch exchange remains appropriate for bounded extracts, periodic reconciliation and sources with limited connectivity. Define the extract boundary, manifest, checksum where supported and completion signal. A file’s presence should not be the only proof that it is complete. Make reruns identifiable and specify how replacement extracts or late corrections affect downstream state.

Federation serves a different need by providing query access across supported sources. Inspect query plans, pushdown behavior and source load before relying on it for repeated workloads. It can complement persisted data products rather than replace all movement. Compare freshness, consistency and resource impact when choosing an approach.

Standardize the operating contract across patterns

Every integration needs an owner, identity boundary, contract version and observable state. Record how failures are surfaced, how retries behave and how operators prove that recovery is complete. Maintain source and destination references that support reconciliation. The operational questions remain similar even when one connection uses a file, another uses an API and a third consumes a stream.

Test representative failure cases before expanding the integration estate: revoked credentials, partial delivery, malformed payloads, duplicate records and unavailable dependencies. Review the response with both producer and consumer teams.