{"id":37211985,"url":"https://github.com/galaxyzeta/simplekv","last_synced_at":"2026-01-15T00:20:58.386Z","repository":{"id":171733999,"uuid":"434677689","full_name":"Galaxyzeta/simplekv","owner":"Galaxyzeta","description":"A simple distributed kv system from scratch. Under construction.","archived":false,"fork":false,"pushed_at":"2022-05-21T14:11:32.000Z","size":125,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"leader-as-controller","last_synced_at":"2024-06-21T19:50:23.445Z","etag":null,"topics":["distributed-systems","golang","kafka","key-value","master-slave","storage"],"latest_commit_sha":null,"homepage":"","language":"Go","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/Galaxyzeta.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":"2021-12-03T17:21:13.000Z","updated_at":"2023-11-06T16:25:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"8dad5b2c-bf57-4adb-b8f4-c2d7deb5ff2d","html_url":"https://github.com/Galaxyzeta/simplekv","commit_stats":null,"previous_names":["galaxyzeta/simplekv"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Galaxyzeta/simplekv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Galaxyzeta%2Fsimplekv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Galaxyzeta%2Fsimplekv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Galaxyzeta%2Fsimplekv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Galaxyzeta%2Fsimplekv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Galaxyzeta","download_url":"https://codeload.github.com/Galaxyzeta/simplekv/tar.gz/refs/heads/leader-as-controller","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Galaxyzeta%2Fsimplekv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28439666,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: 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":["distributed-systems","golang","kafka","key-value","master-slave","storage"],"created_at":"2026-01-15T00:20:57.675Z","updated_at":"2026-01-15T00:20:58.330Z","avatar_url":"https://github.com/Galaxyzeta.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimpleKV\n\nA simple distributed key-value storage system based on bitcask from scratch.\n\nHave minimum dependencies, nearly built from nothing.\n\nThis project is a experiment on kafka's distributed system and bitcask storage model. **Do not use this in production!**\n\n## How to run this project\n\n- To run this project, you should have **Apache Zookeeper** running on your OS first.\n- Let's run a standalone server as test!  Go to `/conf/client/cli.yaml` and `/conf/standalone/server-standalone.yaml`, and check whether your zookeeper port is correctly configured.\n\n  ```yaml\n  zk:\n    servers:\n      - 127.0.0.1:[YourPortHere]\n  ```\n\n- Then go into the root folder of this project, try to boot up a **standalone** server.\n\n  ```bash\n  go mod tidy\n  make standalone\n  ```\n\n- Boot up a CLI client to start operating.\n  ```bash\n  make cli\n  ```\n\n- Try some of the commands:\n  ```bash\n  127.0.0.1:2181\u003e set hello 1\n  OK\n  127.0.0.1:2181\u003e get hello\n  1\n  127.0.0.1:2181\u003e expire hello 200\n  OK\n  127.0.0.1:2181\u003e ttl hello\n  198\n  127.0.0.1:2181\u003e del hello\n  OK\n  127.0.0.1:2181\u003e get hello\n  record not found\n  ```\n\n## Roadmap\n\nHere are some basic requirements:\n\n- [x] LRU Cache.\n- An index system based on either hashmap / skiplist.\n  - [x] hashmap\n- Support string data structure. Implement GET/SET/EXPIRE/DEL method.\n  - [x] Get\n  - [x] Set\n  - [x] Expire\n  - [x] Del\n- [x] Appendonly log as disk storage with Bitcask theory.\n- [x] Master-slave replication.\n  - [x] Controller election.\n  - [x] Leader election by comparing offsets.\n  - [x] Log replication.\n  - [x] ISR management.\n- [x] Using zookeeper/etcd as service registration, leader election, etc.\n- [x] Using GRPC to communicate between client-server and server-server.\n\n## Special Thanks\n\nSome projects I've studied which inspired this project.\n\n- rosedb: a kv system based on bitcask.\n- minidb: a minimum implementation of bitcask, written by the same author for tutorial purpose.\n- groupcache: distributed cache system using consistent hash + singleflight.\n- secret project A: a distributed kv system based on storage unit consists of rocksdb + LRU cache, using hashslot to achieve distributed storage and elastic expansion.\n- bitcask paper: https://riak.com/assets/bitcask-intro.pdf\n- kafka: a famous, widely used industrial distributed message queue.\n- distributed system design patterns: https://github.com/dreamhead/patterns-of-distributed-systems","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalaxyzeta%2Fsimplekv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgalaxyzeta%2Fsimplekv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalaxyzeta%2Fsimplekv/lists"}