{"id":21217205,"url":"https://github.com/cachapa/crdt","last_synced_at":"2025-04-04T14:03:51.010Z","repository":{"id":44772514,"uuid":"236353870","full_name":"cachapa/crdt","owner":"cachapa","description":"Dart implementation of Conflict-free Replicated Data Types (CRDTs)","archived":false,"fork":false,"pushed_at":"2024-11-02T09:11:47.000Z","size":151,"stargazers_count":168,"open_issues_count":1,"forks_count":22,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-28T13:07:27.647Z","etag":null,"topics":["crdt","dart","flutter"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/crdt","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cachapa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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-01-26T18:07:14.000Z","updated_at":"2025-03-19T02:50:13.000Z","dependencies_parsed_at":"2024-06-20T23:24:23.306Z","dependency_job_id":"70181f05-df65-4b25-ae32-aa1edaac1886","html_url":"https://github.com/cachapa/crdt","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cachapa%2Fcrdt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cachapa%2Fcrdt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cachapa%2Fcrdt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cachapa%2Fcrdt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cachapa","download_url":"https://codeload.github.com/cachapa/crdt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247190236,"owners_count":20898700,"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":["crdt","dart","flutter"],"created_at":"2024-11-20T21:57:24.986Z","updated_at":"2025-04-04T14:03:50.988Z","avatar_url":"https://github.com/cachapa.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"Dart implementation of Conflict-free Replicated Data Types (CRDTs).\n\nThis project is heavily influenced by James Long's talk [CRTDs for Mortals](https://www.dotconferences.com/2019/12/james-long-crdts-for-mortals) and includes a Dart-native implementation of Hybrid Local Clocks (HLC) based on the paper [Logical Physical Clocks and Consistent Snapshots in Globally Distributed Databases](https://cse.buffalo.edu/tech-reports/2014-04.pdf) (pdf).\n\nIt has [minimal external dependencies](https://github.com/cachapa/crdt/blob/master/pubspec.yaml), so it should run anywhere where Dart runs, which is pretty much everywhere.\n\nThe `Crdt` class implements CRDT conflict resolution and serves as a storage-agnostic interface for specific implementations. Als included with this package is `MapCrdt`, an ephemeral implementation using Dart HashMaps.\n\nOther implementations include (so far):\n- [hive_crdt](https://github.com/cachapa/hive_crdt), a no-sql implementation using [Hive](https://pub.dev/packages/hive) as persistent storage.\n- [sql_crdt](https://github.com/cachapa/sql_crdt), an abstract implementation for using relational databases as a data storage backend.\n- [sqlite_crdt](https://github.com/cachapa/sqlite_crdt), an implementation using Sqlite for storage, useful for mobile or small projects.\n- [postgres_crdt](https://github.com/cachapa/postgres_crdt), a `sql_crdt` that benefits from PostgreSQL's performance and scalability intended for backend applications.\n\nSee also [crdt_sync](https://github.com/cachapa/crdt_sync), a turnkey approach for real-time network synchronization of `Crdt` nodes.\n\n## Usage\n\nThe simplest way to experiment with this package is to use the provided `MapCrdt` implementation:\n\n```dart\nimport 'package:crdt/map_crdt.dart';\n\nvoid main() {\n  var crdt1 = MapCrdt(['table']);\n  var crdt2 = MapCrdt(['table']);\n\n  print('Inserting 2 records in crdt1…');\n  crdt1.put('table', 'a', 1);\n  crdt1.put('table', 'b', 1);\n\n  print('crdt1: ${crdt1.getMap('table')}');\n\n  print('\\nInserting a conflicting record in crdt2…');\n  crdt2.put('table', 'a', 2);\n\n  print('crdt2: ${crdt2.getMap('table')}');\n\n  print('\\nMerging crdt2 into crdt1…');\n  crdt1.merge(crdt2.getChangeset());\n\n  print('crdt1: ${crdt1.getMap('table')}');\n}\n```\n\n## Implementations\n\n`crdt` is currently helping build local-first experiences for:\n\n- [Libra](https://libra-app.eu) a weigh management app with 1M+ installs.\n- [tudo](https://github.com/cachapa/tudo) an open-source simple to-do app + backend.\n\nAre you using this package in your project? Let me know!\n\n## Features and bugs\n\nPlease file feature requests and bugs at the [issue tracker](https://github.com/cachapa/crdt/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcachapa%2Fcrdt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcachapa%2Fcrdt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcachapa%2Fcrdt/lists"}