Skip to content

Commit b6a47d2

Browse files
committed
more ee stuff
1 parent 139fea5 commit b6a47d2

6 files changed

Lines changed: 119 additions & 13 deletions

File tree

docs/enterprise_edition/control_plane/self-hosting.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The following values should be set in `values.yaml`:
3434
|-|-|
3535
| `image.tag` | The Docker tag for the control plane image. |
3636
| `ingress.host` | The DNS host for the control plane, e.g., `pgdog.database.internal`. |
37-
| `env` | A key/value mapping of [environment varialbes](#configuration) passed to the control plane application. |
37+
| `env` | A key/value mapping of [environment variables](#configuration) passed to the control plane application. |
3838

3939
For example:
4040

@@ -44,26 +44,26 @@ image:
4444
ingress:
4545
host: pgdog.database.internal
4646
env:
47-
SESSION_KEY: 1b80a3cc1640a3[...]
47+
DATABASE_URL: postgres://user:password@[...]
4848
```
4949
5050
### Configuration
5151
5252
The control plane is configured via environment variables. The following variables are required for it to work correctly:
5353
54-
| Environment variable | Description |
55-
|-|-|
56-
| `DATABASE_URL` | URL pointing to the Postgres database used for storing control plane data. |
57-
| `SESSION_KEY` | Secret key used to encrypt user session cookies. Can be any value, as long as it's at least 64 bytes. |
58-
| `REDIS_URL` | URL pointing to the Redis database used for synchronization. |
59-
| `FRONTEND_URL` | The URL where the frontend application is hosted. This defaults to `ingress.host` if you're using the Helm chart. |
54+
| Environment variable | Description | Example |
55+
|-|-|-|
56+
| `DATABASE_URL` | URL pointing to the Postgres database used for storing control plane data. | `postgres://user:password@host:5432/db` |
57+
| `SESSION_KEY` | Secret key used to encrypt user session cookies. Can be any value, as long as it's at least 64 bytes. | `abcsf32a[...]` |
58+
| `REDIS_URL` | URL pointing to the Redis database used for synchronization. | `redis://127.0.0.1/0` |
59+
| `FRONTEND_URL` | The URL where the frontend application is hosted. This defaults to `ingress.host` if you're using the Helm chart. | `http://pgdog.internal` |
6060

6161
!!! note "Helm chart"
62-
If you're using the [Helm chart](#kubernetes), these are generated from settings in `values.yaml` and don't need to be configured manually.
62+
If you're using the [Helm chart](#kubernetes), all variables except `DATABASE_URL` are generated from settings in `values.yaml` and don't need to be configured manually.
6363

6464
#### Session key
6565

66-
The control plane requires a 64 bytes randomly generated session key to encrypt user session cookies. You can generate one with just one line of Python:
66+
The control plane requires a 64 bytes randomly generated session key to encrypt user session cookies. If you're not using our Helm chart, you can generate one with just one line of Python:
6767

6868
=== "Command"
6969
```bash
@@ -76,14 +76,14 @@ The control plane requires a 64 bytes randomly generated session key to encrypt
7676

7777
### Authentication
7878

79-
The control plane web UI suppors two authentication methods:
79+
The control plane web UI supports two authentication methods:
8080

8181
1. Email and password
8282
2. OAuth2
8383

8484
Password authentication works out of the box and requires no additional setup beyond creating users via the [CLI](cli.md).
8585

86-
For OAuth2, you need to configure each provider, and depending on which provider you choose, different environment variables need to be set as well:
86+
For OAuth2, you need to configure each provider, and depending on which provider you choose, different environment variables need to be set:
8787

8888
=== "Google"
8989
| Environment variable | Description |
@@ -98,3 +98,10 @@ For OAuth2, you need to configure each provider, and depending on which provider
9898
| `GITHUB_CLIENT_ID` | GitHub OAuth2 client identifier. You can obtain one by creating an OAuth application in the [Developer Settings](https://github.com/settings/developers) in your GitHub account. |
9999
| `GITHUB_CLIENT_SECRET` | GitHub OAuth2 client secret. |
100100
| `GITHUB_REDIRECT_URL` | OAuth redirect URL. It should be set to the following: `${FRONTEND_URL}/github/oauth/callback`. |
101+
102+
!!! note "OAuth2 redirect"
103+
The redirect URL (e.g., `GOOGLE_REDIRECT_URL`) is set automatically by the Helm chart. You only need to set it if you're self-hosting using a different orchestration mechanism.
104+
105+
#### Creating users
106+
107+
You can create a user using the [CLI](cli.md) [`onboard`](cli.md#onboarding) command. It works for both password-based and OAuth2 authentication mechanisms.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
icon: material/database-edit
3+
---
4+
5+
# Cross-shard writes
6+
7+
!!! note "On the roadmap"
8+
This feature is still on the [roadmap](index.md#roadmap) and
9+
hasn't been built yet.
10+
11+
Queries that create or update rows on multiple shards should be using [two-phase](../features/sharding/2pc.md) transactions. This ensures that table changes are atomic in all databases. The open source edition of PgDog supports this feature out of the box.
12+
13+
The Enterprise edition provides crash protection, in case PgDog itself is restarted or the hardware its running on fails, while in between phase one and phase two of the exchange. This guarantees all two-phase transactions are either committed or rolled back.
14+
15+
## How it works
16+
17+
Two-phase transactions are durable database objects. Once prepared, a 2pc transaction needs to be either committed or rolled back. If this doesn't happen, PostgreSQL won't be able to vacuum affected tables. If left unattended for a long period of time, this will cause a database shutdown.
18+
19+
### Durable two-phase
20+
21+
PgDog Enterprise nodes register each two-phase transaction with the [control plane](control_plane/index.md). When a PgDog process boots up, it will fetch all of its abandoned transactions from the control plane storage, and proceed to clean them up before serving query traffic.
22+
23+
<center>
24+
<img src="/images/ee/2pc_storage.png" width="70%" alt="Reload schema">
25+
</center>
26+
27+
The transaction identifiers and their state are saved in a separate PostgreSQL database. This provides a safety guarantee against control plane crashes as well.
28+
29+
## Status
30+
31+
This feature isn't built yet. We're planning on shipping it in Q2 2026.

docs/enterprise_edition/index.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ icon: material/office-building
66

77
PgDog Enterprise is a version of PgDog that contains additional features for large-scale monitoring and deployment of sharded (and unsharded) PostgreSQL databases.
88

9-
Unlike PgDog itself, PgDog Enterprise is closed source and available upon the purchase of a license. It comes with a control plane which provides real-time visibility into PgDog's operations and enterprise features.
9+
Unlike PgDog itself, PgDog Enterprise is closed source and available upon the purchase of a license. It comes with a control plane which provides real-time visibility into PgDog's operations and enterprise features and dedicated support from the team that built PgDog.
1010

1111
## Features
1212

1313
| Feature | Description |
1414
|-|-|
1515
| [Control plane](control_plane/index.md) | Synchronize and monitor multiple PgDog processes. |
16+
| [Schema management](schema.md) | Synchronize database schema changes between multiple PgDog nodes. |
1617
| [Active queries](insights/active_queries.md) | Real-time view into queries running through PgDog. |
1718
| [Query plans](insights/query_plans.md) | Root cause slow queries and execution anomalies with real-time Postgres query plans, collected in the background. |
1819
| [Real-time metrics](metrics.md) | All PgDog metrics, delivered with second-precision through a dedicated connection. |
@@ -40,6 +41,42 @@ The demo comes with the control plane, the web UI and PgDog configured as follow
4041

4142
For questions about the demo, PgDog Enterprise features, or pricing, [contact us](https://calendly.com/lev-pgdog/30min). PgDog can be deployed on-prem, in your cloud account, or entirely managed by us.
4243

44+
## Getting PgDog Enterprise
45+
46+
The Enterprise edition is available from two sources:
47+
48+
1. Our Docker repository
49+
2. From source
50+
51+
### Docker repository
52+
53+
!!! note "Enterprise license"
54+
Before deploying these images to production, make sure you purchased our Enterprise Edition license. You're welcome to use these for evaluation purposes, e.g., demo deployment or in a staging environment.
55+
56+
Both PgDog and the control plane are available as Docker images:
57+
58+
| Application | Repository |
59+
|-|-|
60+
| PgDog | `ghcr.io/pgdogdev/pgdog-enterprise` |
61+
| Control plane | `ghcr.io/pgdogdev/pgdog-enterprise/control` |
62+
63+
If you're using our [Helm chart](../installation.md#kubernetes), you just need to change the `image.repository` and `image.tag` variables, for example:
64+
65+
```yaml
66+
image:
67+
repository: ghcr.io/pgdogdev/pgdog-enterprise
68+
tag: 87a6bcae
69+
```
70+
71+
For deploying the [control plane](control_plane/index.md), you have two options:
72+
73+
1. Use our managed deployment ([contact us](https://calendly.com/lev-pgdog/30min))
74+
2. [Self-hosting](control_plane/self-hosting.md)
75+
76+
### From source
77+
78+
If you want to manage all aspects of deploying PgDog Enterprise, [get in touch](https://calendly.com/lev-pgdog/30min) and we'll provide you access to the source code via a GitHub deployment key. You'll receive updates at the same frequency as the Docker repository.
79+
4380
## Roadmap
4481
4582
PgDog Enterprise is new and in active development. A lot of the features we want aren't built yet:
@@ -49,3 +86,4 @@ PgDog Enterprise is new and in active development. A lot of the features we want
4986
| QoS | Quality of service guarantees, incl. throttling on a per-user/database/query level. |
5087
| AWS RDS integration | Deploy PgDog on top of AWS RDS, without the hassle of Kubernetes or manual configuration. |
5188
| Automatic resharding | Detect hot shards and re-shard data without operator intervention. |
89+
| [Durable two-phase](cross-shard-writes.md) | Rollback / commit abandoned two-phase transactions. |

docs/enterprise_edition/schema.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
icon: material/database-sync
3+
---
4+
5+
# Schema management
6+
7+
PgDog inspects the database schema in order to automatically detect sharded and [omnisharded](../features/sharding/omnishards.md) tables. When new tables are added or existing tables are changed, PgDog's snapshot of the schema needs to be refreshed.
8+
9+
The open source edition supports refreshing the schema for single-node deployments only. The Enterprise edition takes care of synchronizing schema updates across multiple PgDog nodes, ensuring consistent configuration.
10+
11+
## How it works
12+
13+
When a client executes a DDL command, e.g. `CREATE TABLE`, PgDog will send a notification to the [control plane](control_plane/index.md). The control plane will then trigger a schema reload across all registered PgDog nodes.
14+
15+
<center>
16+
<img src="/images/ee/reload_schema.png" width="70%" alt="Reload schema">
17+
</center>
18+
19+
This process takes place in the background, so the schema snapshot across nodes is eventually consistent. This is sufficient for most applications, since migrations run as a separate process and application traffic doesn't use new tables for a considerable amount of time after the schema is changed. This gives PgDog ample time to refresh its schema snapshot.
20+
21+
### Configuration
22+
23+
Schema reloading on DDL is enabled by default. This is configurable in [`pgdog.toml`](../configuration/pgdog.toml/general.md#reload_schema_on_ddl):
24+
25+
```toml
26+
[general]
27+
reload_schema_on_ddl = true
28+
```
29+
30+
In the open source edition, this reloads the schema on the same node only, while in the Enterprise edition, this triggers a schema reload on all PgDog nodes part of the same deployment.

docs/images/ee/2pc_storage.png

58.5 KB
Loading

docs/images/ee/reload_schema.png

32.9 KB
Loading

0 commit comments

Comments
 (0)