A sequence number is an ascending ordinal identifying an event’s position within one entity’s event stream. In a journal, each persisted event receives a sequence number associated with its persistence ID. Numbers advance independently for different entities, so container 9 can have events 1 and 2 while container 11 has event 1. section 9.4 section 10.2
Use sequence numbers to:
- Track an entity’s position in its persisted event stream. section 9.4
- Represent the latest event consumed when reading by tag; the corresponding read position is called an offset. section 10.2
- Read events from a chosen range for a persistence ID through persistence-query APIs. section 10.2
Two containers, separate sequences
Three cargo events produce these journal rows: container 9 receives sequence numbers 1 and 2, while container 11 receives sequence number 1. The database ordering is global, but sequence_number is ordinal within each persistence ID.


