← All games

Idempotent Consumer Lab

Build duplicate-safe consumers with scoped event identity, database constraints, and atomic business mutations.

Concept
Idempotent message consumers
Difficulty
Advanced
Play time
8-11 minutes
Path
Async Workflows

Interactive scenario

Playable game area: Make the next backend decision

Use the controls below. Feedback appears immediately and final scores stay in this browser.

Concept notes

Why this decision matters

Idempotent Consumer Lab is focused practice for Idempotent message consumers. It explains why each answer is safe, risky, or production-ready.

Use durable constraints to make repeated delivery a normal, safe event.

Learning objectives

  • Use a durable uniqueness invariant.
  • Keep the dedupe marker and business mutation atomic.
  • Define consumer scope and replay retention.

How to play

  1. Identify the duplicate window.
  2. Choose the database invariant that closes it.
  3. Use feedback to distinguish API idempotency from consumer deduplication.

Scoring

  • Correct invariant choices add 250 points.
  • Misses enter local review.
  • A perfect run scores 1,000.

Backend concept notes

A check-then-act sequence is racy under concurrent delivery.

The processed-message record must share the transaction with the business effect when the database is the correctness boundary.

Common mistakes

  • Using only an in-memory set.
  • Committing the dedupe marker separately.
  • Applying one global event-ID namespace to unrelated consumers.

Review misses from this game

Related Backend Study Lab tools

Use tools from the main site when you want to inspect real inputs.

FAQ

Short answers for how this game fits backend interview and study practice.

Is an idempotency key the same as consumer deduplication?

No. They solve related retry problems at different request and message boundaries.

Can dedupe records expire?

Yes, but retention must be designed with replay and business-level invariants.

Leaderboard

Top 10 scores for the current ruleset. No account required.

Loading leaderboard...

    Finish the game to load your latest local score.