
Integration Architecture Patterns for Web Builds
Topology is the first structural choice and expensive to undo after launch. When direct, Backend-for-Frontend, iPaaS, or event-driven fits a website versus a shopping mall.
TL;DR: Where integration logic lives is a structural decision you make before the build, and it is expensive to undo after launch. This article compares four topologies for web and commerce builds: direct-from-the-application, Backend-for-Frontend (BFF), middleware or iPaaS, and event-driven with queues. It explains when each fits, why it recommends a BFF as the default mediation layer for both a corporate website and an official shopping mall, and gives you a topology-to-fit table with website-versus-commerce columns.
Topology is the first structural choice
Before you decide how an integration talks — synchronous, push, or pull — you decide where its logic lives. That placement shapes resilience, testing, ownership, and how hard the next integration will be to add. It is the first structural choice because every later decision inherits it.
The reason to make it deliberately is that the wrong topology is cheap to start and expensive to undo. Calling a payment provider directly from page code works on the first integration and the demo. By the fourth integration and the second surface it has become auth logic copied into several places, no shared point to retry or observe, and no single owner. Re-homing that logic after launch means touching live, revenue-bearing paths. The topology decision is worth making once, on paper, against the build's surface and scale — not discovered by accretion.
The asymmetry is the whole argument. Choosing a mediation layer before the build costs design time and a layer to maintain — a known, bounded cost paid up front. Discovering you need one after launch costs a migration of integration logic that now sits on paths customers depend on, performed while those paths are live, with the original "who owns this" question still unanswered. The two costs are not comparable, and they are not paid by the same people: the upfront cost lands on the team that has time to think, the retrofit cost lands on whoever is on call. Picking the topology early is not over-engineering; it is moving a fixed cost to the moment it is cheapest to pay.
One boundary is worth stating at the top so it does not blur the rest of the article. This is integration topology — where calls to external systems are mediated — not service decomposition. Whether your application is one deployable or many is a separate question; a single well-structured application can use any of these topologies, and a fleet of services can still wire integrations badly. Keep the two questions apart.
Direct from the application
Direct integration is the application calling the vendor itself, with no mediation layer in between. It is the simplest possible topology and the right one for a narrow case: low fan-out, low criticality, and a small number of integrations that rarely change. A brochure site with a contact-form provider and an analytics tag does not need a mediation layer to call two stable, degradable services.
It breaks down predictably as the build grows. Each new integration adds another place that holds a credential, another bespoke error path, another call with its own timeout-or-no-timeout decision. There is no single seam to add tracing, rate limiting, or a circuit breaker, so resilience becomes per-call folklore. Direct is not wrong; it is right until the integration count or the criticality rises, and the failure mode is keeping it past that point because it worked when there were two integrations and now there are nine.
Backend-for-Frontend
A Backend-for-Frontend is a server-side layer that sits between the client and the vendors and exists to serve a specific surface. It centralizes the things that should not be scattered across page code: authentication to vendors, response shaping for the client, a shared error model, and a seam for timeouts and retries on vendor calls. The cloud architecture pattern catalog describes the BFF and gateway patterns because this mediation problem is common enough to have a named, reusable solution. Its Backends for Frontends pattern page draws a narrower line: the BFF service should only handle client-specific logic related to a specific user experience, and cross-cutting features such as monitoring and authorization should be abstracted to maintain efficiency. On that page, typical features that might surface in the BFF service are handled separately with the Gatekeeping, Rate Limiting, and Routing patterns.
This article recommends the BFF as the default mediation layer for both surfaces. A corporate website's BFF keeps vendor credentials off the client, shapes CMS and search responses for the pages that need them, and gives marketing widgets a degradation story. A shopping mall's BFF does the same and adds the money-path discipline: an idempotent boundary in front of payment and order writes, one error taxonomy across payment, shipping, and inventory, and one observable seam where the checkout path's health is visible. The pattern is the same; the shopping mall simply exercises it harder. Recommending a BFF as the starting topology for a serious build, and treating direct as the exception you justify, is the right default for both.
Middleware and iPaaS
Middleware or an integration platform as a service (iPaaS) is a managed integration layer — a third-party product that hosts connectors, transformations, and orchestration so your team does not build and run them. It earns its cost in a specific situation: many heterogeneous systems, integration logic that is more configuration than code, and an operations team that would rather manage a platform than a fleet of bespoke connectors. Back-office-heavy programs with numerous enterprise systems fit that description.
The trade-offs are real and have to be priced in, not assumed away. An iPaaS introduces vendor lock-in at the integration layer, adds a hop that costs latency on paths where latency matters, and can make debugging harder because failures now happen inside a platform you do not fully control. For a latency-critical checkout path, a managed hop is a deliberate cost, not a free convenience. iPaaS is a sound choice when the integration estate is large and config-shaped; it is an overweight choice for a build with a handful of integrations and a tight critical path.
Event-driven and queues
Event-driven topology decouples producers from consumers through a queue or event bus: the producer emits an event and moves on, and consumers process it independently. The benefits are decoupling and spike absorption — a burst of orders does not have to be processed at the rate it arrives, and a slow downstream system does not stall the path that produced the event. The microservice architecture pattern catalog documents the messaging, domain event, transactional outbox, and idempotent consumer patterns that make this reliable rather than ad hoc, and the cloud architecture pattern catalog describes the Queue-Based Load Leveling pattern.
This topology is commerce-leaning, and the framing matters. Order placement, payment settlement, and fulfillment events genuinely benefit from a queue: it absorbs checkout spikes, it lets reconciliation run independently of the order path, and it gives at-least-once processing a natural home. It is not a default for a brochure site. A queue added to a marketing site that calls three stable services adds operational complexity — a broker to run, message-ordering and replay semantics to reason about, eventual consistency the team must now design around — with little matching benefit. Event-driven is the right answer when the events are commerce events and the surface is the money path; it is overhead when the surface is content.
Choosing per surface
This is the deliverable. Read it as a starting topology per surface, then justify any deviation deliberately.
| Topology | Best fit | Corporate website | Official shopping mall |
|---|---|---|---|
| Direct from the application | Low fan-out, low criticality, few integrations | Acceptable for a small, stable, degradable set | Not recommended beyond a pilot |
| Backend-for-Frontend | Recommended default mediation for client-facing builds | Recommended starting point | Recommended, with an idempotent money-path boundary |
| Middleware / iPaaS | Many heterogeneous systems, config-shaped logic | Overweight unless the estate is large | Fits back-office-heavy programs; priced for latency |
| Event-driven and queues | Decoupling and spike absorption | Overhead for a content surface | Strong fit for orders, payments, fulfillment |
The table is not a ranking and there is no single winner. A modest corporate website is well served by a BFF over a few direct calls; a high-volume shopping mall is well served by a BFF for the synchronous surface and an event-driven backbone for the commerce events behind it, and those two choices coexist in the same build. Picking the topology from the surface and the scale — not from the most sophisticated option available — is what keeps the architecture proportional to the problem.
The failure that mirrors keeping direct too long is reaching for the most advanced topology too early. A queue and an iPaaS on a build that calls four stable services adds brokers, connectors, and eventual-consistency reasoning that the surface never needed, and the cost is not only infrastructure — it is every future engineer having to understand machinery the problem did not justify. Under-building and over-building are symmetric mistakes: one is discovered as fragility under load, the other as drag on every change. The right topology is the simplest one the surface and scale actually require, re-evaluated when either of those genuinely changes rather than in anticipation of growth that may not arrive.
One disambiguation closes the topology question. How a content management system actually exchanges data with commerce, ERP, or CRM systems — the data model and synchronization between those systems — is its own body of work and belongs to a different topic. This article owns where integration logic lives and how it is mediated; it does not own the CMS-to-system data flow itself. Keeping that boundary clear stops a topology decision from quietly turning into a data-modeling decision it was never meant to make. Resilience mechanics — the timeout math, the circuit-breaker behavior, the retry policy that lives inside whichever topology you choose — are real and necessary, and they are decided in the resilience-focused treatment on this topic; topology decides only where that logic sits.
Diagnostic checklist for the next planning cycle
- Decide the starting topology per surface before any integration code — website and shopping mall separately
- Default to a BFF for any client-facing build; treat direct integration as the exception you justify
- On the shopping mall, place an idempotent boundary for money-path writes inside the BFF
- Reserve event-driven and queues for commerce events; do not add a broker to a content surface for its own sake
- Price the latency and lock-in cost explicitly before adopting an iPaaS on a critical path
- Record the chosen topology and its owner in the integration inventory so the structural decision is visible