Installation¶
Kubernetes¶
PgDog comes with its own Helm chart. You can install it directly from our chart repository:
Docker¶
Docker images are built automatically for each commit to the main branch in GitHub:
SemVer¶
PgDog follows SemVer, and for each tagged release, a corresponding tag will be available in the Docker repository. For example, you can run v0.1.29 like so:
AWS ECS¶
New feature
This is a new feature. Please report any issues you may encounter.
We recently added a Terraform module to deploy PgDog on AWS ECS. It works with the same Docker image as our Helm chart, so the experience should be familiar.
From source¶
PgDog can be easily compiled from source. For production deployments, a Dockerfile is provided in GitHub. If you prefer to deploy on bare-metal or you're looking to run PgDog locally, you'll need to install a few dependencies.
Dependencies¶
Parts of PgDog depend on C/C++ libraries, which are compiled from source. Make sure to have a working version of a C/C++ compiler installed.
Install Xcode from the App Store and CMake & Clang from Homebrew:
Install Clang and CMake:
Install Visual Studio Community Edition. Make sure to include CMake in the installation.
Rust compiler¶
PgDog is written in Rust and uses the latest stable features of the language. Make sure to install the newest version of the toolchain from rust-lang.org.
Compile PgDog¶
Clone the code from our GitHub repository:
To make sure you get all performance benefits, PgDog should be compiled in release mode:
Launch PgDog¶
You can start PgDog by running the binary directly, located in target/release/pgdog, or with Cargo:
Configuration¶
PgDog is configured via two files:
| Configuration file | Description |
|---|---|
| pgdog.toml | Contains general settings and information about PostgreSQL servers. |
| users.toml | Contains users and passwords that are allowed to connect to PgDog. |
Users are configured separately to allow them to be encrypted at rest in environments that support it, like in Kubernetes or with the AWS Secrets Manager.
Both config files should be placed in the current working directory ($PWD) for PgDog to detect them. Alternatively,
you can pass their paths at startup as arguments:
pgdog.toml¶
Most configuration options have sensible defaults. This makes single-database configuration pretty short:
users.toml¶
This config file contains a mapping between databases, users, and passwords. Unless you configured passthrough authentication, users not specified in this file won't be able to connect:
Configuring users
PgDog creates connection pools for each user/database pair. If no users are configured in users.toml, all connection pools will be disabled and PgDog won't connect to the database(s).
Next steps¶
Features
Read more about PgDog features like load balancing, supported authentication mechanisms, TLS, health checks, and more.
Administration
Learn how to operate PgDog in production, like fetching real-time statistics from the admin database or updating configuration.
Architecture
Read about PgDog internals and how it works under the hood.
Configuration
Reference for PgDog configuration like maximum server connections, number of shards, and more.