{"id":24569379,"url":"https://github.com/maxbarsukov/radish-db","last_synced_at":"2026-05-17T13:10:45.088Z","repository":{"id":267211816,"uuid":"900467807","full_name":"maxbarsukov/radish-db","owner":"maxbarsukov","description":"🌱🍠 RadishDB is an in-memory distributed key-value data store","archived":false,"fork":false,"pushed_at":"2025-01-11T12:48:56.000Z","size":4760,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-23T15:25:38.123Z","etag":null,"topics":["database","distributed","elixir","key-value","maxbarsukov","nosql","radish-db"],"latest_commit_sha":null,"homepage":"https://radishdb.maxbarsukov.ru","language":"Elixir","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/maxbarsukov.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["maxbarsukov"],"patreon":"maxbarsukov"}},"created_at":"2024-12-08T20:55:28.000Z","updated_at":"2025-01-11T12:48:59.000Z","dependencies_parsed_at":"2024-12-09T04:18:49.238Z","dependency_job_id":"9737a765-dd0d-4800-b66d-1844c6bb8105","html_url":"https://github.com/maxbarsukov/radish-db","commit_stats":null,"previous_names":["maxbarsukov/radish-db"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbarsukov%2Fradish-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbarsukov%2Fradish-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbarsukov%2Fradish-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxbarsukov%2Fradish-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxbarsukov","download_url":"https://codeload.github.com/maxbarsukov/radish-db/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243982139,"owners_count":20378606,"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":["database","distributed","elixir","key-value","maxbarsukov","nosql","radish-db"],"created_at":"2025-01-23T15:22:56.796Z","updated_at":"2026-05-17T13:10:45.077Z","avatar_url":"https://github.com/maxbarsukov.png","language":"Elixir","funding_links":["https://github.com/sponsors/maxbarsukov","https://patreon.com/maxbarsukov"],"categories":[],"sub_categories":[],"readme":"\u003cimg align=\"right\" src=\"https://raw.githubusercontent.com/maxbarsukov/radish-db/refs/heads/master/docs/assets/logo.png\" alt=\"RadishDB logo\" width=\"365\"\u003e\n\n# RadishDB\n\n\u003e Yet Another Key–Value Database\n\n![GitHub Release](https://img.shields.io/github/v/release/maxbarsukov/radish-db)\n![GitHub License](https://img.shields.io/github/license/maxbarsukov/radish-db)\n![GitHub repo size](https://img.shields.io/github/repo-size/maxbarsukov/radish-db) \\\n[![Elixir](https://github.com/maxbarsukov/radish-db/actions/workflows/elixir.yml/badge.svg?branch=master)](https://github.com/maxbarsukov/radish-db/actions/workflows/elixir.yml)\n[![Markdown](https://github.com/maxbarsukov/radish-db/actions/workflows/markdown.yml/badge.svg?branch=master)](https://github.com/maxbarsukov/radish-db/actions/workflows/markdown.yml)\n[![Coverage Status](https://coveralls.io/repos/github/maxbarsukov/radish-db/badge.svg?branch=master)](https://coveralls.io/github/maxbarsukov/radish-db?branch=master)\n\n## What is RadishDB?\n\nRadishDB is an in-memory distributed key-value data store that chooses Consistency over Availability using own implementation of [Raft Consensus Algorithm](https://raft.github.io/).\n\n## Table of contents\n\n1. [Updates](#updates)\n2. [Getting Started](#getting-started)\n   1. [Pre-reqs](#pre-reqs)\n   2. [Building and Running](#run)\n3. [Testing](#testing)\n4. [Linting](#linting)\n5. [Contributing](#contributing)\n6. [Code of Conduct](#code-of-conduct)\n7. [Get in touch!](#get-in-touch)\n8. [Security](#security)\n9. [Useful Links](#useful-links)\n10. [License](#license)\n\n---\n\n## Updates \u003ca name=\"updates\"\u003e\u003c/a\u003e\n\n\u003cstrong\u003e🎉 v0.1.0 has been released!\u003c/strong\u003e\n\u003cdetails open\u003e\n  \u003csummary\u003e\u003cb\u003e🔔 Dec. 28, 2024 (v0.1.0)\u003c/b\u003e\u003c/summary\u003e\n\n  \u003e - Implement [**RAFT Consensus Algorithm**](https://raft.github.io/raft.pdf);\n  \u003e - Basic distributed key-value store.\n\n\u003c/details\u003e\n\n## 🚀 Getting Started \u003ca name=\"getting-started\"\u003e\u003c/a\u003e\n\n### Pre-reqs \u003ca name=\"pre-reqs\"\u003e\u003c/a\u003e\n\n- Make sure you have [`git`](https://git-scm.com/) installed.\n- Erlang and Elixir (we recommend using [`asdf`](https://asdf-vm.com/) to manage versions).\n\n### Building and Running \u003ca name=\"run\"\u003e\u003c/a\u003e\n\nClone the repository:\n\n```bash\ngit clone git@github.com:maxbarsukov/radish-db.git\ncd radish-db\n```\n\nInstall dependencies:\n\n```bash\nmix deps.get\n```\n\nCompile the project:\n\n```bash\nmix compile\n```\n\nStart the application:\n\n```bash\n$ iex --sname 1 -S mix\niex(1@laptop)\u003e\n```\n\n#### Example\n\nLet's assume we have a 4-node Erlang cluster:\n\n```bash\n$ iex --sname 1 -S mix\niex(1@laptop)\u003e\n\n$ iex --sname 2 -S mix\niex(2@laptop)\u003e Node.connect(:\"1@laptop\")\n\n$ iex --sname 3 -S mix\niex(3@laptop)\u003e Node.connect(:\"1@laptop\")\n\n$ iex --sname 4 -S mix\niex(4@laptop)\u003e Node.connect(:\"1@laptop\")\n```\n\nLoad the following module, which implements the `RadishDB.Raft.StateMachine.Statable` behavior on all cluster nodes:\n\n```elixir\n  defmodule JustAnInt do\n    @behaviour RadishDB.Raft.StateMachine.Statable\n    def new, do: 0\n    def command(i, {:set, j}), do: {i, j}\n    def command(i, :inc), do: {i, i + 1}\n    def query(i, :get), do: i\n  end\n```\n\nCall `RadishDB.ConsensusGroups.GroupApplication.activate/1` on all nodes:\n\n```elixir\niex(1@laptop)\u003e RadishDB.ConsensusGroups.GroupApplication.activate(\"zone1\")\n\niex(2@laptop)\u003e RadishDB.ConsensusGroups.GroupApplication.activate(\"zone2\")\n\niex(3@laptop)\u003e RadishDB.ConsensusGroups.GroupApplication.activate(\"zone1\")\n\niex(4@laptop)\u003e RadishDB.ConsensusGroups.GroupApplication.activate(\"zone2\")\n```\n\nThan create 5 consensus groups, each of which replicates an integer and has 3 consensus members:\n\n```elixir\niex(1@laptop)\u003e config = RadishDB.Raft.Node.make_config(JustAnInt)\niex(1@laptop)\u003e RadishDB.ConsensusGroups.GroupApplication.add_consensus_group(:consensus1, 3, config)\niex(1@laptop)\u003e RadishDB.ConsensusGroups.GroupApplication.add_consensus_group(:consensus2, 3, config)\niex(1@laptop)\u003e RadishDB.ConsensusGroups.GroupApplication.add_consensus_group(:consensus3, 3, config)\niex(1@laptop)\u003e RadishDB.ConsensusGroups.GroupApplication.add_consensus_group(:consensus4, 3, config)\niex(1@laptop)\u003e RadishDB.ConsensusGroups.GroupApplication.add_consensus_group(:consensus5, 3, config)\n```\n\nNow we can execute a query/command from any cluster node:\n\n```elixir\niex(1@laptop)\u003e RadishDB.ConsensusGroups.GroupApplication.query(:consensus1, :get)\n{:ok, 0}\n\niex(2@laptop)\u003e RadishDB.ConsensusGroups.GroupApplication.command(:consensus1, :inc)\n{:ok, 0}\n\niex(3@laptop)\u003e RadishDB.ConsensusGroups.GroupApplication.query(:consensus1, :get)\n{:ok, 1}\n```\nActivation/deactivation of a node in a cluster triggers a rebalancing of the consensus member processes.\n\nA 3-nodes consensus group continues to operate if one of the members dies (even without deactivation):\n\n```elixir\niex(3@laptop)\u003e :gen_statem.stop(:baz)\niex(1@laptop)\u003e RadishDB.ConsensusGroups.GroupApplication.query(:consensus1, :get)\n{:ok, 1}\n```\n\n## ✅\u0026ensp;Testing \u003ca name=\"testing\"\u003e\u003c/a\u003e\n\nRun tests with:\n```bash\nmix test\n```\n\nFor detailed test output:\n```bash\nmix test --trace\n```\n\nTest coverage is tracked via [Coveralls](https://coveralls.io/github/maxbarsukov/radish-db?branch=master) and shown in the project badges.\n\n## 🎨\u0026ensp;Linting \u003ca name=\"linting\"\u003e\u003c/a\u003e\n\nWe use multiple linting tools:\n\n```bash\n# Format code\nmix format\n\n# Run Credo for code analysis\nmix credo\n\n# Run Dialyzer for type checking\nmix dialyzer\n\n# Run all checks (format, credo, dialyzer)\nmix check\n```\n\nLinting is also automatically run on every commit via GitHub Actions.\n\n---\n\n## 🤝\u0026ensp;Contributing \u003ca name=\"contributing\"\u003e\u003c/a\u003e\n\nNeed help? See [`SUPPORT.md`](./SUPPORT.md).\n\nHey! We're glad you're thinking about contributing to **RadishDB**! Feel free to pick an issue labeled as `good first issue` and ask any question you need. Some points might not be clear, and we are available to help you!\n\nBug reports and pull requests are welcome on GitHub at https://github.com/maxbarsukov/radish-db.\n\nBefore creating your PR, we strongly encourage you to read the repository's corresponding [`CONTRIBUTING.md`](https://github.com/maxbarsukov/radish-db/blob/master/.github/CONTRIBUTING.md) or otherwise the \"Contributing\" section of the [`README.md`](https://github.com/maxbarsukov/radish-db/blob/master/README.md).\n\n## ⚖️\u0026ensp;Code of Conduct \u003ca name=\"code-of-conduct\"\u003e\u003c/a\u003e\n\nThis project is intended to be a safe, welcoming space for collaboration, and everyone interacting in the **RadishDB** project's codebases, issue trackers, chat rooms and mailing lists is expected to adhere to the [code of conduct](https://github.com/maxbarsukov/radish-db/blob/master/.github/CODE_OF_CONDUCT.md).\n\n## 📫\u0026ensp;Get in touch! \u003ca name=\"get-in-touch\"\u003e\u003c/a\u003e\n\n💌 Want to make a suggestion or give feedback? Here are some of the channels where you can reach us:\n\n- Found a bug? [Open an issue]((https://github.com/maxbarsukov/radish-db/issues)) in the repository!\n- Want to be part of our Telegram community? We invite you to join our [RadishDB Community Chat](https://t.me/radishdb), where you can find support from our team and the community, but where you can also share your projects or just talk about random stuff with other members of the RadishDB community 😁!\n\n## 🛡️\u0026ensp;Security \u003ca name=\"security\"\u003e\u003c/a\u003e\n\n**RadishDB** takes the security of our software products and services seriously. If you believe you have found a security vulnerability in any RadishDB-owned repository, please report it to us as described in our [security policy](https://github.com/maxbarsukov/radish-db/security/policy).\n\n---\n\n## 🌐\u0026ensp;Useful Links \u003ca name=\"useful-links\"\u003e\u003c/a\u003e\n\n| Link | Description |\n| --- | --- |\n| [raft.github.io](https://raft.github.io/) | Raft Consensus Algorithm |\n| [raft.github.io/raft.pdf](https://raft.github.io/raft.pdf) | *Original Paper:* In Search of an Understandable Consensus Algorithm (Extended Version) |\n| [habr.com/ru/articles/469999/](https://habr.com/ru/companies/dododev/articles/469999/) | How servers negotiate with each other: Raft distributed consensus algorithm |\n| [thesecretlivesofdata.com/raft/](https://thesecretlivesofdata.com/raft/) \u003cbr\u003e [deniz.co/raft-consensus/](https://deniz.co/raft-consensus/) | Interactive Raft visualizations |\n| [erlang.org/doc/system/distributed.html](https://www.erlang.org/doc/system/distributed.html) | About distributed Erlang systems |\n\n## 🪪\u0026ensp;License \u003ca name=\"license\"\u003e\u003c/a\u003e\n\nThe project is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n**Leave a star :star: if you find this project useful.**\n\n---\n\n*\u003cp align=\"center\"\u003eThis project is published under [MIT](LICENSE).\u003cbr\u003eA [maxbarsukov](https://github.com/maxbarsukov) project.\u003cbr\u003e- :tada: -\u003c/p\u003e*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxbarsukov%2Fradish-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxbarsukov%2Fradish-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxbarsukov%2Fradish-db/lists"}