Event Store Schema Overview¶
Purpose: Append-only log of domain events. No ad-hoc querying; projections handle reads.
Columns
global_seq: Monotonic PK (BIGINT; PG identity)event_id: ULID (26 chars), uniquestream_id,stream_type: stream identityversion: optimistic concurrency per streampayload: event body (JSON/JSONB)metadata: transport/trace info (JSON/JSONB)recorded_at: UTC timestamp (server default)
Constraints enforced here
- ULID length == 26
- UNIQUE(stream_id, version)
- UNIQUE(event_id)
- version >= 1
See ADR-0005 for rationale and tradeoffs.