{"id":15111546,"url":"https://github.com/mingyi850/kv_dist_store","last_synced_at":"2026-02-04T01:09:50.084Z","repository":{"id":233328177,"uuid":"787014808","full_name":"mingyi850/kv_dist_store","owner":"mingyi850","description":"Distributed eventually consistent key-value store in Elixir with anti-entropy, versioning, consistent hashing and gossip protocls","archived":false,"fork":false,"pushed_at":"2024-05-08T02:08:34.000Z","size":17333,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-03T17:55:03.811Z","etag":null,"topics":["databases","distributed-systems","elixir"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/mingyi850.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":"2024-04-15T18:17:33.000Z","updated_at":"2024-05-08T02:08:37.000Z","dependencies_parsed_at":"2024-05-08T03:35:45.896Z","dependency_job_id":null,"html_url":"https://github.com/mingyi850/kv_dist_store","commit_stats":null,"previous_names":["mingyi850/kv_dist_store"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mingyi850/kv_dist_store","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingyi850%2Fkv_dist_store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingyi850%2Fkv_dist_store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingyi850%2Fkv_dist_store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingyi850%2Fkv_dist_store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mingyi850","download_url":"https://codeload.github.com/mingyi850/kv_dist_store/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingyi850%2Fkv_dist_store/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29063447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T00:26:14.114Z","status":"ssl_error","status_checked_at":"2026-02-04T00:23:06.435Z","response_time":96,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["databases","distributed-systems","elixir"],"created_at":"2024-09-26T00:21:03.195Z","updated_at":"2026-02-04T01:09:50.066Z","avatar_url":"https://github.com/mingyi850.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Distributed Systems Final Project\n## Comparison and Analysis of Weak Consistency in Key Value Stores\n\n## Summary\nOur project aims to implement such a weakly consistent datastore using concepts from Dynamo DB (Which also underpin Cassandra and Scylla DB) such as gossip protocols, anti-entropy and vector clocks to exchange information on members and operations.\n## Contents\n1. Implementation of Key-Value Store\n    1. Implementation of Basic Key-Value Store\n        - KV Store to be implemented as a cluster of nodes, each serving as a single replica\n        - Symmetry - every node in Dynamo has the same set of responsibility as its peers (leaderless(?))\n        - Decentralization - Gossip\n        - Interface: get(key) and put(key, context, object)\n            1. get(key)locates where the object is located and returns a single object if present\n                - Returns object with latest vector clock\n            2. If conflicts occur, it returns a list of objects with a separate 'context' object\n                - If multiple vector clocks are concurrent, it returns a list of all the objects and their vector clocks\n            3. put(key, context, object) determines where replicas should be written to based on key and writes replicas to disk.\n                - Put should send command to replicate to other nodes once received\n                - It then stores data in it's own store\n                - Then returns success to client\n            4. context encodes system metadata about the object (opaque to caller), includes information such as version.\n                - context is stored with object, so system can verify validity of context supplied in put request (?)\n                - context contains vector clock information (which denotes it's version)\n                - client needs to reconcile data with concurrent vector clocks and send new request to server\n\n\n        \n    2. Gossip Protocol for membership and failure detection\n        - \n    3. Anti-entropy mechanism using merkle trees\n        - Conflict resolution occurrs on reads\n\n    4. Partitioning (Using consistent hashing)\n    - Each key is hashed using MD5 hashing to create 128 bit identifier.\n    - Nodes are assigned a random position in a ring\n    - Each node has a number of 'tokens' such that is occupies multiple spaces in the ring\n    - key hash is mapped to a position in the ring, and we traverse the ring clockwise to find the next node. Key goes into that node.\n    - #### We can simplify this by using a single node per server, and using a hash modulo 360 with 360 positions on the ring.\n\n    5. Replication\n        - Each pieces of data is replicated at N hosts. \n        - Each key has a main host (coordinator node) based on hash position\n        - Coordinator node will replicate keys at N - 1 successor nodes in the ring. (Find the next 2 nodes in the ring and replicate to them)\n\n    6. Versioning\n        - \n    7. Sloppy Quorum and hinted Handoff\n\n\n### Observer\n1. Observers put() and get() operations\n2. put() -\u003e value, node, context (vector clock), latency (timestamp of sent vs timestamp of response)\n3. get() -\u003e value, context (vector clock), latency (timestamp of sent vs timestamp of response)\n4. Measuing staleness -\u003e *find some measure of staleness between vector clocks\n\n\n### Fuzzers:\n1. See if we can vary network latency \n    - create a function which sendProbable(mesage, host, delayParams)\n2. KV store nodes might just drop messages (by number of messages or by timer)\n\n### Network Conditions \n- Increased latency \n- Server crashes\n- Dropped messages \n\n### Testing and Benchmarking\n1. Access patterns \n- multiple test cases \n    - Some will distribute the values of the keys \n        - Increased latency \n        - Server crashes\n        - Dropped messages \n    - Some will cluster the values of the keys \n        - Increased latency \n        - Server crashes\n        - Dropped messages \n    - Measure staleness and latency in these 2 main cases\n\n### Design doc\n    - API from client to server \n    - What the servers will send to observers\n\n### Split \n- Mingyi: Dynamo DB (dist kv store)\n- Sheng Siang: Observer and Test cases\n\n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmingyi850%2Fkv_dist_store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmingyi850%2Fkv_dist_store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmingyi850%2Fkv_dist_store/lists"}