Binary encoding the Yjs model is pretty cheap. But it is not a good idea to write the model to Redis every time the document changes. Instead, we append document updates to the updates list (which is a non-blocking operation in Redis). When the updates list reaches a certain threshold, the updated Yjs model is written to the database: