In this lesson · topic 7 of 7
Topic 7
Keys, the outbox and repeats
3 min read
Predict first
Predict first
Predict first
Take away
- A client that gets no reply must retry, so a service must tolerate repeats.
- An idempotency key names one operation. The service stores it with the result, in the same transaction as the effect.
- Keys must live longer than the longest retry, and the table must still be pruned.
- A dual write to a database and a broker can lose the event, and no retry can fix it.
- The outbox writes the event with the data. A relay publishes it at least once.
- Consumers drop repeats by event id. The effect is once, though no hop is.
Sources
- Martin Kleppmann, Designing Data-Intensive Applications, O’Reilly, 2017.
- Chris Richardson, Pattern: Transactional outbox, microservices.io.
- Roy Fielding, Mark Nottingham and Julian Reschke, RFC 9110: HTTP Semantics, IETF, 2022.
- Jayadeba Jena and Sanjay Dalal, The Idempotency-Key HTTP Header Field, IETF draft.
- Pat Helland, Data on the Outside versus Data on the Inside, CIDR, 2005.
- Debezium, Outbox Event Router.