Skip to content
HSE · Lecture 08

Events, queues, and streams

How can delivery repeat without repeating the business effect?

Distributed Systems · HSE · 08

Slide contents

  1. 1. Events, queues, and streams

    How can delivery repeat without repeating the business effect?

  2. 2. Delivery repeats; business intent does not

    One event keeps its identity across attempts.

  3. 3. Storage, delivery and effect are separate events

    Each stage has its own acknowledgment.

  4. 4. Acknowledgments answer different questions

    Publisher ACK and consumer ACK are not interchangeable.

  5. 5. Log order is not completion order

    Parallel workers change observed completion order.

  6. 6. Work distribution needs an explicit limit

    In-flight messages occupy resources.

  7. 7. Retention defines the replay window

    A queue is not an infinite history.

  8. 8. Consumer position does not store the business result

    Broker progress and etcd state are distinct.

  9. 9. An early ACK can lose task work

    A crash after acknowledgment leaves no result.

  10. 10. A late ACK makes redelivery normal

    The result exists while acknowledgment is uncertain.

  11. 11. A deduplication key identifies a logical action

    It survives restarts and redelivery.

  12. 12. The effect and its memory commit together

    An etcd Txn combines three mutations.

  13. 13. Concurrent duplicates meet at one atomic check

    Only one success branch creates the effect.

  14. 14. ACK follows a confirmed local outcome

    Read state first when commit is uncertain.

  15. 15. A duplicate reads the existing result

    Code runs again while the effect record remains one.

  16. 16. An external effect needs another protocol

    A payment cannot be included in a local etcd Txn.

  17. 17. The relay completes intent after publication

    Uncertainty preserves the possibility of retry.

  18. 18. Entity ordering is expressed in its state

    An event must match the expected transition.

  19. 19. Parallelism requires valid reorderings

    Independence depends on effects, not timestamps.

  20. 20. Replay needs its own purpose

    Reapplying effects differs from rebuilding a projection.

  21. 21. Deleting memory narrows the retry guarantee

    Dedup retention must match possible replay.

  22. 22. An unprocessable task needs an explicit outcome

    Retrying forever is not recovery.

  23. 23. Backlog connects arrival and processing capacity

    If arrivals exceed completion, backlog grows.

  24. 24. Recover a handler after two crashes

    Check both the result and its memory.

    Trace commit before ACK

    Account for concurrent redelivery

    Examine dedup deletion

  25. 25. Safe retries close the entire chain

    Every boundary has a durable continuation.

  26. 26. Decisions for our service

    Separate storage, delivery, execution and ACK.

    Build an atomic handler with deduplication.

    Justify processing order and dedup retention.