๐ pg-journal is a Proof of Concept Application Layer Event Sourcing inspired by:
- Rely completely on ๐ PostgreSQL for the entire OLTP/messaging stack to reduce operational complexity
- Provide a composable set of packages without lock-in that can be used to selectively apply CQRS/Event Sourcing in real world apps where its needed
- Provide non-CRUD examples of modeling real world complex domains
I've decided to not spend further time developing this approach due to its high cost and complexity (event sourcing on the application layer). Cons discovered:
- Reinventing powerful SQL operation such as group by/joins on the application layer
- Slow read model rebuild times with a large dataset
- Versionining online read models becomes a huge problem
Approaches such as Lambda Architecture and Kappa Architecture have been shown to be scalable to petabytes whereas this approach does not. The batch processing side can be implemented by reading Postgres disk files and running a large Spark cluster on it, and stream processing done using Kinesis + Spark Streams.
I will start another project investigating Lambda Architecture using Postgres (with CDC) for the entire stack with Spark + Kinesis.
- โ Event store
- โ Guaranteed global ordering/gap handling for read models (projections)
- โ Opinionated projectors for postgres
- โ Real world example apps
- โ Performance tests & reports
Pull requests/maintainers are welcome! ๐
- Tests should be green
- Linting should pass
Install dev dependencies & run tests in a specific package:
$ yarn
$ yarn workspace fact-pg-journal test
This project is licensed under the terms of the Apache 2.0 license.