Preparing your design workspace

Loading the problem and your latest saved attempt…

Design an Idempotent Multi-Source Event Store

Design the durable write and read path for events retried by many independent producers.

Problem statement

Design an event store that ingests events from multiple sources and stores them idempotently. For this exercise, assume every request is authenticated to one source and bounded validation plus explicit retryable throttling occurs before any durable event decision.

The service accepts one event or a bounded batch and returns each item's accepted, replayed, conflict, invalid, or throttled outcome independently so mixed outcomes can be retried item by item.

Also assume each producer supplies a stable event ID scoped to its source, the service stores opaque payloads, and clients can fetch an accepted event or page through one source partition. Transformations, analytics, and subscriber delivery are out of scope.

What to build

  1. For this exercise, accept one event or a bounded batch only after authenticating its source and performing bounded validation; independently report every item as accepted, replayed, conflict, invalid, or retryable throttled so mixed outcomes can be retried item by item.
  2. Repeated delivery of the same source event must not create a second stored event.
  3. For this exercise, return the original success for an identical retry and a conflict when one source reuses an event ID with different content.
  4. For this exercise, support point lookup by source and event ID plus cursor-based reads of one source partition.

At scale

  • For this exercise, assume 50,000 accepted events per second at steady state, brief bursts at five times that rate, and a 1 KiB median event.
  • For this exercise, assume the p99 response for a durably decided append is at most 250 ms and monthly write availability is 99.99%.
  • For this exercise, assume events and their idempotency identity are retained for 30 days.
  • For this exercise, assume no ordering across sources; when supplied, a source partition and monotonic sequence define read order within that partition.