It is interesting to see yjs with hoccuspocus being used. I am currently considering our options for real time document editing + full text search.

Seems like a common approach is something like using yjs for sync with a temporary LSM storage like rocksdb for updates and then periodically snapshot to postgres for full text search and compaction.

Take a look at my Y.js sync server at https://teleportal.tools if you are already using JS on your backend