All Projects → apllodb → apllodb

apllodb / apllodb

Licence: Apache-2.0, MIT licenses found Licenses found Apache-2.0 LICENSE-APACHE MIT LICENSE-MIT
A RDBMS with Immutable Schema feature

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to apllodb

Unchanged
A tiny, fast, unopinionated handler for updating JS objects and arrays immutably
Stars: ✭ 237 (+746.43%)
Mutual labels:  immutable
grand central
State-management and action-dispatching for Ruby apps
Stars: ✭ 20 (-28.57%)
Mutual labels:  immutable
vana
Observe your immutable state trees 🌲👀 (great with React)
Stars: ✭ 24 (-14.29%)
Mutual labels:  immutable
knowledge
Everything that you need. 💡 📚 🔭
Stars: ✭ 26 (-7.14%)
Mutual labels:  rdbms
transmute
kind of like lodash but works with Immutable
Stars: ✭ 35 (+25%)
Mutual labels:  immutable
zbxdb
Zabbix database monitoring, the easy and extendable way
Stars: ✭ 87 (+210.71%)
Mutual labels:  rdbms
Static Frame
Immutable and grow-only Pandas-like DataFrames with a more explicit and consistent interface.
Stars: ✭ 217 (+675%)
Mutual labels:  immutable
js-data-structures
🌿 Data structures for JavaScript
Stars: ✭ 56 (+100%)
Mutual labels:  immutable
Zeko-SQL-Builder
Zeko SQL Builder is a high-performance lightweight SQL query library written for Kotlin language
Stars: ✭ 87 (+210.71%)
Mutual labels:  rdbms
deepClone
A tiny library for deeply copying Javascript objects and arrays
Stars: ✭ 17 (-39.29%)
Mutual labels:  immutable
kotlin-ktor-exposed-sample-api
Kotlin Ktor Exposed SQL Immutable DB Rest API
Stars: ✭ 44 (+57.14%)
Mutual labels:  immutable
SandDB
A simple immutable database for the masses.
Stars: ✭ 21 (-25%)
Mutual labels:  immutable
extendable-immutable
Wrapper classes around Immutable.js that turn it inheritable
Stars: ✭ 58 (+107.14%)
Mutual labels:  immutable
Model
Angular Model - Simple state management with minimalist API, one way data flow, multiple model support and immutable data exposed as RxJS Observable.
Stars: ✭ 242 (+764.29%)
Mutual labels:  immutable
immutable-gametree
An immutable game tree data type.
Stars: ✭ 18 (-35.71%)
Mutual labels:  immutable
Collectable
High-performance immutable data structures for modern JavaScript and TypeScript applications. Functional interfaces, deep/composite operations API, mixed mutability API, TypeScript definitions, ES2015 module exports.
Stars: ✭ 233 (+732.14%)
Mutual labels:  immutable
rrbit
An Immutable vectors/lists/arrays library using the Relaxed Radix Balancing(RRB) technique
Stars: ✭ 12 (-57.14%)
Mutual labels:  immutable
MochaDB
A .NET ACID RDBMS and NoSQL(with mods/tools) database.
Stars: ✭ 19 (-32.14%)
Mutual labels:  rdbms
ConstructionBase.jl
Primitives for construction of objects
Stars: ✭ 22 (-21.43%)
Mutual labels:  immutable
gotoReact-
react的一些案例
Stars: ✭ 20 (-28.57%)
Mutual labels:  immutable

apllodb

MSRV ci codecov License: MIT License: Apache 2.0

apllodb logo

apllodb is a RDBMS purely written in Rust.

It has the following distinguished features:

  • Plugable storage engine:
    • 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).
    • 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.

Also, we have plan to develop the following unique features:

  • Ambiguous data ("about 100 years ago", for example) and query toward them.
  • Algebraic data type as SQL types.

Getting Started

Here shows how to build & run apllodb-cli and execute simple SQLs.

You are supposed to have installed Cargo.

git clone [email protected]:eukarya-inc/apllodb.git

cd apllodb
cargo build

./target/debug/apllodb-cli
🚀🌙 SQL>   # Press Ctrl-D to exit
🚀🌙 SQL> create database my_db;
🚀🌙 SQL> use database my_db;

🚀🌙 SQL> create table t (id integer, name text, primary key (id));
  -- Oops! You need open transaction even for DDL.

🚀🌙 SQL> begin;
🚀🌙 SQL> create table t (id integer, name text, primary key (id));
🚀🌙 SQL> select id, name from t;

0 records in total

🚀🌙 SQL> insert into t (id, name) values (1, "name 1");
🚀🌙 SQL> insert into t (id, name) values (2, "name 2");
🚀🌙 SQL> select id, name from t;
t.id: 2 t.name: "name 2"
t.id: 1 t.name: "name 1"

2 records in total

🚀🌙 SQL> commit;

Try Immutable Schema

Current core feature of apllodb is Immutable Schema. Immutable Schema consists of Immutable DDL and Immutable DML.

With Immutable DDL, any kind of ALTER TABLE or DROP TABLE succeed without modifying existing records. For example, if t has 1 or more records,

ALTER TABLE t ADD COLUMN c_new INTEGER NOT NULL;

would cause error in many RDMBSs because existing records cannot be NULL but this ALTER does not specify default value for c_new.

Immutable Schema preserves existing records in an old version and creates new version.

 t (version1)
| id | c_old |
|----|-------|
|  1 | "a"   |
|  2 | "b"   |

ALTER TABLE t ADD COLUMN c_new INTEGER NOT NULL;

 t (version1)    t (version2) 
| id | c_old |  | id | c_old | c_new |
|----|-------|  |----|-------|-------|
|  1 | "a"   |
|  2 | "b"   |

INSERT INTO t (id, c_old, c_new) VALUES (3, "c", 42);

 t (version1)    t (version2) 
| id | c_old |  | id | c_old | c_new |
|----|-------|  |----|-------|-------|
|  1 | "a"   |  |  3 |   "c" |    42 |
|  2 | "b"   |

INSERT INTO t (id, c_old) VALUES (4, "d");

 t (version1)    t (version2) 
| id | c_old |  | id | c_old | c_new |
|----|-------|  |----|-------|-------|
|  1 | "a"   |  |  3 |   "c" |    42 |
|  2 | "b"   |
|  4 | "d"   |

As the above example shows, DML like INSERT automatically choose appropriate version to modify.

To learn more about Immutable Schema, check this slide (Japanese version).

Currently, both Immutable DDL and Immutable DML are under development and some SQLs do not work as expected. doc/immutable-ddl-demo.sql is a working example of Immutable DDL. Try it by copy-and-paste to apllodb-cli.

Development

This repository is a multi-package project.

Many useful tasks for development are defined in Makefile.toml. Install cargo-make to participate in apllodb's development.

# (clone repository)

cd apllodb
cargo make test

# (write your code)
cargo make build
cargo make test

# (before making pull-request)
cargo make format
cargo make lint

# (generate rustdoc)
cargo make doc

Architecture

We refer to "Architecture of a Database System" to set boundaries between each components (crates).

The following diagram, similarly illustrated to Fig. 1.1 of the paper, shows sub-crates and their rolls. (Box with gray text are unimplemented roles)

apllodb's Architecture (src: https://www.figma.com/file/9pBZXpEHkA8rtSH7w1Itqi/apllodb's-Architecture?node-id=1%3A2&viewport=552%2C484%2C0.7679687738418579)

Entry points in apllodb-server, apllodb-sql-processor, and apllodb-storage-engine-interface are async functions so clients can run multiple SQLs at a time.

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.

Currently, 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. Also, apllodb-cli works as single-process database. apllodb-server currently does not run solely.

Of course we have plan to:

  • Split server and client.
  • Provides client library for programming languages (Rust binding may be the first one).

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in apllodb by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].