Event-Driven Architecture and Asynchronous Messaging Questions
Designing systems around events and message passing: publish/subscribe, message queues, event streaming, choreography versus orchestration, and decoupling producers from consumers. Covers delivery semantics (at-least-once, at-most-once), ordering, backpressure, dead-letter handling, and the operational tradeoffs of asynchronous flows. Includes async processing patterns for offloading slow work.
Design a cost-efficient architecture for processing batch large-media file uploads using event-driven workflows in the cloud. Consider storage tiering, triggering via object storage events, compute scaling (serverless vs spot instances), streaming transforms vs copying, and minimizing egress and cold-start costs.
Sample Answer
Direct answer
Cost-efficient batch large-media processing trims cost on four independent levers: keep data in the cheapest storage tier it needs to be in, trigger compute directly off object-storage events instead of a separate polling layer, choose compute (serverless versus spot instances) based on the job's tolerance for interruption, and process media as a stream rather than a full local copy wherever the transform allows it. Each lever also happens to reduce egress or cold-start overhead as a side effect.
Structured elaboration
Storage tiering. Land the raw upload in a standard, hot tier only as long as it needs fast access, during and shortly after initial processing, then transition it to a cooler, cheaper tier via a lifecycle policy once it has been processed and access frequency drops. Most object stores support this as a built-in rule rather than something you have to build yourself.
Triggering via object storage events. Wire the object store's native "object created" event to invoke the processing pipeline directly, an event notification to a queue or a serverless function trigger, rather than running a separate poller that lists the bucket on an interval. This removes an idle compute component entirely and reacts immediately instead of on the poller's schedule, which also means not paying for a component that spends most of its time finding nothing new.
Compute scaling, serverless versus spot instances. Serverless (pay-per-invocation, no idle capacity) fits short, bursty, unpredictable-arrival jobs where the alternative is paying for idle worker capacity between infrequent uploads, and it fits workloads that tolerate the platform's execution-time and memory limits. Spot or preemptible instances fit longer-running, batchable jobs (large video transcodes) where the job can checkpoint and resume, or where the batch is broken into small enough units that losing one unit to preemption is cheap to redo. Spot capacity trades a real risk of interruption for a substantial cost reduction versus on-demand pricing, and that trade only pays off if the workload is actually resilient to being interrupted.
Priority across competing jobs. Where multiple jobs compete for capacity, a rush-priority transcode alongside routine batch jobs, a priority queue or priority field lets urgent jobs preempt routine ones for the next available worker slot, the same tiering principle used for backpressure-driven shedding elsewhere in this space, applied here to scheduling order rather than to dropping messages.
Streaming transforms versus copying. Many media transforms (transcoding, thumbnailing) can read the source as a stream and write the transformed output as a stream, without ever materializing the full file on local disk. This avoids provisioning large local disk or memory for large files, reduces the time before the job can start producing output, and avoids one extra full read-then-write pass over the data that a naive design (copy to local, then process, then upload) tends to add without realizing it.
Minimizing egress. Run compute in the same region as the storage bucket, transfer within a region, or between compute and storage in the same provider, is typically far cheaper than cross-region or cross-provider transfer, and avoid unnecessary intermediate copies between storage locations that would each incur their own transfer cost. This is less about a specific figure and more about counting how many times the bytes cross a network or region boundary in the design, each crossing is a cost decision, not a free operation.
Minimizing cold-start costs. For serverless compute, keep the deployed function or container lean, the transform's actual dependencies, not a general-purpose image, so cold starts are cheap when they happen. If job latency genuinely matters, not just cost, a small warm pool of provisioned capacity for the base load, with serverless or spot absorbing burst above that, avoids paying for constant idle capacity while still avoiding a cold start on every single burst-driven invocation.
Worked example
A batch of large video files, several hundred files, each significantly larger than the images an interactive upload pipeline would handle, uploaded overnight for a scheduled early-morning transcoding run: land the files in standard storage, trigger transcoding jobs off each object's creation event, run the transcode on spot instances sized for the batch (accepting that a preempted instance's partial work is cheap to redo because each file is its own checkpointable unit), stream-read the source and stream-write the transcoded output directly to the target bucket in the same region as the source, and transition the raw source to a cold storage tier once the transcoded output is confirmed written and verified. Every choice in that trace is one of the levers above, not a separate idea.
Trade-offs and pitfalls
- Spot or preemptible compute for a job that cannot checkpoint, a single monolithic multi-hour transcode with no intermediate save points, turns a cost optimization into a reliability problem. Break the job into smaller resumable units first, or do not use spot for it.
- Aggressive storage-tier transitions on data that turns out to still be accessed frequently reintroduce cost as retrieval fees from the colder tier, which can exceed what tiering saved if access patterns were misjudged.
- Streaming transforms that require random access to the whole file, some codecs, some multi-pass transforms, cannot always avoid a local copy. Verify the specific transform actually supports streaming before designing around it.
- Chasing egress savings by co-locating compute and storage in one region can conflict with a separate requirement, data residency or disaster recovery, that wants replication elsewhere. Cost is one input to the region decision, not the only one.
Event-sourcing stores all state changes as events. Discuss the trade-offs between storing only events versus introducing periodic snapshots. As a data engineer, explain snapshotting frequency, snapshot storage, snapshot validation, rehydration cost, and strategies for compaction or archival to control event-store growth.
Sample Answer
Direct answer
Storing only events gives perfect auditability and deterministic rebuilds, but rehydration cost (the work to replay events into current state) grows with the event count, so as a stream ages, reads and rebuilds get slower and more expensive. Periodic snapshots cap that cost by giving rehydration a recent starting point instead of the beginning of time, at the price of extra storage and a validation problem: a snapshot must be provably consistent with the events it claims to summarize. As a data engineer, pick a snapshot cadence and compaction policy driven by measured rehydration cost, not by a fixed rule of thumb.
Structured elaboration
Snapshotting frequency
- Event-count-based: snapshot every N events (commonly in the low thousands, tuned to the aggregate). Predictable worst-case replay cost regardless of how much wall-clock time has passed.
- Time-based: snapshot daily or hourly, better for aggregates with low or bursty event velocity where event count alone is not a reliable trigger.
- Hybrid: aggressive event-count triggers for hot, frequently-updated aggregates; time-based triggers for long-lived but rarely-updated ones.
- Whichever trigger is chosen, tune it against measured rehydration cost (replay time and CPU per rehydration), not a value picked without data.
Snapshot storage
- Store snapshots as immutable objects in cost-efficient storage, tagged with the aggregate identifier, the schema version, and the sequence number of the last event folded into the snapshot.
- Keep hot, frequently-accessed snapshots in fast storage or a cache; move cold snapshots to cheaper storage tiers with lifecycle rules.
Snapshot validation
- A snapshot must carry: the last-applied event sequence number, a schema version, and a checksum of its contents.
- On load, verify the checksum and confirm sequence continuity (no gap between the snapshot's last-applied sequence and the next event to replay). On mismatch, fall back to a full replay from the last known-good snapshot or from the beginning.
- Run periodic background verification jobs that independently rebuild a sample of aggregates from events alone and diff against the stored snapshot, to catch silent snapshot corruption before it is relied upon.
Rehydration cost
- Rehydration cost is: load the snapshot, then replay only the events recorded after that snapshot's sequence number. Cost scales with events-since-snapshot, not with the aggregate's total lifetime event count.
- The snapshot cadence directly bounds the worst case: with a snapshot taken every N events, no rehydration ever replays more than N-1 events.
Compaction and archival to control event-store growth (folding the replay/backfill and derived-dataset-reprocessing nuance)
- Compact by taking a full snapshot and, only where retention rules permit it, archiving or truncating events older than that snapshot's sequence to cold, cheaper storage rather than deleting them outright; legal or audit requirements often forbid true deletion.
- The archival tier still has to remain replayable: any derived dataset (an analytics table, a machine learning feature store, a rebuilt read model) that was originally built by consuming the full event history needs that same history available if it must ever be reprocessed, for example after a bug fix in the transformation logic. A retention policy that only optimizes for "rehydrate a live aggregate quickly" and quietly discards old events breaks backfill for any derived dataset that depended on that full history, even though the live aggregates themselves are unaffected. Decide retention and compaction against both use cases explicitly, not just the aggregate-rehydration one.
- Use a tiered retention: hot recent events in the primary event store, older events moved to compressed, partitioned cold storage with an index that supports selective replay by aggregate and time range.
- Mark truncation points explicitly (a compaction marker event, or metadata) so any consumer replaying the stream can detect where the live tier's history starts and knows to fetch older ranges from the archive if it needs them.
Worked example
An account aggregate receives 50 events per day on average.
- Without snapshots, rehydrating that account after 5 years of history means replaying 5 * 365 * 50 = 91,250 events.
- With a snapshot taken every 1,000 events, the worst-case replay after any snapshot is 999 events (999 / 91,250 = 1.09%, so rehydration cost is bounded to roughly 1% of the no-snapshot case at year 5, not strictly under 1%: it is a hair over).
- At 50 events/day, a snapshot every 1,000 events fires roughly every 20 days (1,000 / 50 = 20), so the account accumulates at most 20 days' worth of unsnapshotted events at any time.
- If the business later needs to reprocess the full 5-year history to backfill a new derived dataset (say, a new fraud-scoring feature that needs every historical event, not just the latest snapshot), the archived event range covering all 91,250 events must still be retrievable even though live rehydration never touches most of them.
Trade-offs and pitfalls
- Common wrong turn: choosing a snapshot cadence without measuring actual rehydration cost, then discovering it under- or over-snapshots (too frequent wastes storage and write bandwidth on snapshotting; too infrequent leaves rehydration slow).
- Common wrong turn: treating snapshot validation as optional. An unvalidated, silently corrupt snapshot is worse than no snapshot: it produces confidently wrong current state instead of forcing a (correct, if slow) full replay.
- Common wrong turn: designing retention purely around live-aggregate rehydration speed and discovering, only when a derived dataset needs to be rebuilt, that the events required for that rebuild were already archived out of reach or deleted.
- Senior signal: naming the specific numeric relationship between snapshot cadence and worst-case replay cost, and treating archival policy as a decision that serves more than one consumer (live rehydration and derived-dataset reprocessing), not just the first one that comes to mind.
Implement (in Python) an HTTP consumer handler that receives JSON POST events with a unique 'event_id'. Use Redis to ensure idempotent processing by atomically marking an event as processed and only invoking the handler once per event_id. Show the atomic check-and-set logic and TTL handling to prevent unbounded state.
Sample Answer
Direct answer
The HTTP handler needs one atomic Redis command that both checks whether event_id has been processed and claims it in the same round trip: SET key value NX PX ttl_ms. NX means "only set if the key does not already exist," which is the compare-and-set; PX attaches an expiry in milliseconds so a claim from a crashed request eventually self-heals instead of blocking that event_id forever.
Structured elaboration
Approach. On each POST, build the Redis key as processed:{event_id}. Attempt SET key "processing" NX PX ttl_ms. If it returns success, this call owns the event: run the handler, then overwrite the value to "done" (refreshing the same TTL). If it returns failure, the key already exists, meaning either another request already handled this event_id or one is in flight right now, so this call returns immediately without invoking the handler.
import fakeredis # in-memory, wire-compatible with redis-py; swap for a real
# Redis client in production, the API is identical
from flask import Flask, request, jsonify
r = fakeredis.FakeStrictRedis(decode_responses=True)
app = Flask(__name__)
def business_handler(payload: dict):
"""Stand-in for the real per-event side effect (e.g. update a record,
send a notification). Idempotency is enforced below it, not inside it."""
...
def claim_and_handle(r, event_id: str, payload: dict, handler, ttl_seconds: int = 86400) -> bool:
"""
Claims event_id using a single atomic SET key value NX PX ttl.
NX = only set if the key does not already exist (the compare-and-set).
PX = expiry in milliseconds, so a stuck/never-completed claim self-heals.
Returns True if THIS call ran the handler, False if it was a duplicate.
"""
key = f"processed:{event_id}"
claimed = r.set(key, "processing", nx=True, px=ttl_seconds * 1000)
if not claimed:
return False
handler(payload)
r.set(key, "done", px=ttl_seconds * 1000) # refresh marker after success
return True
@app.post("/events")
def receive_event():
"""The actual HTTP consumer handler: parses the JSON POST body, pulls
out event_id, and delegates to the same atomic claim-and-handle logic."""
body = request.get_json(force=True)
event_id = body["event_id"]
ran = claim_and_handle(r, event_id, body, business_handler, ttl_seconds=60)
status = "processed" if ran else "duplicate_skipped"
return jsonify({"status": status, "event_id": event_id}), 200
Key points.
NXis what makes this a true compare-and-set: a plainGETfollowed by a plainSETwould let two concurrent requests both observe "not found" before either writes, and both would run the handler.- The TTL is reapplied after success so the marker's lifetime is measured from the last state change, not just the original claim.
- The handler is invoked exactly once inside the branch that won the claim; every other call for the same
event_id, whether truly concurrent or a much later HTTP retry, returnsFalsewithout side effects.
Worked example
Executed against fakeredis (an in-memory server that speaks the same protocol as redis-py, used here purely so the demo needs no running Redis server; the client-facing API is identical to a real deployment), driven two ways: first hitting the HTTP layer directly through Flask's test client with real JSON POST requests, then a lower-level run isolating the claim function's TTL behavior.
Through the actual HTTP endpoint, posting the same JSON body three times (simulating a client retry plus a broker redelivery):
resp1: 200 {'event_id': 'evt-http-1', 'status': 'processed'}
resp2: 200 {'event_id': 'evt-http-1', 'status': 'duplicate_skipped'}
resp3: 200 {'event_id': 'evt-http-1', 'status': 'duplicate_skipped'}
business handler invocation count: 1
Isolating the claim function's own TTL behavior directly (bypassing HTTP to control timing precisely):
first call ran handler : True
second call ran handler : False
third call ran handler : False
handler invocation count : 1
stored marker value : done
ttl seconds remaining : 60
key exists before expiry : True
key exists after 1.2s : False
handler ran after expiry : True
The three POSTs to /events with the identical event_id return 200 every time (an HTTP consumer should not error on a duplicate, it should acknowledge and no-op), but the business handler runs exactly once, confirmed by the invocation counter. The second run isolates the claim function alone: the first call claims the key and runs the handler once; the second and third calls (simulated redeliveries of the same event_id) both see the key already present and skip the handler, so handler invocation count stays at 1. Its last four lines use a separate 1 second TTL: the key exists immediately after the claim, is gone 1.2 seconds later, and a fourth call after expiry runs the handler again, proving the TTL is what prevents the dedup store from growing without bound rather than leaking claimed keys forever.
Trade-offs and pitfalls
Complexity. One Redis round trip per event, O(1) time. Memory is O(number of live keys), which is bounded by arrival_rate x TTL rather than by total historical event count, since expired keys are reclaimed automatically.
Edge cases.
- Slow handler vs. TTL: if the handler can run longer than the TTL, a second delivery arriving mid-processing will see the key expired and re-run the handler concurrently with the first, unclaimed run. Either extend the TTL past the handler's worst-case duration, or refresh the TTL periodically while the handler is still running.
- Crash after claim, before completion: if the process crashes after
SET ... NXsucceeds but before the handler finishes, the key stays"processing"until it expires, at which point a redelivery will legitimately re-run the handler. This means the handler itself should be safe to run from the start on a redelivery (its own side effects should be idempotent or wrapped in their own transaction), a pure lock cannot fully substitute for that. - Two events with the same
event_idbut different payloads: the design here trustsevent_idas the sole identity; if the same id can legitimately carry different content it is not a valid dedup key, that would need a content hash bound into the key or the schema fixed upstream. - Redis unavailability: the handler has no fallback path here; a production version needs an explicit decision (reject the request, or accept the risk of duplicate processing) when the
SETcall itself fails, not just when it returns a normal "already claimed" result.
You are on call for an asynchronous data-ingestion pipeline with an SLA to persist every event within 60 seconds. Design the observability and alerting strategy: what would you track, what would actually be worth paging someone for, and what would your on-call runbook tell them to check first?
Sample Answer
Direct answer
For a 60-second persist service-level agreement (SLA), the metric that actually matters is the projected time-to-persist for the oldest unprocessed event. Everything else, producer rate, consumer processing rate, dead-letter-queue rate, error rate, raw throughput and latency, exists to explain why that projection is moving, and paging should be tied to SLA risk crossing a threshold, not to any single metric wobbling on its own.
Structured elaboration
What to track.
- Producer rate: events published per second, the input side of the balance.
- Consumer processing rate (throughput): events actually persisted per second, the output side.
- Consumer lag: how far behind the consumer is, in event count or in the age of the oldest unprocessed event, the single number that most directly answers whether the pipeline is on track to breach the 60-second SLA.
- Dead-letter queue (DLQ) rate and depth: events that failed processing and were routed out of the normal flow. Growth here means a subset of events are silently not going to be persisted on time, or at all, until someone intervenes.
- Error rate: the fraction of processing attempts failing, whether or not they eventually land in the DLQ, often a leading indicator that rises before lag does.
- End-to-end latency: measured from event creation to successful persist, the metric the SLA is actually stated in terms of, and it should be tracked directly wherever the event carries a creation timestamp, not just inferred from lag and rate.
What's worth paging for. Not every metric wobble. Page on SLA risk specifically: when the projected additional latency for the oldest currently unprocessed event crosses a threshold meaningfully inside the 60-second budget, enough time left for someone to actually act, not an alert that fires the same moment the SLA is already breached, or when DLQ depth grows continuously rather than staying flat. A flat, near-zero DLQ is healthy; a climbing one means a systemic issue is actively producing failures faster than anyone is triaging them. A momentary lag blip that self-resolves within the next reporting interval, or a brief error-rate spike that recovers, is exactly the kind of thing that belongs on a dashboard, not something that should wake someone up.
Runbook: what to check first. With lag rising or an SLA-risk page firing, the ordered checks are: first, is the producer rate elevated, an unusual traffic spike that may just need consumer autoscaling to catch up, or is the consumer processing rate depressed, a downstream dependency slowdown, a bad deploy, resource exhaustion on the workers. This distinguishes "we need more capacity" from "something is broken." Second, check the DLQ: is it growing, and if so, sample a few entries to see whether they share a common cause, one bad event shape from one producer versus a systemic downstream failure. Third, check recent deploys and recent consumer restarts or scaling events; a consumer-group churn event, workers restarting or the assignment of work across them changing, is a common, usually self-resolving cause of a short lag spike, worth ruling out before assuming a deeper problem. Fourth, check the downstream dependency the persist step actually writes to, since a slow or unavailable datastore on the write side shows up first as processing-rate degradation, not as anything on the ingestion side.
Worked example
Suppose consumer lag is currently 12,000 unprocessed events and the consumer is processing at a steady 500 events/sec:
additional latency=50012000=24 sThe oldest unprocessed event would take about 24 seconds to be reached and persisted at the current rate, comfortably inside the 60-second SLA. If lag instead grows to 27,000 events at the same 500 events/sec processing rate, the projected additional latency is 27000/500 = 54 seconds, past a page threshold set at 75% of the SLA budget:
page threshold=0.75×60=45 sand closing in on the 60-second breach itself. That is the SLA-risk crossing that should page, not the raw lag number in isolation, the same 12,000-event lag would be a non-event if the processing rate were higher, or would already be an active breach if the rate had dropped low enough.
Trade-offs and pitfalls
- Paging on raw lag count without dividing by current processing rate produces false urgency during high-throughput periods and false calm during low-throughput periods. The SLA is stated in time; the alert should be too.
- Alerting on every DLQ message individually instead of on DLQ growth rate and depth creates alert fatigue fast. A slow, steady trickle into the DLQ from known bad producer data is a triage-queue item, not a page; a sudden acceleration is.
- Treating a transient consumer-group reassignment as an incident before checking whether lag self-resolved wastes on-call attention on a self-healing event; conversely, dismissing every lag spike as probably just a reassignment, without checking, risks missing a real regression. The runbook should say check it, not assume it.
- Tracking throughput and latency as separate, unrelated numbers instead of connecting them to the SLA budget makes the dashboard descriptive but not actionable. The projection, lag divided by rate, compared to the SLA, is what turns raw metrics into a decision.
Design a multi-region event-driven notification system that provides low latency globally and tolerates regional outages. Discuss event replication or forwarding, ordering semantics, conflict resolution (active-active vs active-passive), user-affinity routing, and the trade-offs between consistency and latency.
Sample Answer
Direct answer
Design this as regional, active-active clusters that each accept local writes and replicate asynchronously to other regions, with ordering guaranteed only per user (not globally) via a per-user partition key, conflict resolution handled with a deterministic rule like last-writer-wins on a monotonic per-user sequence number, and user-affinity routing that pins a given user's traffic to their home region so most reads and writes never leave that region. The consistency-versus-latency trade-off is resolved by accepting eventual (not strong) cross-region consistency: a user's notification always reflects their own region's latest state at low latency, and only briefly lags for state that originated in another region during a failover or cross-region interaction.
Structured elaboration
Event replication or forwarding. Each region runs its own broker cluster. Events produced in a region are replicated asynchronously to every other region's cluster (or forwarded through a dedicated cross-region replication link), rather than every write being synchronously committed across regions, since synchronous cross-region commits would add hundreds of milliseconds of latency to every write and defeat the "low latency globally" requirement. Replication lag becomes the bound on how stale a notification can be if it depends on cross-region state.
Ordering semantics. Global total ordering across all regions and all users is not achievable at low latency (it requires a form of cross-region consensus per write), and it's also not what this problem actually needs. The ordering guarantee that matters here is per-user (or per-notification-thread) ordering: notifications for a given user must arrive and apply in the order they were generated, but ordering between two different users' notifications is irrelevant to correctness. Partition on user id (or notification-thread id) so every event for a given user always lands in the same partition and is delivered to that user's consumers in generation order; this is the "globally-distributed per-user-ordering" variant folded in here, and it's the correct scope for the guarantee rather than the weaker "just don't worry about ordering" or the unnecessarily expensive "order everything globally."
Conflict resolution: active-active versus active-passive. Active-passive (one region is the sole writer, others are read replicas that fail over) is simpler to reason about (no concurrent writes to reconcile) but means every write from a user physically far from the active region pays that latency, and it introduces a real, if infrequent, failover event. Active-active (every region accepts local writes) gives every user low-latency local writes, but requires a conflict-resolution rule for the rare case where the same logical entity is updated from two regions before replication catches up. For a per-user notification system, a practical rule is: attach a per-user monotonic sequence number (or a hybrid logical clock) to every event at write time, and on conflict, the higher sequence number wins deterministically, with the loser retried/re-applied on top. Since almost all writes for a given user originate from that user's own home region under normal operation, real conflicts are rare and mostly limited to failover windows.
User-affinity routing. Route each user's traffic (their producer-side actions and their notification consumer connections) to their home region by default, based on account metadata or geolocation at sign-up/first-use, so the common case never crosses a region boundary and both writes and delivery stay fast. Affinity is a routing hint, not a hard constraint: if a user's home region is unavailable, affinity routing falls over to the nearest healthy region, and that region can serve the user (possibly with a brief consistency gap for very recent cross-region state) until failback.
Trade-offs between consistency and latency. This design chooses low latency and regional availability over strong global consistency: a user always gets a fast, locally-consistent view, at the cost of a small, bounded window where a notification that depends on cross-region information (for example, "your friend in another region did X") can arrive slightly stale relative to true global real time. That window is bounded by replication lag, which should be tracked as an explicit service-level objective (SLO) metric.
Worked example
A user based in the EU region triggers an action that should notify a friend based in the US region. The EU broker accepts the write locally (low latency for the EU user), tags it with the EU region's monotonic sequence for that friendship-thread partition, and asynchronously replicates it to the US cluster. If replication lag at that moment is, for example, 800 milliseconds (a number you would track live via a replication-lag metric, not assume), the US-based friend's notification consumer sees the event roughly 800 milliseconds after the EU write, not instantly, which is the accepted eventual-consistency cost for keeping the EU user's own write fast. If both users happened to modify the same shared thread concurrently from their two home regions within that replication window, the conflict-resolution rule (higher per-thread sequence number wins) deterministically picks one outcome, and the losing update is reapplied on top so no data is silently dropped, only reordered relative to true wall-clock time.
Trade-offs and pitfalls
The most common wrong turn is reaching for global strict ordering or synchronous cross-region writes "to be safe," which directly contradicts the low-global-latency requirement and doesn't match what users actually need (their own notification order, not a total order across every user on the platform). Active-active without a deterministic, well-tested conflict-resolution rule is a second common failure: teams add active-active for latency and then discover during an incident review that concurrent-write behavior was never actually specified, so different replicas can silently diverge. User-affinity routing needs a documented failover path; treating it as a hard pin without a fallback turns a single region's outage into a full outage for every user whose affinity points there, defeating the "tolerates regional outages" requirement in the question.
flowchart LR
subgraph US[US region]
PU[Producer US] --> BU[(Broker US)]
BU --> CU[Consumers US]
end
subgraph EU[EU region]
PE[Producer EU] --> BE[(Broker EU)]
BE --> CE[Consumers EU]
end
BU <-->|async replication| BE
CU --> UA[User-affinity router]
CE --> UA
UA --> ND[Notification delivery]
Unlock Full Question Bank
Get access to all Event-Driven Architecture and Asynchronous Messaging interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.