Architecture Pattern Guide

Partner Boundaries, Schema Evolution, Throttling, and Replay

Goal

Explain how to keep an integration safe when external systems change, slow down, fail, and recover at different rates.

The previous section matched communication patterns to business meaning. At a partner boundary, that meaning must survive conditions neither side fully controls. The durable idea is:

External boundaries need explicit rules for change, speed, and recovery.

The Short Version

A partner can deploy a new schema, enforce a lower rate limit, return an unfamiliar status, resend old data, or become unavailable during your busiest period. Your architecture cannot prevent those events. It can prevent them from becoming uncontrolled failures inside your platform.

Use a boundary layer to validate contracts, limit traffic, buffer work where the business allows it, quarantine invalid exchanges, and control replay. Keep the raw partner representation separate from the internal business model so that an external change does not ripple through every domain.

The Partner Boundary

Think of the boundary as a sequence of controls rather than a single adapter:

flowchart LR
    A[Partner] --> B[Authenticate and authorize]
    B --> C[Validate version and shape]
    C --> D[Apply rate and size controls]
    D --> E[Translate to internal contract]
    E --> F[Process or buffer]
    F --> G[Record outcome]
    G -. controlled replay .-> E
    C --> H[Quarantine invalid exchange]
    F --> H

Each control has a specific purpose.

ControlProtects AgainstImportant Decision
Authentication and authorizationUnknown or over-privileged callers.Which partner identity may perform which operation?
Contract validationMalformed, unsupported, or ambiguous data.Is the exchange rejected, quarantined, or partially accepted?
Rate and size controlTraffic bursts, runaway retries, and oversized payloads.Should the caller slow down, or should work be buffered?
TranslationExternal representations leaking into internal domains.Where is partner vocabulary mapped to canonical business meaning?
Outcome recordingInvisible partial failure.Which technical and business result is retained?
Quarantine and replayPoison data and recoverable outages.Who may correct and resubmit work, under what safeguards?

Evolve Schemas Deliberately

Schema evolution is not only a serialization problem. It is a coordination problem between producers and consumers.

Changes usually fall into three practical categories:

  • Compatible change: existing consumers can continue safely, such as adding an optional field whose absence has a defined meaning.

  • Coordinated change: old and new forms must coexist while consumers migrate.

  • Breaking change: meaning or required structure changes enough that a new contract version is needed.

Compatibility depends on semantics, not just syntax. Adding an optional deliveryWindow field may be structurally safe, but not if consumers suddenly treat its absence as an error. Reusing an existing status code with a new meaning is more dangerous than adding a new field because the payload may still validate while the business interpretation is wrong.

A sound change process includes:

  1. A named contract owner.

  2. Compatibility rules for producers and consumers.

  3. Contract examples and automated tests.

  4. A way to discover affected consumers.

  5. A period in which versions can coexist when needed.

  6. Deprecation dates and an escalation path.

  7. Monitoring that shows use of old and new versions.

For internal consumers, the organization may control this process. For a partner, the process may also depend on commercial agreements, certification windows, and limited test environments. That makes early notice and tolerant boundary handling more important, not less.

Throttling Is a Reliability Boundary

Throttling is often described as a performance feature. In enterprise integration it is also a protection mechanism.

Without rate controls, a surge can overwhelm a partner. Aggressive retries can turn a small outage into a retry storm. A fast upstream system can fill an internal queue until the backlog becomes operationally unmanageable.

Design rate behavior in both directions:

SituationPossible ControlBusiness Signal to Expose
Partner limits requestsConcurrency cap, pacing, exponential backoff, and jitter.Oldest waiting work and expected delay.
Your platform receives a burstQuota, request shaping, bounded buffering, or explicit rejection.Rejected or deferred business operations by partner.
Queue grows faster than it drainsAdmission control and priority rules.Backlog age, not only message count.
Retries dominate capacityRetry budget, circuit breaking, and delayed retry.Retry rate and partner recovery state.

Buffering is not free capacity. A queue can protect the receiver temporarily, but it also creates delayed business work. Operators need to know whether the backlog represents ten harmless catalog updates or five thousand unfulfilled customer orders.

Replay Is a Controlled Business Operation

Replay is valuable when a consumer was unavailable, a defect was corrected, or a downstream view must be rebuilt. It is also dangerous because replay repeats history against today's state.

Safe replay normally requires:

  • Stable message or event identifiers.

  • Idempotent consumers or explicit duplicate detection.

  • A defined replay scope, such as partner, contract version, time window, or business key.

  • Authorization and approval for sensitive replays.

  • Isolation from live traffic when contention or ordering matters.

  • A dry-run, preview, or count when the impact is uncertain.

  • Audit records showing who initiated replay, why, and what happened.

  • Reconciliation afterward to prove the intended state was restored.

Idempotency means that repeating the same logical request does not repeat its business effect. It is not achieved merely by reading the same message twice. The receiver must recognize the operation or check the state transition before acting.

Some work should not be replayed automatically. A shipment notification might be safe to rebuild, while a refund, payment capture, or irreversible partner instruction may require review and a new compensating action.

Example: A Warehouse Partner Changes Its File

A warehouse partner sends a nightly availability file. It announces a new version that adds a location type, renames a required quantity field, and introduces a new DAMAGED stock status.

The commerce platform does not send the file directly into its inventory tables. The partner boundary identifies the file version, validates its header and records, retains the original file for the agreed period, and translates accepted records into the internal inventory contract.

During migration, the boundary accepts both supported versions. Invalid records go to a quarantine area with a reason code, while valid records continue if the contract permits partial acceptance. A control total compares records received, accepted, rejected, and applied.

If the partner sends the file twice, the ingestion identity prevents the same batch from being applied blindly. If a mapping defect is found later, an operator can select the affected version and time window, preview the records, replay them through the corrected translator, and reconcile the resulting inventory state.

This design keeps the commerce platform running while making partner change and recovery visible.

Common Mistakes

  • Treating schema compatibility as "the parser still works" while ignoring changed business meaning.

  • Retrying immediately and indefinitely, producing a retry storm during a partner outage.

  • Assuming a queue removes capacity limits. It delays pressure and creates a backlog that must be owned.

  • Replaying without idempotency, scope, approval, or reconciliation.

  • Letting an external payload become the internal domain model, spreading partner vocabulary throughout the platform.

If Someone Asks You

Why are schema evolution and throttling part of integration architecture?

A good answer is:

Because independent systems change and operate at different speeds. Schema rules protect meaning as contracts evolve, throttling prevents overload from spreading, and controlled replay restores missed work without duplicating business effects. Together they make the boundary survivable rather than merely connected.

What You Should Remember

External boundaries need rules for change, speed, and recovery.

Questions to Check Your Understanding

  1. Why can a syntactically compatible schema change still be unsafe?

  2. Which backlog measurement says more about business impact than message count alone?

  3. What must be true before an operator safely replays an exchange?

Further Study

  • AsyncAPI documentation - Explore interface documentation and specification support for event-driven contracts and their evolution.