{"id":18522288,"url":"https://github.com/poorlydefinedbehaviour/ocaml-raft","last_synced_at":"2025-05-14T18:10:32.330Z","repository":{"id":242299026,"uuid":"729384040","full_name":"PoorlyDefinedBehaviour/ocaml-raft","owner":"PoorlyDefinedBehaviour","description":"Distributed key value store built on top of a Raft implementation with eio from scratch.","archived":false,"fork":false,"pushed_at":"2024-06-02T01:12:01.000Z","size":121,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T05:27:38.060Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"OCaml","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/PoorlyDefinedBehaviour.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":"2023-12-09T04:10:54.000Z","updated_at":"2025-01-26T17:48:48.000Z","dependencies_parsed_at":"2024-06-02T03:31:35.516Z","dependency_job_id":"75754f0a-23b6-467f-a815-27d7c5737a88","html_url":"https://github.com/PoorlyDefinedBehaviour/ocaml-raft","commit_stats":null,"previous_names":["poorlydefinedbehaviour/ocaml-raft"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PoorlyDefinedBehaviour%2Focaml-raft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PoorlyDefinedBehaviour%2Focaml-raft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PoorlyDefinedBehaviour%2Focaml-raft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PoorlyDefinedBehaviour%2Focaml-raft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PoorlyDefinedBehaviour","download_url":"https://codeload.github.com/PoorlyDefinedBehaviour/ocaml-raft/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254198512,"owners_count":22030966,"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":[],"created_at":"2024-11-06T17:29:44.425Z","updated_at":"2025-05-14T18:10:27.322Z","avatar_url":"https://github.com/PoorlyDefinedBehaviour.png","language":"OCaml","readme":"## About\n\nDistributed key value store built on top of a Raft implementation with [eio](https://github.com/ocaml-multicore/eio) from scratch.  I started working on this to practice OCaml. I'll stop working on it as soon as I lose interest.  \n\nNot every module uses eio because I started without it.\n\n## Running locally\n\nStart the replicas.\n\n```\n# Terminal 1\nID=0 dune exec server\n\n# Terminal 2\nID=1 dune exec server\n\n# Terminal 3\nID=2 dune exec server\n```\n\nSends requests\n\n```\n# Replica 1\ncurl -XPOST http://localhost:8100 -d '{\"key\": \"a\", \"value\": \"1\"}'\ncurl http://localhost:8100/key\n\n# Replica 2\ncurl -XPOST http://localhost:8101 -d '{\"key\": \"a\", \"value\": \"1\"}'\ncurl http://localhost:8101/key\n\n# Replica 3\ncurl -XPOST http://localhost:8102 -d '{\"key\": \"a\", \"value\": \"1\"}'\ncurl http://localhost:8102/key\n```\n\n## TODO\n\n- After an user request is received and replicated to a quorum, a response must be sent to the client.\n- Check that the replica append one entry to its log when it becomes a leader\n- Use eio in the network and storage layer\n- Check that data is correctly stored in the state file (look at the file contents and ensure there's nothing weird stored in there)\n- Heartbeat timeout handling. Reset timeout\n- Persist last applied index to avoid reapplying the whole log\n- Handle exceptions\n- Stop using lists\n- Remove completed todos\n- Clean up inflight requests, add request queue\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoorlydefinedbehaviour%2Focaml-raft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoorlydefinedbehaviour%2Focaml-raft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoorlydefinedbehaviour%2Focaml-raft/lists"}