3 ms·
If you're running a single-node SQLite application then you can handle reactivity within your application code itself and use either websockets or SSE to propag
by benbjohnson 4y ago
If you're running a single-node SQLite application then you can handle reactivity within your application code itself and use either websockets or SSE to propagate it to the client.
It definitely gets more complicated when you have a distributed application. Using something like NATS works but you'd need to synchronize between the NATS message and your database state on your replicas (e.g. NATS could arrive before data is propagated to replicas).
We do have plans to add event data to the LiteFS transaction files[1]. That would let you write out a message like "user_updated id=123" during your transaction and it would get bundled with the transaction payload on commit. Then your application on your replica can listen for events and they are already synced up with your database state.
[1]: https://github.com/superfly/litefs/issues/20 https://github.com/superfly/litefs/issues/20