{"id":13672262,"url":"https://github.com/apllodb/apllodb","last_synced_at":"2025-04-27T21:32:31.816Z","repository":{"id":47151398,"uuid":"168480917","full_name":"apllodb/apllodb","owner":"apllodb","description":"A RDBMS with Immutable Schema feature","archived":false,"fork":false,"pushed_at":"2021-10-13T09:50:10.000Z","size":1228,"stargazers_count":33,"open_issues_count":20,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-11T10:42:20.148Z","etag":null,"topics":["database","immutable","rdbms","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apllodb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-31T07:18:00.000Z","updated_at":"2024-03-19T18:26:33.000Z","dependencies_parsed_at":"2022-08-20T17:21:05.742Z","dependency_job_id":null,"html_url":"https://github.com/apllodb/apllodb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apllodb%2Fapllodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apllodb%2Fapllodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apllodb%2Fapllodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apllodb%2Fapllodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apllodb","download_url":"https://codeload.github.com/apllodb/apllodb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251212527,"owners_count":21553477,"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","immutable","rdbms","rust"],"created_at":"2024-08-02T09:01:30.692Z","updated_at":"2025-04-27T21:32:31.324Z","avatar_url":"https://github.com/apllodb.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# apllodb\n\n![MSRV](https://img.shields.io/badge/rustc-1.51+-lightgray.svg)\n[![ci](https://github.com/apllodb/apllodb/actions/workflows/ci.yml/badge.svg?branch=main\u0026event=push)](https://github.com/apllodb/apllodb/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/apllodb/apllodb/branch/main/graph/badge.svg?token=621C0ARVUD)](https://codecov.io/gh/apllodb/apllodb)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/apllodb/apllodb/blob/main/LICENSE-MIT)\n[![License: Apache 2.0](https://img.shields.io/badge/license-Apache_2.0-blue.svg)](https://github.com/apllodb/apllodb/blob/main/LICENSE-APACHE)\n\n![apllodb logo](./doc/apllodb_logo_white.png)\n\napllodb is a RDBMS purely written in Rust.\n\nIt has the following distinguished features:\n\n- **Plugable storage engine:**\n  - Implementing apllodb's storage engine is unambiguous. Your storage engine crate just depends on `apllodb-storage-engine-interface` crate and implements `StorageEngine` trait (and its associated types).\n  - apllodb's default storage engine is **Immutable Schema** Engine (`apllodb-immutable-schema-engine`). This engine never deletes / requires to delete old records on `UPDATE`, `DELETE`, even on `ALTER TABLE` and `DROP TABLE`.\n\nAlso, we have plan to develop the following unique features:\n\n- Ambiguous data (\"about 100 years ago\", for example) and query toward them.\n- Algebraic data type as SQL types.\n\n## Getting Started\n\nHere shows how to build \u0026 run `apllodb-cli` and execute simple SQLs.\n\nYou are supposed to have installed [Cargo](https://github.com/rust-lang/cargo).\n\n```bash\ngit clone git@github.com:eukarya-inc/apllodb.git\n\ncd apllodb\ncargo build\n\n./target/debug/apllodb-cli\n🚀🌙 SQL\u003e   # Press Ctrl-D to exit\n```\n\n```sql\n🚀🌙 SQL\u003e create database my_db;\n🚀🌙 SQL\u003e use database my_db;\n\n🚀🌙 SQL\u003e create table t (id integer, name text, primary key (id));\n  -- Oops! You need open transaction even for DDL.\n\n🚀🌙 SQL\u003e begin;\n🚀🌙 SQL\u003e create table t (id integer, name text, primary key (id));\n🚀🌙 SQL\u003e select id, name from t;\n\n0 records in total\n\n🚀🌙 SQL\u003e insert into t (id, name) values (1, \"name 1\");\n🚀🌙 SQL\u003e insert into t (id, name) values (2, \"name 2\");\n🚀🌙 SQL\u003e select id, name from t;\nt.id: 2 t.name: \"name 2\"\nt.id: 1 t.name: \"name 1\"\n\n2 records in total\n\n🚀🌙 SQL\u003e commit;\n```\n\n## Try Immutable Schema\n\nCurrent core feature of apllodb is **Immutable Schema**.\nImmutable Schema consists of Immutable **DDL** and Immutable **DML**.\n\nWith Immutable DDL, any kind of `ALTER TABLE` or `DROP TABLE` succeed without modifying existing records.\nFor example, if `t` has 1 or more records,\n\n```sql\nALTER TABLE t ADD COLUMN c_new INTEGER NOT NULL;\n```\n\nwould cause error in many RDMBSs because existing records cannot be NULL but this ALTER does not specify default value for `c_new`.\n\nImmutable Schema preserves existing records in an old **version** and creates new version.\n\n```sql\n t (version1)\n| id | c_old |\n|----|-------|\n|  1 | \"a\"   |\n|  2 | \"b\"   |\n\nALTER TABLE t ADD COLUMN c_new INTEGER NOT NULL;\n\n t (version1)    t (version2) \n| id | c_old |  | id | c_old | c_new |\n|----|-------|  |----|-------|-------|\n|  1 | \"a\"   |\n|  2 | \"b\"   |\n\nINSERT INTO t (id, c_old, c_new) VALUES (3, \"c\", 42);\n\n t (version1)    t (version2) \n| id | c_old |  | id | c_old | c_new |\n|----|-------|  |----|-------|-------|\n|  1 | \"a\"   |  |  3 |   \"c\" |    42 |\n|  2 | \"b\"   |\n\nINSERT INTO t (id, c_old) VALUES (4, \"d\");\n\n t (version1)    t (version2) \n| id | c_old |  | id | c_old | c_new |\n|----|-------|  |----|-------|-------|\n|  1 | \"a\"   |  |  3 |   \"c\" |    42 |\n|  2 | \"b\"   |\n|  4 | \"d\"   |\n```\n\nAs the above example shows, DML like `INSERT` automatically choose appropriate version to modify.\n\nTo learn more about Immutable Schema, check [this slide](https://docs.google.com/presentation/d/1C6YsUNfMb4cioc2KWMwO2-85IpNfq558-IjxJh6LvPg/edit?usp=sharing) ([Japanese version](https://docs.google.com/presentation/d/1pV287_Q5LDbY9GWn3lK1iJdFz9rTnMsbmQ0a98YUY90/edit?usp=sharing)).\n\nCurrently, both Immutable DDL and Immutable DML are under development and some SQLs do not work as expected.\n[doc/immutable-ddl-demo.sql](doc/immutable-ddl-demo.sql) is a working example of Immutable DDL. Try it by copy-and-paste to `apllodb-cli`.\n\n## Development\n\nThis repository is a [multi-package project](https://doc.rust-lang.org/edition-guide/rust-2018/cargo-and-crates-io/cargo-workspaces-for-multi-package-projects.html).\n\nMany useful tasks for development are defined in `Makefile.toml`. Install [cargo-make](https://github.com/sagiegurari/cargo-make) to participate in apllodb's development.\n\n```bash\n# (clone repository)\n\ncd apllodb\ncargo make test\n\n# (write your code)\ncargo make build\ncargo make test\n\n# (before making pull-request)\ncargo make format\ncargo make lint\n\n# (generate rustdoc)\ncargo make doc\n```\n\n## Architecture\n\nWe refer to [\"Architecture of a Database System\"](https://dsf.berkeley.edu/papers/fntdb07-architecture.pdf) to set boundaries between each components (crates).\n\nThe following diagram, similarly illustrated to Fig. 1.1 of the paper, shows sub-crates and their rolls.\n(Box with gray text are unimplemented roles)\n\n![apllodb's Architecture (src: https://www.figma.com/file/9pBZXpEHkA8rtSH7w1Itqi/apllodb's-Architecture?node-id=1%3A2\u0026viewport=552%2C484%2C0.7679687738418579)](./doc/apllodb-architecture.svg)\n\nEntry points in `apllodb-server`, `apllodb-sql-processor`, and `apllodb-storage-engine-interface` are **async** functions so clients can run multiple SQLs at a time.\n\n`apllodb-server` is the component to choose storage engine to use. `apllodb-immutable-schema-engine::ApllodbImmutableSchemaEngine` is specified at compile-time (as type parameter) for now.\n\nCurrently, apllodb has a single client; `apllodb-cli`. `apllodb-cli` runs from a shell, takes SQL text from stdin, and outputs query result records (or error messages) to stdout/stderr.\nAlso, `apllodb-cli` works as single-process database. `apllodb-server` currently does not run solely.\n\nOf course we have plan to:\n\n- Split server and client.\n- Provides client library for programming languages (Rust binding may be the first one).\n\n## License\n\nLicensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT) at your option.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in apllodb by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapllodb%2Fapllodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapllodb%2Fapllodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapllodb%2Fapllodb/lists"}