{"id":18334620,"url":"https://github.com/hankjacobs/vvmap","last_synced_at":"2025-04-06T04:33:30.120Z","repository":{"id":57534178,"uuid":"152012777","full_name":"hankjacobs/vvmap","owner":"hankjacobs","description":"A delta-based CRDT map implementation in Go","archived":false,"fork":false,"pushed_at":"2018-10-09T16:26:52.000Z","size":10,"stargazers_count":15,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T17:35:06.628Z","etag":null,"topics":["crdt","delta-crdt","distributed","distributed-systems","go","golang","map"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hankjacobs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-08T03:21:49.000Z","updated_at":"2023-10-08T07:33:24.000Z","dependencies_parsed_at":"2022-09-26T18:21:29.624Z","dependency_job_id":null,"html_url":"https://github.com/hankjacobs/vvmap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hankjacobs%2Fvvmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hankjacobs%2Fvvmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hankjacobs%2Fvvmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hankjacobs%2Fvvmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hankjacobs","download_url":"https://codeload.github.com/hankjacobs/vvmap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223237256,"owners_count":17111344,"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","delta-crdt","distributed","distributed-systems","go","golang","map"],"created_at":"2024-11-05T19:50:14.406Z","updated_at":"2025-04-06T04:33:29.854Z","avatar_url":"https://github.com/hankjacobs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vvmap [![GoDoc](https://godoc.org/github.com/hankjacobs/vv?status.png)](https://godoc.org/github.com/hankjacobs/vv)\n\nvvmap is a [Go](http://www.golang.org) implementation of a delta-based CRDT map as written about in [\"∆-CRDTs: Making δ-CRDTs Delta-Based\"](http://nova-lincs.di.fct.unl.pt/system/publication_files/files/000/000/666/original/a12-van_der_linde.pdf?1483708753), [\"Dotted Version Vectors: Logical Clocks for Optimistic Replication\"](https://arxiv.org/pdf/1011.5808.pdf), and Tyler McMullen's excellent talk [\"The Anatomy of a Distributed System\"](https://www.infoq.com/presentations/health-distributed-system).  \n\nUsage:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n \t\"github.com/hankjacobs/vvmap\"\n)\n\nfunc main() {\n\tlexicographicConflictResolver := func(key string, left, right vvmap.Record) bool {\n\t\tleftVal := left.Value.(string)\n\t\trightVal := right.Value.(string)\n\t\treturn strings.Compare(leftVal, rightVal) \u003e 0 // choose left if lexicographically greater\n\t}\n\n\talice := vvmap.New(\"alice\", lexicographicConflictResolver)\n\tbob := vvmap.New(\"bob\", lexicographicConflictResolver)\n\ttim := vvmap.New(\"tim\", lexicographicConflictResolver)\n\n\t// concurrently update everyone -- causes a conflict, should all resolve to \"turkey\" since\n\t// lexicographically greatest\n\talice.Set(\"lunch\", \"turkey\")\n\tbob.Set(\"lunch\", \"ham\")\n\ttim.Set(\"lunch\", \"chicken\")\n\n\t// get records that Bob has but Alice doesn't\n\tdelta := bob.Delta(alice.Version())\n\talice.Merge(delta)\n\n\t// get records that Tim has but Alice doesn't\n\tdelta = tim.Delta(alice.Version())\n\talice.Merge(delta)\n\n\t// sync bob\n\tbob.Merge(alice.Delta(bob.Version())) // alice is most up-to-date so no need to sync with Tim\n\n\t// sync tim\n\ttim.Merge(alice.Delta(tim.Version()))\n\n\tfmt.Println(\"alice:\", alice.Get(\"lunch\"))\n\tfmt.Println(\"bob:\", bob.Get(\"lunch\"))\n\tfmt.Println(\"tim:\", tim.Get(\"lunch\"))\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhankjacobs%2Fvvmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhankjacobs%2Fvvmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhankjacobs%2Fvvmap/lists"}