{"id":13648567,"url":"https://github.com/josephg/diamond-types","last_synced_at":"2025-05-14T15:06:29.001Z","repository":{"id":38336776,"uuid":"282220330","full_name":"josephg/diamond-types","owner":"josephg","description":"The world's fastest CRDT. WIP.","archived":false,"fork":false,"pushed_at":"2024-10-29T02:49:16.000Z","size":18999,"stargazers_count":1666,"open_issues_count":14,"forks_count":33,"subscribers_count":45,"default_branch":"master","last_synced_at":"2025-05-08T20:44:45.287Z","etag":null,"topics":["collaborative-editing","crdt"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/josephg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-24T12:58:15.000Z","updated_at":"2025-05-06T04:28:49.000Z","dependencies_parsed_at":"2024-03-28T00:32:16.832Z","dependency_job_id":"6c464e1d-cc31-4a50-b32b-560053a45a10","html_url":"https://github.com/josephg/diamond-types","commit_stats":{"total_commits":1228,"total_committers":3,"mean_commits":409.3333333333333,"dds":"0.013029315960912058","last_synced_commit":"00f722d6ebdc9f3aec94d4406d9856b385939eae"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josephg%2Fdiamond-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josephg%2Fdiamond-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josephg%2Fdiamond-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josephg%2Fdiamond-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/josephg","download_url":"https://codeload.github.com/josephg/diamond-types/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254169062,"owners_count":22026208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["collaborative-editing","crdt"],"created_at":"2024-08-02T01:04:21.383Z","updated_at":"2025-05-14T15:06:28.967Z","avatar_url":"https://github.com/josephg.png","language":"Rust","funding_links":[],"categories":["Rust","Server","others","⚙️ Development Tools \u0026 Libraries"],"sub_categories":["Rust","CRDT Libraries"],"readme":"# Diamond Types\n\n[**📦 Cargo package**](https://crates.io/crates/diamond-types)\n\n[**📖 Documentation on docs.rs**](https://docs.rs/diamond-types/latest/diamond_types/)\n\n[**🇳 NodeJS package on npm (via WASM)**](https://www.npmjs.com/package/diamond-types-node)\n\n[**🌐 Web browser package on npm (via WASM)**](https://www.npmjs.com/package/diamond-types-web)\n\nThis repository contains a high performance rust CRDT for text editing. This is a special data type which supports concurrent editing of lists or strings\n(text documents) by multiple users in a P2P network without needing a\ncentralized server.\n\nThis version of diamond types only supports plain text editing. Work is underway to add support for other JSON-style data types. See the `more_types` branch for details.\n\nThis project was initially created as a prototype to see how fast a well optimized CRDT could be made to go. The answer is really fast - faster than other similar libraries. This library is currently in the process of being expanded into a fast, feature rich CRDT in its own right.\n\nFor detail about how to *use* diamond types, see the [package level documentation at docs.rs](https://docs.rs/diamond-types/latest/diamond_types/).\n\nNote the package published to cargo is quite out of date, both in terms of API and performance.\n\nFor much more detail about how this library *works*, see:\n\n- The talk I gave on this library at a recent [braid user meetings](https://braid.org/meeting-14) or\n- [INTERNALS.md](INTERNALS.md) in this repository.\n- [This blog post on making diamond types 5000x faster than competing CRDT implementations](https://josephg.com/blog/crdts-go-brrr/)\n  - And since that blog post came out, performance has increased another 10-80x (!).\n\nAs well as being lightning fast, this library is also designed to be interoperable with positional updates. This allows simple peers to interact with the data structure via operational transform.\n\n\n## Internals\n\nEach client / device has a unique ID. Each character typed or deleted on\neach device is assigned an incrementing sequence number (starting at 0).\nEach character in the document can thus be uniquely identified by the\ntuple of `(client ID, sequence number)`. This allows any location in the\ndocument to be uniquely named.\n\nThe internal data structures are designed to optimize two main operations:\n\n- Text edit to CRDT operation (Eg, \"user A inserts at position 100\" -\u003e \"user A\n  seq 1000 inserts at (B, 50)\")\n- CRDT operation to text edit (\"user A\n  seq 1000 inserts at (B, 50)\" -\u003e \"insert at document position 100\")\n\nMuch more detail on the internal data structures used is in [INTERNALS.md](INTERNALS.md).\n\n\n# LICENSE\n\nThis code is published under the ISC license.\n\n\n# Acknowledgements\n\nThis work has been made possible by funding from the [Invisible College](https://invisible.college/).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosephg%2Fdiamond-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjosephg%2Fdiamond-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosephg%2Fdiamond-types/lists"}