{"id":50675792,"url":"https://github.com/keys-i/radb","last_synced_at":"2026-06-08T15:33:29.087Z","repository":{"id":231552606,"uuid":"782071004","full_name":"keys-i/radb","owner":"keys-i","description":"A Distributed SQL Database written in Rust","archived":false,"fork":false,"pushed_at":"2026-02-25T03:15:45.000Z","size":762,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-05T12:29:03.007Z","etag":null,"topics":["consensus-algorithm","distributed-database","high-availability","raft","rust-lang","scalable-database","sqldatabase","transactional-storage"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/keys-i.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}},"created_at":"2024-04-04T15:27:24.000Z","updated_at":"2026-02-25T03:15:49.000Z","dependencies_parsed_at":"2024-04-04T15:59:15.978Z","dependency_job_id":"4ae02ae3-f4b7-4d19-a92c-75177d226a83","html_url":"https://github.com/keys-i/radb","commit_stats":null,"previous_names":["radhesh1/radb","kernelturtle/radb","keys-i/radb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/keys-i/radb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keys-i%2Fradb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keys-i%2Fradb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keys-i%2Fradb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keys-i%2Fradb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keys-i","download_url":"https://codeload.github.com/keys-i/radb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keys-i%2Fradb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34069494,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["consensus-algorithm","distributed-database","high-availability","raft","rust-lang","scalable-database","sqldatabase","transactional-storage"],"created_at":"2026-06-08T15:33:27.950Z","updated_at":"2026-06-08T15:33:29.077Z","avatar_url":"https://github.com/keys-i.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# raDB\n\n[![CI](https://github.com/radhesh1/radb/actions/workflows/ci.yml/badge.svg)](https://github.com/erikgrinaker/radb/actions/workflows/ci.yml)\n[![Release](https://github.com/keys-i/radb/actions/workflows/release.yml/badge.svg)](https://github.com/keys-i/radb/actions/workflows/release.yml)\n\n\nDistributed SQL database in Rust, written as a learning project. Most components are built from\nscratch, including:\n\n* Raft-based distributed consensus engine for linearizable state machine replication.\n\n* ACID-compliant transaction engine with MVCC-based snapshot isolation.\n\n* Pluggable storage engine with BitCask and in-memory backends.\n\n* Iterator-based query engine with heuristic optimization and time-travel support.\n\n* SQL interface including projections, filters, joins, aggregates, and transactions.\n\nraDB is not suitable for real-world use, but may be of interest to others learning about\ndatabase internals.\n\n## Documentation\n\n* [Architecture guide](docs/architecture.md): a guide to raDB's architecture and implementation.\n\n* [SQL examples](docs/examples.md): comprehensive examples of raDB's SQL features.\n\n* [SQL reference](docs/sql.md): detailed reference documentation for raDB's SQL dialect.\n\n* [References](docs/references.md): books and other research material used while building raDB.\n\n## \u003cspan class=\"texcenter\"\u003e\n$$\nUsage\n$$\n\u003c/span\u003e\n\nWith a [Rust compiler](https://www.rust-lang.org/tools/install) installed, a local five-node\ncluster can be started on `localhost` ports `9601` to `9605`:\n\n```\n$ (cd clusters/local \u0026\u0026 ./run.sh)\n```\n\nA command-line client can be built and used with the node on `localhost` port `9605`:\n\n```\n$ cargo run --release --bin rasql\nConnected to raDB node \"radb-e\". Enter !help for instructions.\nradb\u003e CREATE TABLE movies (id INTEGER PRIMARY KEY, title VARCHAR NOT NULL);\nradb\u003e INSERT INTO movies VALUES (1, 'Sicario'), (2, 'Stalker'), (3, 'Her');\nradb\u003e SELECT * FROM movies;\n1|Sicario\n2|Stalker\n3|Her\n```\n\nraDB supports most common SQL features, including joins, aggregates, and ACID transactions.\n\n## Architecture\n\n[![raDB architecture](docs/images/architecture.svg)](./docs/architecture.md)\n\nraDB's architecture is fairly typical for distributed SQL databases: a transactional\nkey/value store managed by a Raft cluster with a SQL query engine on top. See the\n[architecture guide](./docs/architecture.md) for more details.\n\n## Tests\n\nraDB has decent test coverage, with about a thousand tests of core functionality. These consist\nof in-code unit-tests for many low-level components, golden master integration tests of the SQL\nengine under [`tests/sql`](./tests/sql), and a\nbasic set of end-to-end cluster tests under\n[`tests/`](../tests).\n[Jepsen tests](https://jepsen.io), or similar system-wide correctness and reliability tests, are\ndesirable but not yet implemented.\n\nExecute `cargo test` to run all tests, or check out the latest\n[CI run](https://github.com/radhesh1/radb/actions/workflows/ci.yml).\n\n## Performance\n\nPerformance is not a primary goal of raDB, but it has a bank simulation as a basic gauge of\nthroughput and correctness. This creates a set of customers and accounts, and spawns several\nconcurrent workers that make random transfers between them, retrying serialization failures and\nverifying invariants:\n\n```sh\n$ cargo run --release --bin bank\nCreated 100 customers (1000 accounts) in 0.123s\nVerified that total balance is 100000 with no negative balances\n\nThread 0 transferred   18 from  92 (0911) to 100 (0994) in 0.007s (1 attempts)\nThread 1 transferred   84 from  61 (0601) to  85 (0843) in 0.007s (1 attempts)\nThread 3 transferred   15 from  40 (0393) to  62 (0614) in 0.007s (1 attempts)\n[...]\nThread 6 transferred   48 from  78 (0777) to  52 (0513) in 0.004s (1 attempts)\nThread 3 transferred   57 from  93 (0921) to  19 (0188) in 0.065s (2 attempts)\nThread 4 transferred   70 from  35 (0347) to  49 (0484) in 0.068s (2 attempts)\n\nRan 1000 transactions in 0.937s (1067.691/s)\nVerified that total balance is 100000 with no negative balances\n```\n\nThe informal target was 100 transactions per second, and these results exceed that by an order\nof magnitude. For an unoptimized implementation, this is certainly \"good enough\". However, this\nis with a single node and fsync disabled - the table below shows results for other configurations,\nrevealing clear potential for improvement:\n\n|             | `sync: false` | `sync: true` |\n|-------------|---------------|--------------|\n| **1 node**  | 1067 txn/s    | 38 txn/s     |\n| **5 nodes** | 417 txn/s     | 19 txn/s     |\n\nNote that each transaction consists of six statements, including joins, not just a single update:\n\n```sql\nBEGIN;\n\n-- Find the sender account with the highest balance\nSELECT a.id, a.balance\nFROM account a JOIN customer c ON a.customer_id = c.id\nWHERE c.id = {sender}\nORDER BY a.balance DESC\nLIMIT 1;\n\n-- Find the receiver account with the lowest balance\nSELECT a.id, a.balance\nFROM account a JOIN customer c ON a.customer_id = c.id\nWHERE c.id = {receiver}\nORDER BY a.balance ASC\nLIMIT 1;\n\n-- Transfer a random amount within the sender's balance to the receiver\nUPDATE account SET balance = balance - {amount} WHERE id = {source};\nUPDATE account SET balance = balance + {amount} WHERE id = {destination};\n\nCOMMIT;\n```\n\n## Debugging\n\n[VSCode](https://code.visualstudio.com) provides a very intuitive environment for debugging raDB.\nThe debug configuration is included under `.vscode/launch.json`. Follow these steps to set it up:\n\n1. Install the [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb)\n   extension.\n\n2. Go to \"Run and Debug\" tab and select e.g. \"Debug unit tests in library 'radb'\".\n\n3. To debug the binary, select \"Debug executable 'radb'\" under \"Run and Debug\".\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeys-i%2Fradb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeys-i%2Fradb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeys-i%2Fradb/lists"}