Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Hardware Signal Sink to Object Storage

Receive a stream of hardware signals at about 100 requests per second, batch them with an in-memory buffer, and store them in object storage without losing acknowledged data.

Problem statement

Design a sink service: a service that receives signals from hardware devices and stores them efficiently in object storage. Signals arrive as a continuous stream at about 100 requests per second.

The service should combine signals into batches asynchronously, buffer them in memory, and tolerate failures while persisting them.

For this exercise, assume 100 requests per second is the total across all devices. Each request carries one signal with a device ID, a per-device sequence number that only goes up and survives a device restart, an event time, and a small payload.

A device retries a signal after a failure until it is acknowledged, and it can keep an unacknowledged signal for at least one hour, so duplicates can arrive. An acknowledged signal must not be lost when one service instance crashes or when object storage is unavailable for up to 15 minutes.

Later, batch jobs list the finished objects for a time range and read them. The service runs in one region with several availability zones, and a write to one object key is atomic and replaces the whole object.

Device firmware, sending commands to devices, live dashboards, and the analysis the batch jobs do are out of scope.

What to build

  1. A device can send a signal and get either an acknowledgement or a failure it should retry.
  2. The service combines accepted signals into batch objects in object storage, rather than writing one object per signal.
  3. An acknowledged signal is not lost in either failure the brief describes: one service instance crashing, or the object storage outage.
  4. A batch job can list the finished objects for a time range and read every acknowledged signal at least once, with enough identity to remove duplicates.

At scale

  • The service takes about 100 requests per second. For this exercise, assume that is the total across all devices, each request is about 1 KB, and reconnecting devices can push the rate to 300 requests per second for a few minutes.
  • For this exercise, assume an acknowledged signal should appear in a finished object within 2 minutes at p99, and an acknowledgement should return within 200 ms at p99 when storage is healthy.
  • For this exercise, assume object storage can be unavailable for up to 15 minutes, and devices keep unacknowledged signals for at least one hour.