Storage Backend Expectations¶
This document freezes what every storage backend must preserve.
Applicable Backends¶
- SQLite
- PostgreSQL
- in-memory test store
- future BEAM-native stores
Required Observable Behavior¶
- append-only event persistence
- global
log_seqordering - per-trace
trace_seqmonotonicity TraceStartedfirst-event ruleTraceFinishedwrite lock- idempotent retry reuse with
trace_seqexcluded from metadata matching - stable
get_trace_events()ordering bytrace_seq - stable
list_events()ordering bylog_seq - accurate
get_last_log_seq() - accurate
get_next_trace_seq()
Batch Iteration¶
iter_event_batches() is allowed to choose different internal query shapes, but it must preserve:
log_seqordering across the whole stream- no dropped events
- no duplicated events
- consistent handling of filters and bounds
Backend-Specific Freedom¶
Backends may differ in:
- SQL syntax
- transaction strategy
- index structure
- connection lifecycle
- operational tuning
Backends may not differ in the semantic outcomes listed above.
Reference Rule¶
If SQLite, PostgreSQL, and a future BEAM store disagree, Python parity assets are the tiebreaker until the architecture explicitly changes that rule.