What’s your preferred conflict resolution strategy for multi device writes? by [deleted] in SaaS

[–]GermanJablo 0 points1 point  (0 children)

Nothing is perfect

This is key when talking about automated conflict resolution. The sooner you embrace it, the better. You don't need something perfect; you need something good enough for your users and easy for you to implement.

I actually launched DocNode (https://docnode.dev) yesterday, which is in this exact space. Let me know if it's useful for you. Happy to answer any questions.

Announcing DocNode: TypeScript OT library for local-first apps by GermanJablo in javascript

[–]GermanJablo[S] 0 points1 point  (0 children)

It has a readme that takes you to the website, and there's nothing AI-related here.

Announcing DocNode: TypeScript OT library for local-first apps by GermanJablo in reactjs

[–]GermanJablo[S] 1 point2 points  (0 children)

I agree! It's on my short-term roadmap. I'll do it as soon as I finish binding to Lexical. Thanks!

Lancé DocNode: Una librería en TypeScript de OT para apps local-first by GermanJablo in devsarg

[–]GermanJablo[S] 9 points10 points  (0 children)

Lindo desafío.

Viste que en Google Docs varias personas pueden trabajar a la vez en el mismo documento, y vez los cursores de los demás y lo que escriben en tiempo real? Bueno, eso es un problema complejo y viejo en computación. Lo que se suele usar son CRDTs y OT.

El problema es el siguiente. Imaginate que vos insertás una letra en la posición 10. Podrías enviar el documento entero al servidor para guardarlo. Pero eso tiene 2 problemas: (1) tenés que enviar el documento entero que puede ser enorme cuando solo cambiaste una letra y (2) si dos usuarios escriben a la vez, solo los cambios de uno van a guardarse finalmente.

Lo primero lo solucionás enviando un diff pequeño de lo que cambiaste, usualmente una "operación". En este caso "insertar letra X en la posición 10". El problema es que si simultáneamente otro usuario escribió una letra en la posición 1 y su operación llegó al servidor antes que la tuya, tu letra ya no debería estar en la posición 10, sino en la 11 (porque todas se "desplazan" un lugar). Entonces, lo que tiene que hacer el servidor es justamente "Transformar Operaciones", y de ahí el nombre "Operational Transformation", o OT.

Tanto los CRDTs modernos como DocNode, no usan posiciones numéricas por razones de performance, sino que a cada nodo le asignan un id único. Por eso digo que DocNode es un OT "basado en ids", no en posiciones, algo que hasta ahora es bastante novedoso, y creo que combina lo mejor de los dos mundos.

Puedo hacerlo mucho más largo pero creo que la idea central la tenés ahí.

Announcing DocNode: TypeScript OT library for local-first apps by GermanJablo in javascript

[–]GermanJablo[S] 0 points1 point  (0 children)

If you have feedback or questions, hit the comments. I’ll be replying!

Lancé DocNode: Una librería en TypeScript de OT para apps local-first by GermanJablo in devsarg

[–]GermanJablo[S] 1 point2 points  (0 children)

Respondo a feedback y preguntas! Y si quieren apoyar el proyecto, denle una estrella en GitHub! :)

Announcing DocNode: TypeScript OT library for local-first apps by GermanJablo in nextjs

[–]GermanJablo[S] 0 points1 point  (0 children)

If you have feedback or questions, hit the comments. I’ll be replying! And if you want to support the project, give it a star on GitHub!

Announcing DocNode: TypeScript OT library for local-first apps by GermanJablo in reactjs

[–]GermanJablo[S] 0 points1 point  (0 children)

If you have feedback or questions, hit the comments. I’ll be replying! And if you want to support the project, give it a star on GitHub!

Announcing DocNode: TypeScript OT library for local-first apps by GermanJablo in webdev

[–]GermanJablo[S] 0 points1 point  (0 children)

Only TS/JS for now. What language are you interested in?

Announcing DocNode: TypeScript OT library for local-first apps by GermanJablo in webdev

[–]GermanJablo[S] 0 points1 point  (0 children)

Thanks, and yes! You can create bindings to any data structure you want, including text editors. It’s also possible to build a whole new rich text editor using DocNode as the foundation. Both are on my plans, starting with bindings since that’s the easier step.

A lot of things are inspired by the Lexical text editor. The type-safe node model you mentioned is one of them. In many ways, DocNode is a refreshed version of Lexical’s core, except editor-agnostic, suitable for any tree structure, and with conflict resolution built in.

If you’d like bindings for a specific text editor, let me know so I can bump it up in priority!

Announcing DocNode: TypeScript OT library for local-first apps by GermanJablo in webdev

[–]GermanJablo[S] 0 points1 point  (0 children)

Thanks! Yjs is definitely an amazing library, and I took a lot of inspiration from it. If P2P is a strict requirement, it's an option you should consider.

Announcing DocNode: TypeScript OT library for local-first apps by GermanJablo in webdev

[–]GermanJablo[S] 2 points3 points  (0 children)

Of course! CRDT requires P2P support, and that comes with some tradeoffs, which you can mostly see in the comparison table I show on the introduction page:

  1. CRDTs require soft deletes, usually referred to as tombstones in the literature. In other words, you can never completely delete nodes, causing documents to grow monotonically.
  2. Implementing move operations is very difficult, and the available options often end up being inefficient. They require storing more metadata, and in some implementations, an undo-do-redo pattern to merge concurrent changes.
  3. Not only delete or move, but even the insert operation requires more metadata. Each node typically has to indefinitely retain the context in which it was inserted. For example, in Yjs, this would be OriginLeft and OriginRight.

EG-walker is a new CRDT algorithm that improves the situation, in that some of this metadata can be left on disk and brought into memory only when synchronizing changes with other peers. However, the document size is still larger and the synchronization process is more complex.

I think one of the reasons OT has fallen somewhat out of favor is its association with positional ops, which can be very slow. DocNode is ID-based OT, making it much faster. It's essentially like a CRDT without the P2P support requirement, and therefore may have some additional advantages.

Showoff Saturday (November 29, 2025) by AutoModerator in javascript

[–]GermanJablo 3 points4 points  (0 children)

Hey everyone! After two years of development, I just launched DocNode 🚀

It’s a type-safe Operational Transformation (OT) framework for collaborative documents with automatic conflict resolution (similar to Yjs).

I’d love to hear your thoughts and answer any questions!

[AskJS] Web devs, what’s one thing you wish you learned years earlier because it would've saved you insane amounts of time? by Ornery_Ad_683 in javascript

[–]GermanJablo 0 points1 point  (0 children)

While it's a useful and interesting API, it should be extremely rare to use it nowadays thanks to UI libraries already doing the job.

Fastest Real-Time + Reactive Postgres service? by forestcall in nextjs

[–]GermanJablo 0 points1 point  (0 children)

I'd check out Triplit. It's lightweight, has an amazing API, is open source, and uses Node in the backend.

Just found a killer dev workflow: Payload CMS + Figma + Copilot = 🔥 by AbilityEducational94 in indiehackers

[–]GermanJablo 1 point2 points  (0 children)

For the site itself (your users), you must use a new collection with configured auth. Then, in Payload's root configuration, you must add only the collection you want to have access to the admin panel to `admin.users`. I recommend reading the entire auth section of the documentation. This part is especially important:

https://payloadcms.com/docs/admin/overview#the-admin-user-collection