Comment by cryptonector
1 year ago
I like this architecture because I like event sourcing. But you have to be careful with event sourcing. There are schemas where the views you want to materialize are slow to materialize, and anyways as the data grows the materialization gets slower. What to do? Well, the developer just has to write triggers (or equivalent) to update the materialization in-transaction, and you have to do this when doing replication / synchronization. And you need to think carefully about collision resolution -- basically you need to read up on CRDT a fair bit then think about it.
It would be really nice to have a SQLite3-like database with PG language functionality so that one could do local-first and remote-first as just a configuration setting.
On your last point: https://pglite.dev
On the main point around materialisation cost, I know more work is planned on compaction specifically but generally LiveStore is a framework that’s been highly crafted to address and optimise for all aspects of performance.