02Event store and CQRS

PostgreSQL Event Sourcing

A ride-hailing application stores changes as events in PostgreSQL and uses CQRS to separate updates from queries.

Ride event history alongside the current ride state rebuilt from those events.
Concept interface

How it works

  • The application models the lifecycle of a ride order, from placement and acceptance through completion or cancellation.
  • PostgreSQL acts as the event store. State can be reconstructed by replaying stored events, with snapshots to shorten replay.
  • The documentation covers optimistic concurrency and query-side projections alongside the event-store schema.

Technology stack

JavaSpring BootPostgreSQLCQRS