From b6f23b1145c8a669f9da1c000b659a24ff88356f Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Thu, 6 Jun 2024 00:16:59 +0200 Subject: [PATCH] chore(kb): start articles for dblab --- knowledge base/database lab.md | 63 ++++++++++++++++++++++++++++++++ knowledge base/dblab.md | 67 ++++++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+) create mode 100644 knowledge base/database lab.md create mode 100644 knowledge base/dblab.md diff --git a/knowledge base/database lab.md b/knowledge base/database lab.md new file mode 100644 index 0000000..af3c5df --- /dev/null +++ b/knowledge base/database lab.md @@ -0,0 +1,63 @@ +# Database Lab + +Database Lab Engine is an open-source platform developed by Postgres.ai to create instant, full-size clones of +production databases.
+Use cases of the clones are to test database migrations, optimize SQL, or deploy full-size staging apps. + +The website hosts the SaaS version of the Database Lab Engine. + +1. [Clones](#clones) +1. [Further readings](#further-readings) + 1. [Sources](#sources) + +## Clones + +Database clones comes in two flavours: + +- _Thick_ cloning: the regular way to copy data.
+ It is also how data is copied to Database Lab the first time a source is added. + + Thick clones can be: + + - _Logical_: do a regular dump and restore using `pg_dump` and `pg_restore`. + - _Physical_: done using `pg_basebackup` or restoring data from physical archives created by backup tools such as + WAL-E/WAL-G, Barman, pgBackRest, or pg_probackup. + + > Managed PostgreSQL databases in cloud environments (e.g.: AWS RDS) support only the logical clone type. + + The Engine supports continuous synchronization with the source databases.
+ Achieved by repeating the thick cloning method one initially used for the source. + +- _Thin_ cloning: local containerized database clones based on CoW (Copy-on-Write) spin up in few seconds.
+ They share most of the data blocks, but logically they look fully independent.
+ The speed of thin cloning does **not** depend on the database size. + + As of 2024-06, Database Lab Engine supports ZFS and LVM for thin cloning.
+ With ZFS, the Engine periodically creates a new snapshot of the data directory and maintains a set of snapshots. When + requesting a new clone, users choose which snapshot to use as base. + +## Further readings + +- [Website] +- [Main repository] +- [Documentation] +- [`dblab`][dblab] + +### Sources + + + + + +[dblab]: dblab.md + + + +[documentation]: https://postgres.ai/docs/ +[main repository]: https://gitlab.com/postgres-ai/database-lab +[website]: https://postgres.ai/ + + diff --git a/knowledge base/dblab.md b/knowledge base/dblab.md new file mode 100644 index 0000000..383b57c --- /dev/null +++ b/knowledge base/dblab.md @@ -0,0 +1,67 @@ +# `dblab` + +Database Lab Engine client CLI. + +1. [TL;DR](#tldr) +1. [Further readings](#further-readings) + 1. [Sources](#sources) + +## TL;DR + +
+ Installation and configuration + +```sh +# Initialize CLI configuration. +# Assumes that 'localhost:2345' forwards to the Database Lab Engine machine's at port 2345'. +dblab init --environment-id 'tutorial' --url 'http://localhost:2345' --token 'secret_token' --insecure +``` + +
+ +
+ Usage + +```sh +# Fetch the status of the Engine's instance. +dblab instance status + +# Create clones. +dblab clone create --username 'dblab_user_1' --password 'secret_password' --id 'my_first_clone' +``` + +
+ + + +## Further readings + +- [Database Lab] +- [Website] +- [Main repository] + +### Sources + + + + + +[database lab]: database%20lab.md + + + +[main repository]: https://github.com/project/ +[website]: https://website/ + +