base on OrioleDB β building a modern cloud-native storage engine (... and solving some PostgreSQL wicked problems) Β πΊπ¦ # OrioleDB β building a modern cloud-native storage engine
(... and solving some PostgreSQL wicked problems)
[![build status](https://github.com/orioledb/orioledb/actions/workflows/build.yml/badge.svg)](https://github.com/orioledb/orioledb/actions)
[![codecov](https://codecov.io/gh/orioledb/orioledb/branch/main/graph/badge.svg?token=shh4jn0DUK)](https://codecov.io/gh/orioledb/orioledb) [![dockerhub](https://github.com/orioledb/orioledb/actions/workflows/docker.yml/badge.svg)](https://hub.docker.com/r/orioledb/orioledb/tags)
OrioleDB is a new storage engine for PostgreSQL, bringing a modern approach to
database capacity, capabilities and performance to the world's most-loved
database platform.
OrioleDB consists of an extension, building on the innovative table access
method framework and other standard Postgres extension interfaces. By extending
and enhancing the current table access methods, OrioleDB opens the door to
a future of more powerful storage models that are optimized for cloud and
modern hardware architectures.
OrioleDB is currently distributed under the standard PostgreSQL license.
1. Designed for modern hardware. OrioleDB design avoids legacy CPU bottlenecks
on modern servers containing dozens and hundreds CPU cores, providing
optimized usage of modern storage technologies such as SSD and NVRAM.
2. Reduced maintenance needs. OrioleDB implements the concepts of undo log
and page-mergins, eliminating the need for dedicated garbage collection
processes. Additionally, OrioleDB implements default 64-bit transaction
identifiers, thus eliminating the well-known and painful wraparound problem.
3. Designed to be distributed. OrioleDB implements a row-level write-ahead
log with support for parallel apply. This log architecture is optimized
for raft consensus-based replication allowing the implementation of
active-active multimaster.
The key technical differentiations of OrioleDB are as follows:
1. No buffer mapping and lock-less page reading. In-memory pages in OrioleDB
are connected with direct links to the storage pages. This eliminates the
need for in-buffer mapping along with its related bottlenecks. Additionally,
in OrioleDB in-memory page reading doesn't involve atomic operations.
Together, these design decisions bring vertical scalability for Postgres
to the whole new level.
2. MVCC is based on the UNDO log concept. In OrioleDB, old versions of tuples
do not cause bloat in the main storage system, but eviction into the undo
log comprising undo chains. Page-level undo records allow the system
to easily reclaim space occupied by deleted tuples as soon as possible.
Together with page-mergins, these mechanisms eliminate bloat in the majority
of cases. Dedicated VACUUMing of tables is not needed as well, removing
a significant and common cause of system performance deterioration and
database outages.
3. Copy-on-write checkpoints and row-level WAL. OrioleDB utilizes
copy-on-write checkpoints, which provides a structurally consistent snapshot
of data every moment of time. This is friendly for modern SSDs and allows
row-level WAL logging. In turn, row-level WAL logging is easy to
parallelize (done), compact and suitable for active-active
multimaster (planned).
See [introduction](doc/intro.mdx), [getting started](doc/usage/getting-started.mdx), and [architecture](doc/architecture/overview.mdx)
documentation as well as
[PostgresBuild 2021 slides](https://www.slideshare.net/AlexanderKorotkov/solving-postgresql-wicked-problems). To start the development see [OrioleDB development quickstart](doc/contributing/local-builds.mdx), and [project structure](doc/contributing/structure.mdx).
## Status
OrioleDB now has public beta status. It is recommended for experiments,
testing, benchmarking, etc., but is not recommended for production usage.
If you are interested in OrioleDB's benefits in production, please
[contact us](mailto:
[email protected]).
## Installation
### Use docker container
We provide docker images for `amd64` and `arm64v8` architectures under Alpine Linux.
```
docker pull orioledb/orioledb:latest-pg16
```
For example it can be started same as postgres server:
```bash
# !Don't forget to set default locale to C, POSIX or use icu-locale
docker run --name some-postgres -e POSTGRES_PASSWORD=... -e POSTGRES_INITDB_ARGS="--locale=C" -d -p5432:5432 orioledb/orioledb:latest-pg16
```
See [our dockerhub](https://hub.docker.com/r/orioledb/orioledb) for details on our docker container usage. See [the docker build guide](doc/contributing/docker-builds.mdx) for information on how to build the docker images locally.
### Build from source
Before building and installing OrioleDB, one should ensure to have the following:
* [PostgreSQL with extensibility patches](https://github.com/orioledb/postgres): [16 (tag: patches16_33)](https://github.com/orioledb/postgres/tree/patches16_33) or [17 (tag: patches17_5)](https://github.com/orioledb/postgres/tree/patches17_5);
* Development package of libzstd;
* python 3.5+ with testgres package.
Typical installation procedure may look like this:
```bash
$ git clone https://github.com/orioledb/orioledb
$ cd orioledb
# Make sure that postgres bin directory is in PATH before running
$ make USE_PGXS=1
# IS_DEV=1 needed for tests to success
$ make USE_PGXS=1 install IS_DEV=1
$ make USE_PGXS=1 installcheck
```
Before starting working with OrioleDB, adding the following line to
`postgresql.conf` is required. This change requires a restart of
the PostgreSQL database server.
```
shared_preload_libraries = 'orioledb.so'
```
## Collations
OrioleDB tables support only ICU, C, and POSIX collations.
So that you don't have to write COLLATE for every "text" field of tables you have options:
### Create whole cluster with one of these collations:
```bash
initdb --locale=C -D..
# OR
initdb --locale=POSIX -D..
# OR
initdb --locale-provider=icu --icu-locale=en -D...
```
### Create new database with default collation from template0
```bash
createdb --locale=C --template template0 ...
# OR
createdb --locale=POSIX --template template0 ...
# OR
createdb --locale-provider=icu --icu-locale=en --template template0 ...
```
Or using `CREATE DATABASE` with `LOCALE` or `ICU_LOCALE` parameters.
## Setup
Run the following SQL query on the database to enable the OrioleDB engine.
```sql
CREATE EXTENSION orioledb;
```
Once the above steps are complete, you can start using OrioleDB's tables.
See [getting started](doc/usage/getting-started.mdx) documentation for details.
```sql
CREATE TABLE table_name (...) USING orioledb;
```
", Assign "at most 3 tags" to the expected json: {"id":"12381","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"