Carlos is a senior software engineer with 10+ years of experience specializing in Java and Python. At Pinterest, he engineers the backend for the Shopify App, powering automatic product syncing and Pin creation for thousands of merchants.
Expertise

Key Points
- Event-driven architectures separate timing from services. Coordination moves into brokers, schemas, retry policies and traces.
- Keep request-response when your service cannot proceed without a reply, events are the wrong fit for balance checks before a withdrawal.
- Build delivery reliability: include an outbox, idempotent consumers, retry topics and dead-letter queues.
- Renaming a field like customerId breaks every consumer at deserialization, even teams your producer has never met.
- AI agent platforms require durable execution first. Brokers belong at integration boundaries. They require the same event-contract discipline as any other stream.
If the email service fails, what happens to the order? In a synchronous model, if checkout waits for the email service to complete, checkout may fail if the email service is unavailable. If the application is implemented as an event-driven architecture (EDA), the order completes successfully and the confirmation email follows once the email service comes online. However, this approach carries risks of event loss and duplicate processing during that time.
In terms of scalability and fault isolation, Microsoft states that event-driven architectures provide both benefits but warns of increased complexity around event ordering and eventual consistency.
This document helps engineering leaders determine which workloads have enough value to justify the cost of implementing an event-driven architecture and which are best suited to synchronous APIs.
How Event-Driven Architecture Works
An event-driven architecture is a method of designing software in which services communicate through events, immutable records of prior state transitions, published by producers to a broker, which will deliver these events to consumers. Producers do not know their consumers and do not wait for responses. As a trade-off, this approach sacrifices immediate consistency and a single request path for debugging.
Event Producers, Brokers, and Event Consumers
The roles have standard names. Microsoft’s architecture guide describes event producers that generate a stream of events, event consumers that listen for them, and event channels that transfer events from producers to consumers. Services exchange data through those channels instead of calling each other, which is where the loose coupling comes from, producers and consumers share only an event schema and a broker.
According to Microsoft’s Azure documentation, an event is framed as a lightweight notification whose publisher has no expectations about how it is handled. For event-driven architecture to function, four key elements make that work:
- Events: An event message is an immutable fact stated in the past tense (e.g., OrderPlaced); commands (such as ReserveStock) are requests made to one specific service asking that service to perform a specific action.
- Producers: Services emitting events when they experience a state transition. Producers maintain no list of consumers, which is what allows multiple consumers to subscribe independently.
- Broker/Routers: Infrastructure responsible for storing and delivering events. Log-based brokers, including Apache Kafka, keep events for a retention period, allowing consumers to replay them. Queue-based brokers, such as RabbitMQ classic queues, operate in a client acknowledge mode and will remove messages once a consumer acknowledges them. Managed routers such as Amazon EventBridge and Azure Event Grid route events based on rules and deliver them to targets.
- Consumers: Services that subscribe to specific event types and react on their own schedule once an event occurs. No modification to producers is required to add additional consumers.
Event Notification vs. Event-Carried State Transfer
Event-driven approaches have differing costs. For example, event notifications provide very limited information beyond an identifier, leaving subsequent consumers responsible for requesting additional information via callbacks. Martin Fowler calls event-carried state transfer the pattern that puts everything consumers need inside the event. Embedding all necessary information in an event to satisfy a given consumer request eliminates the need for callbacks, but copies data into every consuming service.
Simple Event Processing, Complex Event Processing, and Event Stream Processing
Consumers differ in how much of the stream they look at. In simple event processing, an event immediately triggers an action in the consumer, such as a function that runs when a message lands on a topic.
Complex event processing (CEP) is a different technology choice. A CEP consumer analyzes a series of events and identifies patterns in the event data, like a moving average crossing a threshold inside a time window. Microsoft’s architecture guidance also names real-time processing with minimum time lag among the conditions that favor event-driven architecture.
Azure Stream Analytics supports it. Streaming engines like these also sit behind fraud scoring and real-time analytics. So does FlinkCEP, the Apache Flink library for detecting event patterns in an endless stream of events.
Another variation is event stream processing. A streaming platform ingests events and feeds them to stream processors, which transform the data streams and pass them to the next subsystem.
Event-Driven vs. Request-Response Architecture
The two architectures also differ in how they handle failures. In request/response systems such as REST or gRPC, the downstream service either returns an error or takes too long, and this propagates back to the caller. In event-driven systems, however, the producer can continue once the broker accepts the event. This means changes may take longer to appear.
| Dimension | Request-Response (REST, gRPC) | Event-Driven |
|---|---|---|
| Coupling | Caller depends on the receiver being reachable at call time | Producers and consumers share only the event schema and the broker |
| Communication model | Point-to-point; the caller waits for a reply | Publish-subscribe model; one event reaches any number of consumers |
| Consistency | Caller sees the outcome before it continues | Eventual; each consumer updates its own state later |
| Failure behavior | Downstream errors and timeouts propagate to the caller | The broker buffers events for a failed consumer; problems surface as lag or dead letters |
| Scalability | The whole call chain must scale for peak traffic | Consumers scale separately and drain backlogs at their own pace |
| Latency | Sum of every hop, paid while the user waits | Low for the producer; completion time depends on queue depth |
| Observability | One request ID follows the call stack | Trace context has to travel in message metadata |
| Debugging complexity | Reproduce the failure with one request | Reconstruct it from duplicates, reordering, replays and dead letters |
| Ideal use cases | Queries and checks that must finish before the next step | Fan-out reactions, bursty ingestion, cross-team integration and long-running work |
This is why, in a request/response system, a downstream service failure affects the entire call chain.
In contrast, in an event-driven system, the loose coupling between producers and consumers means they do not have to know about each other. They only need to know the schema of the events published on the broker, which is what allows multiple consumers to process the same event independently. In the example above, one consumer fails without delaying processing by another consumer. However, because consumers process events independently and without knowledge of other consumers, eventual consistency is inherent. Therefore, when it is said an event-driven system reaches eventual consistency, it is meant that each consumer owns its own data and updates it based on events received from a producer after the producer has moved on. So even when all links are operational, each consumer may still receive updates with some delay compared to real time.
Databases make a similar trade. Daniel Abadi’s PACELC paper describes a latency-versus-consistency trade-off that distributed stores make even when the network is healthy. In Abadi’s model the trade-off occurs across replicas inside one database; across services, the same tension applies to state propagated between independent consumers.
For consumers where freshness matters, define a staleness budget: how far behind the producer they may fall before the business notices. Track consumer lag, which Kafka reports as the number of messages a consumer is behind the producer, and use event age or end-to-end latency for time-based budgets.
Where Event-Driven Architecture Pays Off
Request-response works best when the caller needs a response. Three types of workloads favor event-driven architecture over request-response because the producer doesn’t need to care what happens after it produces a message.
One Fact, Many Independent Reactions
A single business event, such as OrderPlaced, can trigger multiple actions. These include: reserve inventory, create a warehouse pick list, award loyalty points, and send a confirmation email. If the checkout process waits for all these services before returning to the customer, it can fail if the email provider times out. If the system uses events, the checkout process will send OrderPlaced and return. Whoever consumes this event can react.
If a group wanted to subscribe to events later, they would have to make no changes to checkout. For example, a fraud-scoring team could do so next quarter and begin processing new events, plus the seven days of past events Kafka retains by default or the latest record for each key on a compacted topic.
Bursty, High-Volume Workloads
IoT telemetry and flash sales generate large volumes of data streams in real time, often in short periods. Databases cannot handle such high volume at the same rate as the data arrives, so brokers turn bursts of data into backlogs that consumers can digest at a sustainable pace. Consumer lag thus becomes a service-level indicator (SLI) with its own owner and alert. The Shopify case study below shows a pipeline that handled peak load during Black Friday Cyber Monday 2020.
Independently Deployed Services
Event-driven architecture fits well in environments where teams own services and ship on their own schedule. In such an environment, an analytics team can start consuming events from an existing service without requiring an update to the producer’s service API. However, this independence works well only if the team structure supports separate, independent services. We examine this in our discussion of the coordination tradeoff behind microservices architecture.
Case Study: Shopify’s Event Stream From a Sharded Monolith
Events do not require separate microservices. Shopify’s core service is a monolith that runs on more than 100 MySQL shards. Their in-house extraction tool would query each table only once an hour, missing hard deletes along the way.
In mid-2019, a multidisciplinary team began exploring log-based change data capture (CDC) for extracting events. CDC uses the database logs rather than polling the database tables. They chose Debezium to convert each row modification into a Kafka record. Each topic is partitioned by the source table’s primary key, thus guaranteeing that all modifications made to a particular row remain in order.
Microsoft’s guide frames the design of event payloads as two options: put all required attributes in the event, or restrict the payload to only keys and let each consumer fetch the rest. Shopify took the first option. Its compacted topics keep the most recent record for each key, so a downstream consumer can rebuild the upstream table without querying the monolith, which is event-carried state transfer in change-data form.
As stated in the March 2021 article, p99 latency was under 10 seconds from inserting into MySQL and publishing into Kafka. During Black Friday Cyber Monday 2020, the pipeline processed approximately 65,000 rps (records per second) on average, with spikes up to 100,000. As noted in the article, a consumer team went from day-old data to hour-old data.
As the article shows, building this system came at a cost. Specifically, CDC introduces tight coupling between external consumers and the source’s internal data model. Thus, a breaking schema change in the monolith can affect all downstream teams, the same event evolution risk that applies to any published event contract.
Pulling historical data was also much harder. Before streaming changes, a new Debezium connector creates an initial snapshot of each table’s data by copying each table’s current rows into Kafka. The problem here is that the initial snapshot held a read lock on the table until it finished copying, which could take hours. Tables added to a running connector did not get an initial snapshot either, and these limits were reported as not yet resolved at the time of writing.
The Architectural Cost of Decoupling
Shopify’s schema coupling is one line on the bill for those benefits. The rest comes after a business transaction crosses multiple services that don’t share a common database.
Consistency Without Distributed Transactions
In a monolith, orders and inventory can share one database, allowing the order to be created and the stock reserved atomically in one ACID transaction. If either operation fails, the system rolls back both, preserving data consistency across both operations. However, if a service architecture is used where these two pieces of information live in different services, each having its own database, rolling both back in a single ACID transaction is not possible.
Typically, the replacement mechanism used here is called a saga. A saga is a sequence of local transactions, and its compensation logic must include participant support so that each service can reliably undo its own step when a failure occurs. When one of the individual transactions fails during execution, it triggers compensation actions. These compensation actions would include releasing the reserved stock or refunding the customer. In our article on when microservices justify their operational cost, we examined whether microservices provide enough value to warrant their additional costs. Transactions spanning services push teams toward using sagas.
There are two architectural patterns for sagas. Choreographed sagas are those in which each service takes action based on an event notification from another service. Because the workflow spans many codebases and may never be seen in full, choreographed workflows tend to lose visibility. Orchestration is an alternative approach to implementing sagas. In this model, one orchestrator sends instructions and tracks each instruction’s progress. Orchestrators such as Temporal persist workflow state and can provide last participant support when coordinating the final step of a multi-service saga. While a centralized orchestrator provides advantages including progress tracking, it can become a bottleneck or a reliability concern.
Microsoft’s architecture guide names a related structural split: event-driven architectures have two primary topologies. In a broker topology, system components broadcast events to the entire system, leaving each component to act on an event or ignore it. A mediator topology puts a mediator in charge: it dispatches commands to designated channels to coordinate systems that would otherwise react on their own.
Event Sourcing and Command Query Responsibility Segregation (CQRS)
A separate software design pattern is event sourcing. Event sourcing makes the event log the system of record. This pattern takes the approach further. Purpose-built stores such as KurrentDB (formerly EventStoreDB) support event sourcing. Microsoft describes event sourcing as a complex pattern with significant trade-offs and recommends applying it selectively, meaning only to specific areas of interest such as a ledger of financial transactions.
Event sourcing is commonly combined with the CQRS pattern, which segregates read and write operations into separate data models. The write model appends events once the business logic runs. Read models can be projections built by consuming those events, so reads and writes scale independently and asynchronously updated projections lag the events that feed them.
The Dual-Write Problem and the Transactional Outbox
If a service creates a row in its database and then sends messages to an event bus (such as Kafka), and the service crashes between committing to its database and publishing to Kafka, downstream services never hear about the order. If sending the message fails but the commit was successful, downstream services will never see the new row. This is called the dual-write problem.
Microsoft states the general risk: if one of the components crashes before successfully processing an event and handing it to the next component, the event is dropped and never reaches its final destination. That is a related handoff failure rather than the database-to-broker dual write. So persist in-transit events, and dequeue them only after the next component acknowledges receipt.
The transactional outbox closes that gap. The service writes the business row and an outbox row in one local transaction. A relay subsequently publishes outbox rows to the event bus after the transaction completes successfully.
Debezium provides this relay functionality by consuming changes to the database transaction log and sending outbox rows to Kafka. The authors describe this usage pattern in their outbox pattern write-up. It is licensed under Apache 2.0 and joined the vendor-neutral Commonhaus Foundation in December 2024.
Duplicates, Late Events, Ordering, and Poison Messages
Kafka guarantees at-least-once delivery by default. As a result, a consumer can receive some events twice. Kafka’s idempotent producer and transactions ensure exactly-once processing only for applications that consume from and produce directly to Kafka. Anything outside Kafka, such as database updates or payment API calls, still requires idempotent handling on the consumer side. One approach is to record processed event IDs in the same transaction as any required state change. Redis 8.6 introduced idempotent production to Redis Streams, so duplicate messages are now stored only once, while their idempotency ID remains valid within the stream’s time and capacity limits.
Ordering has its own set of issues because of how Kafka maintains ordering. Ordering occurs only within partitions. Therefore, events about the same entity should use the same key so Kafka routes them to the same partition. This is why Shopify keys all of its CDC topics off of the primary key. Handling late and/or out-of-order events requires an explicit policy that accounts for data consistency. Versioned state projections can reject events older than the version they hold, whereas others will need to reorder or reconcile them.
Poison messages are malformed events where the event message causes the consumer to crash on every attempt and can block incoming events behind them in the partition until the failed event is rerouted or resolved, leaving other events queued in the meantime. In a 2018 write-up, Uber’s insurance engineering team described routing failed requests through retry topics and a dead-letter queue (DLQ), effectively an error handler processor, to avoid blocking real-time traffic, for a driver injury protection program running in more than 200 cities. Asynchronous communication makes error handling harder, so allocate budget for owning a Dead-Letter Queue starting today: add queue depth alerting to your toolchain and establish a replay runbook.
Operating Event-Driven Systems in Production
With consistency and delivery resolved at design time, two additional factors will determine if your event-driven application remains maintainable during runtime:
Can you track one single business transaction end-to-end?
Can event producers modify an event without breaking consumers they’ve never met?
Tracing a Transaction With No Request Path
In distributed systems that communicate through events rather than synchronous calls, the producer completes its part of the process before the first consumer begins processing the event. Sometimes, this gap is several minutes. To address this, you can “follow” an individual transaction through the eventing system by propagating tracing information into each event. One technique is to embed W3C Trace Context (including the traceparent portion) in each event message’s metadata. This metadata may take various forms depending on the transport mechanism; for example, when sending messages via Kafka, the metadata is stored in the Kafka Record Headers, whereas when sending messages via RabbitMQ, the metadata is stored in the RabbitMQ Message Properties. OpenTelemetry provides messaging conventions for tracing information in your messages, including definitions for message creation context. OpenTelemetry also supports creating span links when multiple messages are associated with a single operation. Datadog’s Data Streams Monitoring tool monitors both end-to-end latency and consumer lag across multiple Kafka and RabbitMQ pipelines from a single interface. With an open-source technology stack, traces typically flow to Jaeger or Grafana Tempo for analysis. Consumer lag will need to be monitored separately with other tools like KMinion or LinkedIn’s Burrow, and then displayed in a Grafana dashboard.
Event Schema Evolution and Hidden Coupling
Each consuming application depends on the schema definition of every event published to it, regardless of whether the publishing team knows those consuming applications exist. Renaming customerId, therefore, would cause those consuming applications to fail at deserialization or silently read nulls. A schema registry can reject registration requests containing incompatible schemas once compatibility checks are enabled. By default, Confluent Schema Registry operates in BACKWARD compatible mode, letting teams rewind consuming applications to the start of topics containing data created before publishing newer schema versions. The registry also offers transitive compatibility modes, which check each new schema against every earlier version, as do the equivalent modes in Apicurio Registry. The AsyncAPI project documents event interfaces for event-driven architectures much the same way OpenAPI does for REST-based APIs. CloudEvents, which reached CNCF graduation in January 2024, defines standardized fields like type and source, which gives heterogeneous systems a common event envelope.
Choosing an Event Broker
All of these patterns assume an event broker. Before you begin to compare throughput claims, match the event broker’s data model to your workload. Queue-based event brokers delete the message after the receiver acknowledges it. Log-based event brokers retain events for a retention period in a log for potential replay.
| Broker | Model | Replay possible? | Best use case/workload | Watch out for… |
|---|---|---|---|---|
| Apache Kafka | partitioned, replicated log | yes (within retention) | high-volume stream workloads/CDC pipelines | cluster operations; Kafka 4.0 runs without ZooKeeper; only available with KRaft mode |
| Amazon MSK / Azure Event Hubs | managed log | yes (within retention) | Kafka workloads without self-managing brokers | event hub speaks Kafka protocol but runs no Kafka code; therefore verify features available |
| Amazon EventBridge/Azure Event Grid | managed event router with rules | depends on service | cloud services and SaaS events; serverless targets | event bridge bills each 64 KB chunk as one event; therefore a 1 MB payload bills as 16 |
| RabbitMQ | exchanges and queues; Streams add a log | streams only | complex routing & task distribution workflows | classic queues delete messages upon acknowledgment |
| NATS JetStream | subject-based messaging with persistence | yes (with JetStream enabled) | light weight cloud-native/edge messaging | Core NATS alone delivers at most once; Core NATS messages are never replayed |
| Redis Streams | append only stream in memory, optionally persisted to disk | yes (until trimmed) | teams already running Redis at moderate volume | memory bound retention; licenses differ between Redis & Valkey |
ZeroMQ does not use a broker. Applications are connected directly via the library without a dedicated message broker. Therefore, developers must handle durability and replayability.
Ecosystem fit also matters. Java developers can use both the native Kafka clients and Spring for Apache Kafka. Go developers have NATS (the server is written in Go) and libraries like Watermill.
This evaluation should also include the license terms. Redis moved to dual RSALv2 and SSPLv1 licensing in March 2024. Afterward, AWS and Google backed their own fork, Valkey. Then Redis 8 added AGPLv3 as a third option in 2025; that year, Synadia tried to move future NATS releases to the Business Source License (the Synadia dispute ended with an agreement to assign its NATS trademarks to the Linux Foundation).
Event-Driven Architecture for AI Agents
The same pressures that exist with the order pipeline apply to AI agents; however, they tend to be slower. One step can take minutes and one uploaded document could trigger work across multiple agents. This creates an event-driven design problem. The industry has previously attempted to standardize it.
From CORBA and FIPA to A2A
In the mid-1990s, OMG created the CORBA Event Service. This service created an event channel between providers and consumers, thereby separating them. FIPA, the Foundation for Intelligent Physical Agents, was established in Geneva, Switzerland, in 1996 to standardize interoperability between heterogeneous agent systems. In 1997, the FIPA Agent Platform Specification was developed using CORBA’s IIOP as the baseline message transport.
The messaging model and the transport under it pulled in opposite directions. FIPA agents used asynchronous messaging in ACL, while the plumbing stayed synchronous RPC: IIOP between platforms, and Java RMI between the containers of JADE, the Java platform Telecom Italia released as open source in February 2000. That is the same tension as events over REST or gRPC, one layer down.
The FIPA Agent Communication Language included tags for the type of action being performed on a message. Two of the standard performatives are ‘inform’ and ‘request.’ The two standard performatives correspond closely to today’s definitions of events and commands. ACL messages carried fields for a content language and an ontology. Interpreting every action rests on a modal logic of beliefs, desires, and intentions (BDI). However, this proved to be difficult to implement fully and correctly.
Agents based on that stack remained research prototypes according to a 2025 University of Luxembourg survey. They lacked the general-purpose reasoning that would have made these standards worth adopting. FIPA never won the commercial support its founders expected. In 2005, its Swiss organization ceased operation as its standards work moved to an IEEE Computer Society standards committee. The FIPA-ACL never gained wide adoption among LLM-based agents.
In April 2025, Google introduced Agent-to-Agent (A2A), a new protocol. Google moved it to the Linux Foundation in June 2025, with more than 100 technology companies supporting it. Version 1.0 was released in March 2026 using JSON-RPC, HTTP+JSON, and gRPC bindings. The first two use Server-Sent Events. gRPC uses server streaming RPCs. In August 2026, A2A joined the Linux Foundation-directed Agentic AI Foundation as a Growth Stage Project.
LLMs remove much of the modeling work required with FIPA agents. Therefore, A2A describes agents with JSON-based Agent Cards rather than formal ontologies. MCP adds capabilities through plain natural-language descriptions that the model interprets at runtime. The University of Luxembourg survey states that there is a trade-off: less machine-level semantic interoperability and precision. Therefore, contracts requiring complete agreement require schema definition.
Asynchronous agent semantics have ridden on request/response transports from CORBA event channels in the mid-1990s through A2A agent cards in 2025.
Durable Execution First, Brokers at the Edges
Protocols determine how agents communicate. Within a given agent workflow, the choice is whether each step should wait for the next one or record its result and move on. According to OpenAI, reasoning models can take several minutes to solve complex problems, so synchronous calls can turn that delay into cascading timeouts.
LangGraph and Pydantic AI address this issue through durable execution, which records each step’s outcome as it completes, allowing crashed runs to resume instead of restarting. LangGraph checkpointers save graph state at every superstep. LangChain renamed its managed runtime LangSmith Deployment in October 2025. It is a durable execution engine that exposes A2A endpoints.
Pydantic AI integrates with Temporal, DBOS, Prefect, Restate, and AWS Lambda durable functions. Each one is designed to handle failure during execution. Pydantic AI emits standard OpenTelemetry spans. GenAI semantic conventions for describing these spans are still classified as Development Status. Pydantic Logfire can display them. However, Logfire’s server is closed source.
As noted earlier, brokers continue to play an important role in distributing events across agent boundaries, especially because they work well as a distribution layer to fan out events. For example, an event called DocumentUploaded can be sent to both summary and compliance agents owned by different teams; each team owns its own durable workflow.
SSE: Streaming Events to Browsers and Agents
Server-sent events (SSE) send events over the final hop of data transmission from a server to a browser, where user interfaces update as they arrive, or from an agent to its client. Messages sent using SSE are framed as text frames within a one-way HTTP stream, which places them at a different layer from records within a Kafka topic. However, servers act as bridges between these two layers, as shown in the enterprise example of the A2A Java SDK, which shares live task events between nodes through a Kafka-backed queue.
As described above, A2A’s HTTP bindings use SSE for real-time task updates, and MCP’s Streamable HTTP transport can also be used with SSE. Once the connection is lost, the browser reconnects to the server and includes the ID of the last event it received in a Last-Event-ID header so a server that supports replay can resume from there.
Each browser can establish six connections per domain over HTTP/1.1, while HTTP/2 increases this limit to a negotiated value that defaults to 100 streams. Two-way streams such as collaborative editing still need WebSockets, since SSE is one-way only.
Agent Messages Need the Same Contracts
The A2A tasks currently being streamed behave similarly to a typed event stream. Each streaming task begins with a task object, followed by status and artifact update events, and, per the specifications, all servers must deliver events in the order they were generated.
All contracts previously discussed also apply to this traffic. Therefore, a structured payload must have a registered schema, and messages must have trace context, so one agent run can be followed across services. Additionally, handlers must support idempotence since Temporal retries failed Activities by default and the Temporal documentation recommends making them idempotent.
When to Use Event-Driven Architecture (And When Not To)
Agent runtimes and order pipelines ultimately resolve the same way, one interaction at a time. For example, you could have a checkout process that waits for the payment API to complete successfully, then publishes OrderPlaced. Microsoft has an architecture guide for the event-driven style that draws very similar boundaries.
Lean toward events when:
- Many consumers respond to the same information: Adding new responses doesn’t require updates to producers.
- Traffic comes in bursts: brokers absorb spikes and turn bursts into lag consumers drain at a sustainable pace.
- Tasks take a while to complete: Document processing and agent runs should not hold connections open.
- Teams can deploy independently: Versioned event contracts will reduce the need for teams to coordinate deployments.
Keep request-response when:
- The client cannot continue without the response: The architecture guide states that this style should not be used when business transactions require strong consistency across services. This would include checking the account balance before performing a withdrawal.
- The workflow is simply a request/response: The operational overhead of brokers, asynchronous error handling, and eventual consistency isn’t justified for simple interactions.
- The team lacks distributed tracing: Without trace context in message metadata, a failed asynchronous step leaves no request path to follow.
- Only one consumer exists, and there is no reason for buffering, replay, independent availability, or asynchronous completion: The architecture guide lists multiple subsystems processing the same events first as a reason to select this style. If only one consumer exists and you don’t need buffering, replay, independent availability, or asynchronous completion, it makes sense to send requests directly to that consumer.
If your team needs experienced engineers who have operated event pipelines in production, BairesDev offers custom software development services and can help determine whether each interaction should be implemented as an event or an API.
Frequently Asked Questions
What Is the Difference Between an Event and a Command?
An event like OrderPlaced records something that already happened. Your service that publishes it doesn’t track who reacts or whether anyone does. A command like PlaceOrder targets one specific service and expects it to either succeed or fail. That distinction matters for how you model your topics and how you handle errors downstream.
Does Event-Driven Architecture Require Microservices?
No. Shopify streams row changes from a sharded monolith into Kafka using Debezium. The monolith hasn’t been broken apart. EDA decouples your consumers from your producers, so you can add consumers without touching the source service. How many separately deployable services you run is a separate decision entirely.
How Do Consumers Handle Duplicate Events?
Design your consumers to be idempotent. Write the event ID and the resulting state change together in the same database transaction. On a retry, your consumer checks whether that event ID already exists and skips processing if it does. Kafka guarantees at-least-once delivery by default, so you’ll see duplicates and you need this in place before you go to production.
What Is the Difference Between a Message Queue and an Event Stream?
A queue removes the message as soon as your consumer acknowledges it. That works well for task distribution where only one worker should act. A stream retains events for a configured period, so multiple independent consumer groups can read the same history at their own pace and replay from any offset. If you need a new team to backfill from last week’s data, a queue can’t help you.
Does Kafka Guarantee Exactly-Once Delivery?
Kafka’s idempotent producer and transaction support give you exactly-once processing only when your pipeline reads from Kafka and writes back to Kafka. The moment your consumer writes to a database or calls an external API, you’re outside that guarantee. You need idempotent handling on your consumer side for those operations, which means recording processed event IDs in the same transaction as your state change.
Carlos is a senior software engineer with 10+ years of experience specializing in Java and Python. At Pinterest, he engineers the backend for the Shopify App, powering automatic product syncing and Pin creation for thousands of merchants.
Expertise










