# Evan Wallace - Realtime Editing of Ordered Sequences (Highlights) ![rw-book-cover|256](https://cdn.sanity.io/images/599r6htc/localized/54d9b3ef8910c1faabcf3866bc097a6739c5e10d-1400x748.png?w=1200&q=70&fit=max&auto=format) ## Metadata **Review**:: [readwise.io](https://readwise.io/bookreview/61531416) **Source**:: #from/readwise #from/reader **Zettel**:: #zettel/fleeting **Status**:: #x **Authors**:: [[Evan Wallace]] **Full Title**:: Realtime Editing of Ordered Sequences **Category**:: #articles #readwise/articles **Category Icon**:: 📰 **URL**:: [www.figma.com](https://www.figma.com/blog/realtime-editing-of-ordered-sequences/) **Host**:: [[www.figma.com]] **Highlighted**:: [[2026-06-22]] **Created**:: [[2026-07-04]] ## Highlights - The actual implementation details are a lot more complex. They’re actually so complex that the [first paper on OT](https://scholar.google.com/scholar?q=Concurrency+control+in+groupware+systems) had some [subtle problems](https://scholar.google.com/scholar?q=A+Survey+on+Operational+Transformation+Algorithms%3A+Challenges%2C+Issues+and+Achievements) that went undiscovered for several years. The problems have since been fixed and OT is a very viable algorithm, but the high implementation cost is only worth it you need the specific benefits it offers for editing text sequences. ([View Highlight](https://read.readwise.io/read/01kvpa91pn5nj7ykptkqf80qbv)) ^1027547989 - OT was overkill for us because we didn’t need to work with enormous sequences and we didn’t need to avoid interleaving. Reordering is also a very common operation in a layer-based design tool like ours and we wanted to make that efficient without additional complexity. ([View Highlight](https://read.readwise.io/read/01kvpaanfkq70k721dv7y6njew)) ^1027548016 - Every object has a real number as an index and the order of the children for an element of the tree is determined by sorting all children by their index. To insert between two objects, just set the index for the new object to the average index of the two objects on either side. We use arbitrary-precision fractions instead of 64-bit doubles so that we can’t run out of precision after lots of edits. ([View Highlight](https://read.readwise.io/read/01kvpac7cd6cn6cdz1ezgj2f42)) ^1027548034 - In our implementation, every index is a fraction between 0 and 1 exclusive. Being exclusive is important; it ensures we can always generate an index before or after an existing index by averaging with 0 or 1, respectively. ([View Highlight](https://read.readwise.io/read/01kvpae2x39szt9fs0jtn6mk6n)) ^1027548087 - Each index is stored as a string and averaging is done using string manipulation to retain precision. ([View Highlight](https://read.readwise.io/read/01kvpaechnerv2exvqsxtg30j9)) ^1027548105 - This case arises when two clients try to simultaneously insert a new object between the same two objects. The server can avoid ever having two objects with an identical position by just generating and assigning a unique position to the second insert operation. ([View Highlight](https://read.readwise.io/read/01kvpagjhhyedgtjvy8sxvzase)) ^1027548387