Company
Date Published
Author
Paul Copplestone
Word count
1605
Language
English
Hacker News points
296

Summary

pg_crdt, an experimental extension for CRDTs, has been open-sourced by Supabase, aiming to provide offline-sync/support capabilities. CRDTs (Conflict-free Replicated Data Types) are a type of data structure designed to solve the problem of merging changes in a collaborative app without needing a central authority. The extension adds CRDT support to Postgres as a data type, allowing developers to build collaborative apps with offline capabilities. It supports Yjs and Automerge libraries, which have robust JavaScript implementations, making it suitable for client-side development. However, there are limitations to the approach, including broadcasting database changes from the Postgres write ahead log, generating significant serialization/deserialization overhead on-update, and frequently updated CRDTs producing a lot of WAL and dead tuples. Supabase is open to feedback and suggestions through the GitHub repo's Discussions feature.