How we sync Postgres to the browser: ElectricSQL for rows, Yjs for documents (opens in new tab) 聽馃攧CRDT
A deep dive into the sync layer that makes Plain feel fast and collaborative. The browser holds a live replica of the slice of Postgres it's looking at, and edits documents as CRDTs. Two sync engines, one principle: subscribe to state, not endpoints. Here's how it works, end to end.
Read the original article