
Database
event sourcing with PostgreSQL database.
Events table- a globally ordered ledgerOptimistic Locking- for concurrency controlConstrains- no misspelled event types, immutable by default
No additional tools, frameworks, or programming languages are required at this level.
Stream it
event-streaming with PostgreSQL database.
Concurrent Consumers- for efficient streamingPool the DB/Push from DB- two techniques for database pooling and/or pushing eventsAt-Least-Once Delivery- to ensure reliabilityPersisted Streams- track the progress


Alternative
A Key-Value (KV) database is a NoSQL system that stores data as key-value pairs, enabling extremely fast reads and writes.
Databases like FoundationDB provide a strongly consistent, transactional KV core that can serve as the foundation for higher-level abstractions such as event-sourced models (Each event can be stored as a value, keyed by identifiers such as aggregate IDs / streamId).
eventsByStreamId.(streamId).(eventId)- appending events to their respective streamsevents.(eventId)- appending events to the global streamlastStreamEvent.(streamId)- implementing optimistic locking by tracking the version/sequence of each stream
Demo Applications
| Language | Source Code |
|---|---|
| Kotlin (Spring) | |
| Kotlin (Ktor) | |
| TypeScript | |
| Rust (Actix-Web Server) | |
| Rust (PostgreSQL Extension) |