You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Database Lab allows superfast cloning of large databases to solve the following problems:
4
+
Database Lab Engine is an opens-source technology that allows blazing-fast cloning of Postgres databases of any size in seconds. This helps solve many problems such as:
5
+
- help build dev/QA/staging environments involving full-size production-like databases,
6
+
- provide temporary full-size database clones for SQL query analysis optimization (see
7
+
[Joe bot](https://gitlab.com/postgres-ai/joe)),
8
+
- automatically verify database migrations (DB schema changes) and massive data operations to avoid downtime and performance bottlenecks.
5
9
6
-
- help build development and testing environments involving full-size database,
7
-
- provide temporary full-size database clones for SQL query optimization (see also:
8
-
[Joe bot](https://gitlab.com/postgres-ai/joe), which works on top of Database Lab),
9
-
- help verify database migrations (DB schema changes) and massive data operations.
10
+
As an example, cloning of 10 TiB PostgreSQL database takes less than 2 seconds.
10
11
11
-
As an example, the cloning of 10 TiB PostgreSQL database takes less than 2 seconds.
12
+
Read more at [Postgres.ai](https://postgres.ai) and in [the Docs](https://postgres.ai/docs).
12
13
13
-
In rapidly developing businesses, excellent production health requires powerful non-production environments.
14
-
With Database Lab, provisioning of multi-terabyte database clones doesn't imply much
15
-
waiting time or extra budgets spent anymore. Therefore, Database Lab gives necessary power to developers, DBAs,
16
-
and QA engineers, boosting development and testing processes.
14
+
## Why on GitLab.com?
15
+
Database Lab Engine is hosted and developed on GitLab.com.
17
16
17
+
GitLab Inc. is our (Postgres.ai) long-term client and early adopter (see [GitLab Development Docs](https://docs.gitlab.com/ee/development/understanding_explain_plans.html#database-lab)). GitLab is open-source. Last but not least: GitLab uses PostgreSQL.
18
18
19
-
## Status
20
-
21
-
The project is in its early stage. However, it is already being extensively used
22
-
in some teams in their daily work. Since production is not involved, it is
23
-
quite easy to try and start using it.
24
-
25
-
Please support the project giving a GitLab star (it's on [the main page](https://gitlab.com/postgres-ai/database-lab),
26
-
at the upper right corner):
19
+
However, nowadays, not many open-source projects are hosted at GitLab.com unfortunately. Please support the project giving a GitLab star! It's on [the main page](https://gitlab.com/postgres-ai/database-lab), at the upper right corner:
27
20
28
21

29
22
30
-
To discuss Database Lab, try a demo, or ask any questions,
31
-
[join our community Slack](https://database-lab-team-slack-invite.herokuapp.com/).
32
-
33
-
34
-
## Usage examples
35
-
- Perform SQL optimization in a convenient way (see [postgres-ai/joe](https://gitlab.com/postgres-ai/joe))
36
-
- Check database schema changes (database migrations) on full-sized database clones using Database Lab in CI (see [postgres-ai/ci-example](https://gitlab.com/postgres-ai/ci-example))
37
-
38
-
39
-
## Workflow overview and requirements
40
-
41
-
**TL;DR:** you need:
42
-
- any machine with a separate disk that is big enough to store a single copy of your database,
43
-
- Linux with Docker,
44
-
- ZFS to enable thin cloning (the default option; also, LVM is supported as an alternative),
45
-
- initial copy of your Postgres database.
46
-
47
-
Details:
48
-
- for each Database Lab instance, a separate machine (either physical or virtual) is needed,
49
-
- both on-premise and cloud setups are possible,
50
-
- for each Postgres cluster (a single Postgres server with databases), a separate Database Lab instance is required,
51
-
- the machine needs to have a separate disk partition with size enough to store the target Postgres directory (PGDATA),
52
-
- any modern Linux is supported,
53
-
- Docker needs to be installed on the machine,
54
-
- currently, you need to take care yourself of the initial copying of the database to this disk ("thick cloning" stage),
55
-
use pg_basebackup, restoration from an archive (such as WAL-G, Barman, pgBackRest or any), or dump/restore (the only way
56
-
supported for RDS, until AWS guys decide to allow replication connections),
57
-
- upon request, Database Lab will do "thin cloning" of PGDATA, providing fully independent writable
58
-
Postgres clones to users;
59
-
- currently, two technologies are supported for thin cloning:
60
-
- ZFS: [ZFS on Linux](https://zfsonlinux.org/) needs to be installed on the machine,
61
-
- LVM: with [LVM](https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)), all thin clones will be based on the latest version of the database (with ZFS, you can have multiple snapshots prepared and choose which one to use when requesting a new thin clone).
62
-
- it is easy to extend and add, Ceph - please contact us if you need it;
63
-
- comments, bug reports, and contributions are highly welcome.
64
-
65
-
66
-
## Server installation and setup
67
-
See [detailed tutorial](https://postgres.ai/docs/database-lab/1_tutorial)
68
-
in our documentation.
23
+
## Engine setup
24
+
See Database Lab tutorials:
25
+
- [Database Lab tutorial for Amazon RDS](https://postgres.ai/docs/tutorials/database-lab-tutorial-amazon-rds),
26
+
- [Database Lab tutorial for any PostgreSQL database](https://postgres.ai/docs/tutorials/database-lab-tutorial).
69
27
70
28
For stable Docker images see [postgresai/dblab-server](https://hub.docker.com/repository/docker/postgresai/dblab-server) repository on DockerHub.
71
29
72
-
73
30
## Client CLI
74
31
### Installation
75
32
Install Database Lab client CLI on a Linux architecture (e.g., Ubuntu):
Also, binaries available for download: [Alpine](https://gitlab.com/postgres-ai/database-lab/-/jobs/artifacts/master/browse?job=build-binary-alpine), [other](https://gitlab.com/postgres-ai/database-lab/-/jobs/artifacts/master/browse?job=build-binary-generic).
81
38
82
-
83
-
### Usage
84
-
See the full client CLI reference [here](https://postgres.ai/docs/database-lab/6_cli_reference).
85
-
86
-
Once you have Database Lab server(s) intalled, and client CLI installed on your machine,
87
-
initialize CLI and start communicating with the Database Lab server(s).
88
-
89
-
### Initialize CLI tool
90
-
```bash
91
-
dblab init \
92
-
--environment-id=tutorial \
93
-
--url=http://$IP_OR_HOSTNAME:2345 \
94
-
--token=secret_token
95
-
```
96
-
97
-
### Check connection availability
98
-
Access your Database Lab instance and check its status.
99
-
```bash
100
-
dblab instance status
101
-
```
102
-
103
-
### Request clone creation
104
-
When your Database Lab instance is up and running you can use it to create thin
105
-
clones, work with them, delete the existing clones, and see the list of
106
-
existing clones. To create a thin clone, you need to execute a `dblab clone create`
107
-
and fill all the required options, as illustrated below:
108
-
109
-
```bash
110
-
dblab clone create \
111
-
--username dblab_user_1 \
112
-
--password secret_password \
113
-
--id my_first_clone
114
-
```
115
-
116
-
After a few seconds, if everything is configured correctly, you will see
117
-
that the clone is ready to be used:
118
-
```json
119
-
{
120
-
"id": "botcmi54uvgmo17htcl0",
121
-
"snapshot": {
122
-
"id": "dblab_pool@initdb",
123
-
...
124
-
},
125
-
"status": {
126
-
"code": "OK",
127
-
"message": "Clone is ready to accept Postgres connections."
Open [an Issue](https://gitlab.com/postgres-ai/database-lab/-/issues) to discuss ideas, open [a Merge Request](https://gitlab.com/postgres-ai/database-lab/-/merge_requests) to propose a change.
159
55
56
+
See our [GitLab Container Registry](https://gitlab.com/postgres-ai/database-lab/container_registry) for develop Docker images.
0 commit comments