losfair / mvsqlite

Distributed, MVCC SQLite that runs on FoundationDB.
https://github.com/losfair/mvsqlite/wiki
Apache License 2.0
1.39k stars 39 forks source link

Change notification for queries #21

Open losfair opened 2 years ago

losfair commented 2 years ago

The current primitives provided by mvstore/mvsqlite is enough to implement efficient change notification for queries: notify the app when the result of running a query may change.

The mechanisms involved are read_set and the interval field provided by the /stat endpoint. Pages read by a transaction can be recorded, and later checked against /stat response.

However, exposing this would either need modification to SQLite itself, or the use of thread-local state.

gedw99 commented 1 year ago

Cool use case