KatInterview

Designing a Safe Release and Reliability Plan for a Fleet Event Pipeline

System DesignModel answer
MediumModel answerSystem Designcircuit-breakerslocanary-deployment

Last updated

Design an end-to-end reliability plan for an event-ingestion service: guarded dependency calls, SLO-based alerting, reversible schema changes, and a canary pipeline with automatic rollback.

Context

You own a service that ingests a continuous stream of events from a large fleet of connected cars: diagnostics, position, battery state and similar. For each event the service:

  1. validates it against a schema,
  2. looks up extra vehicle information from a separate metadata service,
  3. stores the enriched record in a primary database.

Two things can hurt this system badly: a faulty release that reaches every instance at once, and a prolonged outage of the metadata service. Either one can lead to lost data and a flood of alerts.

What to produce

Write up a design that connects the four areas below into one coherent reliability and delivery approach. Prefer concrete mechanisms (specific status codes, timeouts, percentages, migration phases) over general definitions.

1. Protecting the metadata dependency

  • Describe how the service calls the metadata service.
  • Define the circuit breaker's Closed, Open and Half-Open states, including trip thresholds, timeouts, recovery behavior and what happens to events while the dependency is unhealthy.

2. Monitoring that leads to action

  • Propose 2-3 SLIs with matching SLOs for the pipeline.
  • Explain which symptoms should wake someone up and which should only produce low-urgency diagnostics, so that on-call does not suffer alert fatigue.

3. Schema changes that allow rollback

  • Describe how database migrations are sequenced relative to application releases.
  • Walk through the expand-and-contract pattern so that the previous application version keeps working after a rollback, with no runtime errors or data corruption.

4. Delivery pipeline and canary checks

  • Outline a pipeline that uses canary or blue/green stages.
  • State the metrics, baseline comparison method and automatic rollback conditions applied during the canary period, before a full rollout.

State your assumptions about scale and latency up front and explain why you chose your numbers.

Hints

Hint 1

Start by stating assumptions (event rate, baseline latency of the metadata service, idempotency key). Derive timeouts and bulkhead sizes from them rather than picking arbitrary values.

Hint 2

Decide what the fallback does with data: the safest choice is to degrade (cached or un-enriched records flagged for later backfill) rather than drop, and to reserve the dead-letter queue for genuinely invalid events.

Hint 3

Link the areas: the SLOs define paging and also feed the canary gates, and expand-and-contract is what makes an automatic rollback safe. Make each link explicit.