Alle boeken

Professioneel

Apps Over Coach Inloggen Begin met lezen

Quantitative Finance · Begrippenlijst

Wat is Transactional outbox?

Definition 24.7 Research, Data and Risk Platforms · Hoofdstuk 24 — Messaging and Event-Driven Architecture

A transactional outbox is a table in a service’s own database into which the service writes each event in the same transaction as the change it announces; a separate relay reads the table, publishes the events in order, and marks them sent, so that an event is published if and only if its change was committed — at least once, with a key that lets the log or the consumer drop the repeats.

The transactional outbox: the trade and the event that announces it are committed in one database transaction; a relay publishes unsent events to the log and then marks them sent. A crash between 1 and 2 repeats an event, never loses one, and the idempotence key lets the log drop the repeat.
Figure 24.4. The transactional outbox: the trade and the event that announces it are committed in one database transaction; a relay publishes unsent events to the log and then marks them sent. A crash between 1 and 2 repeats an event, never loses one, and the idempotence key lets the log drop the repeat.
designevents lostphantom eventsduplicated events
write the trade, then publish2200
publish, then write the trade0220
outbox, relay without idempotence key0022
outbox, relay with idempotence key000
Table 24.1. 2 000 trades published with a 1% chance of a crash at the dangerous point of each design: between the two writes, or between publishing and marking an outbox row sent. A phantom event announces a trade the database does not hold.
Lees in het hoofdstuk →