Reliable Message Delivery in Async Systems: Lessons from a Mother Cat

    This article uses a mother cat moving her kittens one by one as a metaphor for asynchronous message delivery, then maps the behavior to four core engineering capabilities: reliable delivery, idempotent consumption, ordering and backpressure, and observability. It covers why teams move from tight coupling to event-driven design, a minimal event model, three-stage delivery guarantees, structural idempotency patterns, bounded concurrency, key metrics, and a practical launch checklist.

    1. Starting From a Real Scene

    A friend who keeps cats described one night like this: a mother cat had just given birth to four kittens, then began carrying them one trip at a time to the owner’s bedside. She would place one kitten by the owner’s hand, go back to the birthing area for the next, and only after all four were delivered did she jump onto the bed and lie down beside the owner. Afraid of startling her, the owner held one position all night and did not dare turn over, even after her legs went numb.

    If you treat this only as an amusing anecdote, you waste most of its information. It is actually a fairly complete metaphor for a distributed system:

    • Producer: the mother cat, holding “data shards” that have not been delivered yet.
    • Channel: the path from the birthing area to the bedside, extremely low bandwidth, one kitten per trip.
    • Consumer: the owner, in a resting state and unable to pull actively.
    • Delivery semantics: delivered one by one, with a “task complete” state only after all are delivered.
    • Reliability guarantee: the mother cat’s care instinct for her young, equivalent to a strong constraint of retry plus no loss.

    Most problems engineering systems hit after going asynchronous have a counterpart in this scene. The rest of this article covers six layers: why migrate, how not to lose, how not to duplicate, how to keep order, how to apply backpressure, and how to observe.

    2. Why Migrate State: From Tight Coupling to Event-Driven

    The mother cat did not leave the kittens in the birthing area and wait for the owner to come over; she carried them herself. In essence, she turned “synchronous waiting” into “asynchronous push,” which has clear architectural benefits.

    The problem with synchronous calls is that both sides must be online at the same time. If the owner is asleep, the mother cat is exhausted, or the path is blocked, any unavailable link makes delivery fail. Asynchronous event-driven design decouples the two sides: the producer only writes events into a reliable channel, and the consumer processes them at its own pace and capacity.

    A minimal event model usually looks like this:

    1. {
    2. "eventId": "evt-20260531-0001",
    3. "type": "kitten.delivered",
    4. "occurredAt": "2026-05-31T18:54:00+08:00",
    5. "payload": { "litterId": "L-01", "index": 1, "total": 4 },
    6. "traceId": "trace-9f2c"
    7. }

    There are three key design points: eventId for idempotent deduplication, type for routing and decoupling, and traceId for end-to-end tracing. Missing any one of them weakens both consistency and troubleshooting ability later on.

    3. No Loss: Three Stages of Reliable Delivery

    The mother cat’s behavior is reassuring because she never puts a kitten down halfway and walks away. Reaching the same strength in engineering requires three stages of protection.

    The first stage is reliable persistence on the producer side. The event is written to local persistent storage or a reliable message queue before success is returned, which avoids the “changed in memory, then the process died” kind of loss.

    The second stage is acknowledgment. The consumer explicitly acknowledges after processing completes, and unacknowledged messages are redelivered after a timeout. One point matters here: the acknowledgment must be sent after the business processing succeeds, not on receipt. Otherwise you are deliberately giving up retry capability.

    The third stage is failure isolation with a dead letter fallback. Messages that keep failing go to a dead letter queue with their original context preserved, for manual handling or a compensation job, instead of blocking the main flow indefinitely.

    1. produce -> persist -> deliver -> consume -> ack
    2. |-> timeout/error -> retry (backoff) -> over threshold -> dead letter

    4. No Duplicates: Idempotency Is the Baseline of Async Pipelines

    The mother cat only carries four kittens and never goes for a fifth, because she can recognize which ones have already been delivered. Message systems cannot make that kind of natural judgment, and duplicate delivery is the norm rather than the exception: network jitter, lost acknowledgments, and consumer restarts all cause the same message to appear more than once.

    So the consumer must be idempotent. There are three common approaches:

    • Unique-key deduplication: build a unique index on eventId and ignore duplicate writes outright.
    • State machine validation: execute only when the current state allows the transition, and return immediately on illegal transitions.
    • A deduplication table with an expiration time: keep processing records within the window the business allows, balancing storage cost.
    1. -- Example: a unique constraint as the idempotency fallback
    2. CREATE TABLE processed_event (
    3. event_id VARCHAR(64) PRIMARY KEY,
    4. processed_at TIMESTAMP NOT NULL
    5. );

    The point to stress is that idempotency cannot rely on “duplicates probably won’t happen.” It must rely on a structural constraint.

    5. Ordering and Backpressure: Why One Kitten Per Trip Makes Sense

    Carrying one kitten at a time looks inefficient, but it is the inevitable choice given the channel’s capacity, and it naturally creates backpressure: her stamina is the rate limiter.

    The same holds in engineering. When consumer capacity is lower than producer capacity, letting messages pile up in memory drives latency through the roof and can even get the process killed. Practical options include limiting concurrency, using bounded queues, guaranteeing partial ordering by partition, and degrading non-critical traffic.

    Partial ordering is the best trade-off for the cost: global ordering is extremely expensive, while most business logic only needs ordering within a single entity (the same order, the same user, the same litter of kittens).

    6. Observability: Making “How Many Are Left” Measurable

    The owner did not dare move all night because she lacked the information “how many are left.” A system needs to expose its progress the same way: message backlog, consumption latency, retry count, dead letter count, and end-to-end duration. With these metrics and alerts, an async pipeline turns from a black box into something operable. Carrying traceId through the logs makes it possible to reconstruct an event’s full journey across services.

    7. Launch Checklist

    1. Does the event carry a globally unique identifier and an occurrence time?
    2. Is consumption acknowledged only after the business succeeds?
    3. Is there a structural idempotency guarantee?
    4. Does retry use exponential backoff with an upper limit?
    5. Are there dead letter and compensation mechanisms?
    6. Are concurrency and queues bounded?
    7. Are the key metrics and alerts in place?
    8. Have you run failure drills for duplicates, out-of-order delivery, and crashes?

    8. Conclusion

    A mother cat completed reliable delivery in four round trips and only rested after confirming all were delivered. That plain process maps to the four most core capabilities of an asynchronous system: reliable delivery, idempotent consumption, ordering and backpressure, and observability. Getting these four solid improves stability far more effectively than piling up more components.