Implementations of L-SEQ algorithm aka fractional indexing for Rust, Typescript, Golang, and more. Shared conformance and fuzz testing for correctness and performance.
Find a file
2025-12-13 07:43:29 -08:00
conformance-tests feat: implement lseq for golang 2025-12-12 23:18:05 -08:00
docs Add binary attributes for image files 2025-12-12 17:33:38 -08:00
golang feat: implement lseq for golang 2025-12-12 23:18:05 -08:00
research fix: upgrade everywhere to rand 0.9 2025-12-12 21:34:06 -08:00
rust fix: upgrade everywhere to rand 0.9 2025-12-12 21:34:06 -08:00
typescript chore: mark typescript package as tree shakeable 2025-12-13 07:43:29 -08:00
.gitattributes Add binary attributes for image files 2025-12-12 17:33:38 -08:00
.gitignore chore: mark typescript package as tree shakeable 2025-12-13 07:43:29 -08:00
README.md Add binary attributes for image files 2025-12-12 17:33:38 -08:00

L-SEQ - Fractional Indexing for List CRDTs

This repository contains implementations of the L-SEQ algorithm for fractional indexing, used to create naive list CRDTs (Conflict-free Replicated Data Types). L-SEQ provides a way to generate unique, sortable identifiers that can be inserted between any two existing identifiers, making it ideal for collaborative editing and distributed systems.

Visualization of LSEQ tree structure

Implementations

  • TypeScript: @peoplesgrocers/lseq - Located in the typescript/ directory
  • Rust: peoplesgrocers-lseq - Located in the rust/ directory

What is L-SEQ?

L-SEQ is a sequence CRDT that uses fractional indexing to maintain a total order of elements in a distributed system. It allows multiple users to concurrently insert elements into a list without conflicts, automatically resolving the order based on the generated identifiers.

Usage

Each implementation provides:

  • Allocation of new identifiers between existing ones
  • Comparison functions for sorting
  • Serialization to/from strings

See the individual directories for language-specific documentation and examples.

References

This library implements:

Brice Nédelec, Pascal Molli, Achour Mostefaoui, Emmanuel Desmontils. LSEQ: an Adaptive Structure for Sequences in Distributed Collaborative Editing. 13th ACM Symposium on Document Engineering (DocEng), Sep 2013, Florence, Italy. pp.3746, 10.1145/2494266.2494278. hal-00921633

I recommend also reading:

Marc Shapiro, Nuno Preguiça, Carlos Baquero, Marek Zawirski. A comprehensive study of Conver- gent and Commutative Replicated Data Types. [Research Report] RR-7506, Inria Centre Paris- Rocquencourt; INRIA. 2011, pp.50. inria-00555588