{"id":25118971,"url":"https://github.com/micartey/elixir-distributed-database","last_synced_at":"2026-04-28T20:03:21.073Z","repository":{"id":276195653,"uuid":"900124663","full_name":"micartey/elixir-distributed-database","owner":"micartey","description":"Elixir distributed database (eddb) with optimistic locking and data synchronization","archived":false,"fork":false,"pushed_at":"2026-01-25T01:45:22.000Z","size":72,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-16T16:43:30.705Z","etag":null,"topics":["database","dirstributed","elixir"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/micartey.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-07T23:29:13.000Z","updated_at":"2026-01-25T01:45:25.000Z","dependencies_parsed_at":"2025-02-06T20:34:42.937Z","dependency_job_id":"e30a9e46-5be7-4ffe-8590-4a804f4862fd","html_url":"https://github.com/micartey/elixir-distributed-database","commit_stats":null,"previous_names":["micartey/elixir-distributed-database"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/micartey/elixir-distributed-database","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micartey%2Felixir-distributed-database","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micartey%2Felixir-distributed-database/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micartey%2Felixir-distributed-database/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micartey%2Felixir-distributed-database/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/micartey","download_url":"https://codeload.github.com/micartey/elixir-distributed-database/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micartey%2Felixir-distributed-database/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32385943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"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":["database","dirstributed","elixir"],"created_at":"2025-02-08T04:23:36.133Z","updated_at":"2026-04-28T20:03:21.068Z","avatar_url":"https://github.com/micartey.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Eddb\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Written%20in-elixir-%238238ab?style=for-the-badge\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Hex.pm-eddb-%235764c9?style=for-the-badge\" /\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n`eddb` is a distributed database for unstructured data\n\n## Getting Started\n\nThe database can be used in two ways.\nYou either add it as a dependency or you run it bare bones for a simple distributed key-value store.\n\n```bash\nMIX_ENV=prod mix release --overwrite\n```\n\nFirst you need to build the database (this is a very quick process, but you need `mix` installed).\nThen you can start the database, but make sure to set a `JWT` secret beforehand!\n\n```bash\nexport RELEASE_NODE=node1@vpn-ip-address  # Identifier for the node to connect to - this value shall be unique \nexport RELEASE_COOKIE=\"your-cookie-value\" # Set a shared cookie so that all nodes can connect together\nexport JWT_SECRET=ahjsdjajdjkahkjdhasd    # Set a shared JWT secret so that all nodes can decypther the token\n_build/prod/rel/eddb/bin/eddb start\n```\n\nThe instance will be running, but you cannot interact with it directly from the terminal.\nFor that you will need to open a _remote_ session next to it:\n\n```bash\n_build/prod/rel/eddb/bin/eddb remote\n```\n\nThis is the terminal session you can use to interact with the database.\n\n### Create User\n\nThere is no default user initialized.\nThat means you need to create one yourself:\n\n```ex\niex(eddb@localhost)1\u003e user_create \"root\", \"MyVerySecretPassword\", :ADMIN\n```\n\nThere are 3 different permission levels:\n\n| Permission | Description                                   |\n| ---------- | --------------------------------------------- |\n| `:ADMIN`   | Have read and write access to all topics      |\n| `:READ`    | Have read access to selected topics           |\n| `:WRITE`   | Have read and write access to selected topics |\n\nAs you can see, there is access control for _selected topics_.\nYou can add access to a topic for a user using the following command:\n\n```ex\niex(eddb@localhost)1\u003e add_topic_to_user \"USERNAME\", \"TOPIC\"\n```\n\n## Connect to other nodes\n\n\u003e [!WARNING]  \n\u003e \n\u003e This is a WIP, meaning it works perfectly fine, but it is currently fairly complicated to build the mesh of nodes.\n\u003e This guide will be improved in the future with qol improvements.\n\nThis is a distributed database and as such it is also necessary to connect mutliple nodes together.\n\n```bash\niex(eddb@localhost)1\u003e Node.connect :\"node1@vps1\"\n```\n\n## REST-Endpoints\n\nHere is a collection of `REST` endpoints to use the database.\nI urge you to try them out to get familiar with the data, what is returned and how.\n\n### Auth\n\nThe `auth` endpoint will return a `JWT` secret which you need to use for all other endpoints to authenticate.\nAs the secret for that token shall be the same on all nodes, it shouldn't matter on which node you call the endpoints.\n\n```bash\nexport TOKEN=$(curl -X POST \"http://localhost:5342/auth\" -d '{\"username\": \"root\", \"password\": \"MyVerySecretPassword\"}' | jq -r .token)\n```\n\n_(The token will be valid for 2 hours)_\n\n### Put\n\n```bash\ncurl -X PUT \"http://localhost:5342/put\" \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -d '{\n    \"topic\": \"test_topic\", \n    \"key\": \"asdasd\", \n    \"value\": \"value\"\n  }'\n```\n\nAdding a field `old_value` provides you with the ability to use optimistic locking.\n\n### Get\n\n```bash\ncurl \"http://localhost:5342/get?topic=test_topic\u0026key=asdasd\" \\\n  -H \"Authorization: Bearer $TOKEN\"\n```\n\n### Delete\n\n\u003e [!CAUTION]\n\u003e \n\u003e There are currently no delete capabilities using REST.\n\u003e\n\u003e Please delete a topic manually from the console using `delete_topic`.\n\u003e Make sure that **all nodes are connected** or else the topic will be replaced and **not** deleted!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicartey%2Felixir-distributed-database","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicartey%2Felixir-distributed-database","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicartey%2Felixir-distributed-database/lists"}