streamgres
A subscription-native open-source sync-engine for PostgreSQL written in Rust. Clients subscribe to SQL queries over a WebSocket and keep receiving the delta: the rows that entered, left or changed in their result, as soon as the change commits. No polling, no re-running queries.
Every subscription is an incrementally maintained view. Each committed change is routed to exactly the views it affects, at a cost that depends on how many conditions the write matches, not on how many subscriptions exist.
Browsers subscribe over a WebSocket layer and receive deltas only. The WebSocket layer handles reads and writes — deltas out, subscribes in — and connections, covering sessions and reconnect. Below it the IVM layer holds the routing index, which decides which queries a write affects; shared frames, which store each row once; and the planner, which handles joins and windows. It passes row deltas up to the WebSocket layer. Below that the data layer holds the feed, which decodes the write-ahead log, and storage, a read pool. It passes changed rows up to the IVM layer, reads the write-ahead log from PostgreSQL, and issues SQL reads back to it.