Hacker News new | ask | show | jobs
by sureglymop 1091 days ago
With Yjs, how do you persist data in a "normal" database? And yeah, it may he easy for text editing (as pretty much all work is already done) but what if you have some other features where you want to get "live syncing"? It starts out easy but can become harder imo.
1 comments

The core idea is that you are syncing a data structure, for example a map, so you can get a lot done with that (yjs’s presence stuff can be helpful for other live features).

In the end I have just been stuffing the data structure directly into postgres “as-is”. I think there are some tricks you can use to shrink some historical data but I think it’s pretty straightforward if you get to a size where the data size matters