-
Notifications
You must be signed in to change notification settings - Fork 79
Scalingo for PostgreSQL® Dedicated Resources #3559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
benjaminach
wants to merge
27
commits into
master
Choose a base branch
from
feat/postgresql-dr
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
6874818
Addition of Dedicated Resources pages
benjaminach 5799640
Keep "Addon" wording for SR resources
benjaminach 5156862
Fix link to target Dedicated Resources
benjaminach b57962f
Fix link
benjaminach b62d205
Apply suggestions from code review
benjaminach c6dd25f
Apply Pierre's requested changes
benjaminach 81a3b63
Document how customers can restore a dump from their workstation
benjaminach 5aa4a01
Improving the restoring page
benjaminach e834265
"Using the Terraform Provider" is now complete.
benjaminach 9e4d513
Kub Operator suggestions from chatgpt
benjaminach 394bac2
Update the sample URL to link to the folder instead of the XML file
benjaminach d8f122f
Fix links
benjaminach 2aba93b
Apply suggestions from code review
benjaminach 3cd88c7
Apply suggestions from code review
benjaminach f6f129b
Fix link
benjaminach 9e7a453
Remove addon and shared mentions
benjaminach 77b9af9
Document specific DBDR commands for changing plan and managing users
benjaminach 5736a0a
Apply suggestions from code review
benjaminach 8cae0d7
Improvments
benjaminach f6bde74
Add missing anchor
benjaminach 8a4e451
Strealine the way to access the database dashboard or a specific page
benjaminach a004b4f
Add a section for the password reset feature
benjaminach 8b9bf99
Fix typo
benjaminach 30887d8
Update working to match the dashboard
benjaminach f6a582a
Fix link
benjaminach 5f93d3a
Rework the intro to remove unsed anchor
benjaminach e57aa4d
Fix missing post_url
benjaminach File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
src/_posts/databases/postgresql/2000-01-01-dedicated-resources.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| nav: Dedicated Resources | ||
| index: 3 | ||
| --- |
4 changes: 4 additions & 0 deletions
4
src/_posts/databases/postgresql/dedicated-resources/2000-01-01-getting-started.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| nav: Getting Started | ||
| index: 1 | ||
| --- |
4 changes: 4 additions & 0 deletions
4
src/_posts/databases/postgresql/dedicated-resources/2000-01-01-guides.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| nav: Guides | ||
| index: 2 | ||
| --- |
106 changes: 106 additions & 0 deletions
106
...atabases/postgresql/dedicated-resources/getting-started/2000-01-01-accessing.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| --- | ||
| title: Accessing Your Scalingo for PostgreSQL® Dedicated Resources Database | ||
| nav: Accessing | ||
| modified_at: 2026-02-13 12:00:00 | ||
| tags: databases postgresql dedicated | ||
| index: 3 | ||
| --- | ||
|
|
||
|
|
||
| Remotely accessing your Scalingo for PostgreSQL® database can sometimes be | ||
| useful, for example, to conduct investigations, to check or compute data | ||
| locally, to dump the database content,... | ||
|
|
||
|
|
||
| ## Using Third Party Tools | ||
|
|
||
| While using `psql` to query and administer a PostgreSQL® database is probably | ||
| the ubiquitous choice for a lot of users, it's not limited to that. The | ||
| PostgreSQL® ecosystem indeed offers a very large panel of tools made and | ||
| provided by third-parties. For example, some might feel more intuitive because | ||
| of their Graphical User Interface. Some are better integrated with others | ||
| tools, when some others are more data-visualization centric. | ||
|
|
||
| By default, and for security reasons, your PostgreSQL® database is not directly | ||
| accessible from the Internet and therefore not directly usable with your | ||
| third-party tool. | ||
|
|
||
| To access your database remotely you first need to [make it reachable over the | ||
| Internet](#making-the-database-reachable-over-internet): | ||
| - either locally, on your computer, via an [encrypted tunnel](#setting-up-an-encrypted-tunnel) | ||
| - or from any location, by [enforcing TLS connection]({% post_url databases/postgresql/dedicated-resources/getting-started/2000-01-01-connecting %}#enforcing-tls-connection) | ||
| and [enabling direct Internet access](#enabling-direct-access-over-internet). | ||
|
|
||
| Once a secured connection has been established, you should be able to connect | ||
| to your database with your tool of choice. If you don't have one yet, we | ||
| suggest you to [take a look at pgAdmin](#using-pgadmin). | ||
|
|
||
| ### Using pgAdmin | ||
|
|
||
| pgAdmin is probably the most popular and feature rich administration and | ||
| development platform for PostgreSQL®. It's open-source, it supports many | ||
| platforms and comes with a Graphical User Interface, making it a reference tool | ||
| for PostgreSQL®. | ||
|
|
||
|
|
||
| ## Allowing Access with Firewall Rules | ||
|
|
||
| Dedicated Resources databases are protected by a deny-by-default firewall. | ||
| To allow inbound connections, you must add explicit firewall rules for each | ||
| trusted source. | ||
|
|
||
| 1. From your web browser, [open your database dashboard]({% post_url databases/postgresql/dedicated-resources/getting-started/2000-01-01-provisioning %}#accessing-the-scalingo-for-postgresql-dashboard) | ||
| 2. Select the **Settings** tab | ||
| 3. In the **Settings** submenu, select **Internet Access** | ||
| 4. In the **Firewall rules** block, click **New rule** | ||
| 5. Select the rule type: | ||
| - **Custom CIDR IPv4** to allow specific public IP addresses or ranges | ||
| - **Scalingo `<region>` region** to allow traffic from Scalingo apps in that region | ||
| 6. Repeat as needed for each trusted source | ||
| 7. Connect using the database [connection URI]({% post_url databases/postgresql/dedicated-resources/getting-started/2000-01-01-connecting %}#getting-the-connection-uri) | ||
|
|
||
| ### How the Firewall Works | ||
|
|
||
| The firewall follows an allowlist model: you define allowed source networks | ||
| with CIDR notation (single IPs or ranges), and only matching sources can reach | ||
| the database endpoint. | ||
|
|
||
| You can configure up to **30 firewall rules** per | ||
| database, and rule changes usually propagate in around 2 minutes. | ||
|
|
||
| Here are common CIDR formats you can use in firewall rules: | ||
|
|
||
| - Single IP: `203.0.113.10/32` (`/32` means one exact IPv4 address) | ||
| - IP range: `203.0.113.0/24` (`/24` means a subnet of 256 IPv4 addresses) | ||
| - Allow all (not recommended): `0.0.0.0/0` (`/0` means all IPv4 addresses; this | ||
| effectively disables firewall filtering) | ||
|
|
||
| ### Allowing Scalingo Apps To Reach a Dedicated Resources Database | ||
|
|
||
| If a Scalingo app must connect to a Dedicated Resources database, you need to | ||
| allow inbound connections from the app [region's egress IP addresses][egress]. | ||
|
|
||
| To keep the service simple and maintenance-free, Scalingo provides a | ||
| **managed rule** type that automatically allowlists egress IPs for a region. | ||
|
|
||
| Two managed rules are available: | ||
|
|
||
| - `Scalingo osc-fr1 region` | ||
| - `Scalingo osc-secnum-fr1 region` | ||
|
|
||
| Workflow: | ||
|
|
||
| 1. Identify the app region (for example `osc-fr1` or `osc-secnum-fr1`). | ||
| 2. Add the matching **managed rule** in the Dedicated Resources firewall. | ||
| 3. Add custom CIDR rules only for additional non-Scalingo sources (office IPs, | ||
| VPN, etc.). | ||
|
|
||
| A database in `osc-fr1` can accept traffic from an app in `osc-secnum-fr1` (and | ||
| the other way around) as long as the corresponding managed rule is present. | ||
|
|
||
| {% note %} | ||
| With managed rules, Scalingo maintains the underlying egress IP list for you. | ||
| You do not need to manually track egress IP changes for these rules. | ||
| {% endnote %} | ||
|
|
||
| [egress]: {% post_url platform/networking/public/2000-01-01-egress %} |
104 changes: 104 additions & 0 deletions
104
...tabases/postgresql/dedicated-resources/getting-started/2000-01-01-connecting.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| --- | ||
| title: Connecting Your Scalingo for PostgreSQL® Dedicated Resources Database | ||
| nav: Connecting | ||
| modified_at: 2026-02-13 12:00:00 | ||
| tags: databases postgresql dedicated | ||
| index: 2 | ||
| --- | ||
|
|
||
|
|
||
| Each Scalingo for PostgreSQL® Dedicated Resources database has its own | ||
| **connection URI**, containing all information needed to connect to it. | ||
|
|
||
|
|
||
| ## Understanding the Connection URI | ||
|
|
||
| The connection URI is made of several **components** separated one from each | ||
| other by a **delimiter**. For example, the `@` character is used to mark the | ||
| end of the *userinfo* (credentials) component of the URI. | ||
|
|
||
| In the case of PostgreSQL®, the connection URI provided by Scalingo is always | ||
| formed as follows: | ||
|
|
||
| ```bash | ||
| postgresql://[user]:[password]@[url]:[port]/[dbname]?sslmode=require | ||
| ``` | ||
|
|
||
| For more information about the connection URI syntax, please see | ||
| [RFC 3986][rfc3986] which defines the URI Generic Syntax. | ||
|
|
||
|
|
||
| ## Using the Connection URI | ||
|
|
||
| **We strongly advise to use one of the two environment variables available to | ||
| connect your application to your database**. Please don't use the value, but | ||
| the environment variable itself. | ||
|
|
||
| While the value of the provided connection URI **should not** change over time, | ||
| **we don't guarantee it**. For example, the URI could change for maintenance | ||
| reasons. In such a case, using the environment variable guarantees that your | ||
| application can restart successfully without human intervention. Otherwise, you | ||
| would have to update your code with the new value and trigger a new deployment, | ||
| which would most probably contribute to a greater downtime. | ||
|
|
||
| In most cases, you can pass the environment variable directly to the client | ||
| library you are using. But sometimes, the library requires a specific URI | ||
| format, individual keypairs or another format. In such cases, your code | ||
| needs to parse the connection URI to retrieve the different values and build | ||
| what's required by the library. Our advice to use the environment variable | ||
| still remains applicable. | ||
|
|
||
|
|
||
| ## Getting the Connection URI | ||
|
|
||
| ### Using the Dashboard | ||
|
|
||
| 1. From your web browser, open your [dashboard][dashboard] | ||
| 2. Open the **Project** containing the database you want to manage | ||
| 3. In the **Databases** section, click the database name | ||
| 4. Locate the **Connect** section then copy its **Connection String** | ||
|
|
||
| ### Using the Command Line | ||
|
|
||
| 1. Make sure you have correctly [setup the Scalingo command line tool][cli] | ||
| 2. From the command line, get the environment variable value: | ||
| ```bash | ||
| scalingo --app my-dedicated-database env-get SCALINGO_POSTGRESQL_URL | ||
| ``` | ||
| The output is: | ||
| ```bash | ||
| postgresql://my_dedicate_wxyz:YANs3y07m5_KJC2MSDGebh8tx1lliFWh2Yb239zVqGQvbElWDjIN7QWspVH92Ul8@my-dedicate-wxyz.postgresql.a.osc-fr1.scalingo-dbs.com:31000/my_dedicate_xyz?sslmode=require | ||
benjaminach marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
|
|
||
| ## TLS Connections Are Enforced | ||
|
|
||
| By default, all PostgreSQL® Dedicated Resources databases enforce TLS. | ||
| Any non-TLS connection is denied. Consequently, your application must be | ||
| configured to use TLS when connecting to the database. | ||
|
|
||
|
|
||
| ## Connecting Multiple Applications to the Same Database | ||
|
|
||
| To share a database across multiple Scalingo applications, first make sure the | ||
| Dedicated Resources firewall allows traffic from the application's region (see | ||
| [Allowing Scalingo Apps to Reach a Dedicated Resources Database][dr-firewall-regions]). | ||
| Then add the database connection string as an environment variable in each | ||
| application that needs access. | ||
|
|
||
| 1. Copy [the connection URI](#getting-the-connection-uri) of your database instance | ||
| 2. [Create a new environment variable][environment] for the application that | ||
| needs to access the addon | ||
| 3. Set the value of this new environment variable to connection URI you just | ||
| copied | ||
| 4. Restart the application to make the new environment variable available | ||
|
|
||
|
|
||
| [rfc3986]: https://datatracker.ietf.org/doc/html/rfc3986 | ||
| [dashboard]: https://dashboard.scalingo.com | ||
|
|
||
| [cli]: ({% post_url tools/cli/2000-01-01-start %}) | ||
| [environment]: {% post_url platform/app/2000-01-01-environment %} | ||
| [dr-firewall-regions]: {% post_url databases/about/2000-01-01-network-exposure %}#allowing-scalingo-apps-to-reach-a-dedicated-resources-database | ||
|
|
||
| [database-dashboard]: {% post_url databases/postgresql/dedicated-resources/getting-started/2000-01-01-provisioning %}#accessing-the-scalingo-for-postgresql-dashboard | ||
125 changes: 125 additions & 0 deletions
125
...bases/postgresql/dedicated-resources/getting-started/2000-01-01-provisioning.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| --- | ||
| title: Provisioning a Scalingo for PostgreSQL® Dedicated Resources Database | ||
| nav: Provisioning | ||
| modified_at: 2026-02-13 12:00:00 | ||
| tags: databases postgresql dedicated | ||
| index: 1 | ||
| --- | ||
|
|
||
|
|
||
| Once you have chosen the right plan for your needs, you are ready to provision | ||
| the database. This can be done via our | ||
| [dashboard](#using-the-dahboard), our | ||
| [CLI tool](#using-the-command-line), our | ||
| [Terraform Provider](#using-the-terraform-provider), or via our | ||
| [Kubernetes Operator](#usint-the-kubernetes-operator). | ||
|
|
||
|
|
||
| ## Provisioning | ||
|
|
||
| ### Using the Dashboard | ||
|
|
||
| 1. From your web browser, open your [dashboard][dashboard] | ||
| 2. Select the **Project** where you want to create the database | ||
| 3. Click the arrow next to **Create an application**, then click | ||
| **Database Dedicated Resources** | ||
| 4. In the **Databases engines** section, select | ||
| **PostgreSQL Dedicated Resources** and confirm your choice | ||
| 5. Enter a database name, then select or confirm the appropriate **Project** and | ||
| **Region** | ||
| 6. Select the plan you want to provision and confirm your selection | ||
| 7. Click the **Create database** button | ||
| 8. Database provisioning typically takes 15–30 minutes | ||
|
|
||
| ### Using the Command Line (Preview) | ||
|
|
||
| Because Dedicated Resources databases are not yet generally available, | ||
| you must first enable preview features to use the related CLI commands: | ||
|
|
||
| ```sh | ||
| export SCALINGO_PREVIEW_FEATURES=true | ||
| ``` | ||
|
|
||
|
|
||
benjaminach marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 1. Make sure you have correctly [setup the Scalingo command line tool][cli] | ||
| 2. From the command line, list the plans available for `postgresql`: | ||
| ```bash | ||
| scalingo database-list-plans postgresql-ng | ||
| ``` | ||
| The output should look like this: | ||
| ```text | ||
| ┌─────────────────────────────────┬─────────────────┐ | ||
| │ ID │ NAME │ | ||
| ├─────────────────────────────────┼─────────────────┤ | ||
| │ postgresql-dr-starter-4096 │ Starter 4G │ | ||
| │ postgresql-dr-starter-8192 │ Starter 8G │ | ||
| │ postgresql-dr-starter-16384 │ Starter 16G │ | ||
| ... | ||
| ``` | ||
| 3. Locate the `ID` corresponding to the plan you want to deploy (for example | ||
| `postgresql-dr-starter-4096`) | ||
| 4. Provision the database: | ||
| ```bash | ||
| scalingo database-create --type postgresql-ng --plan <plan_ID> <database_name> | ||
| ``` | ||
| The output should look like this: | ||
| ```text | ||
| -----> Your postgresql-ng database 698e082f968c27dfb8a27521 ('my-dedicated-database') is being provisioned… | ||
| ``` | ||
| 5. Database provisioning typically takes 15–30 minutes | ||
benjaminach marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Optionally you can use `--wait` in order to make the command synchronous. | ||
| ```bash | ||
| scalingo database-create --type postgresql-ng --plan <plan_ID> --wait sfdsfsdf | ||
benjaminach marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| ### Using the Terraform Provider (To Update) | ||
|
|
||
| 1. Place the following `resource` block in your Terraform file to create the | ||
| database and attach it to your app: | ||
| ```tf | ||
| resource "scalingo_database" "my-dedicated-database" { | ||
| name = "my-dedicated-database" | ||
| technology = "postgresql-ng" | ||
| plan = "postgresql-dr-starter-4096" | ||
| } | ||
| ``` | ||
| In this example, we create a dedicated PostgreSQL Starter 4096 database named `my-dedicated-database`. We could have done the same with another plan. | ||
| 2. Run `terraform plan` and check if the result looks good | ||
| 3. If so, run `terraform apply` | ||
| 4. Database provisioning typically takes 15–30 minutes | ||
|
|
||
| ### Using the Kubernetes Operator (To Update) | ||
|
|
||
| XXX | ||
benjaminach marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| ## Accessing the Scalingo for PostgreSQL® Dashboard | ||
|
|
||
| Every PostgreSQL® database comes with its dedicated dashboard, generally referred | ||
| to as **database dashboard**, which is the central place for administrative | ||
| tasks such as: | ||
|
|
||
| - [Monitoring the database][pg-dr-monitoring] through logs, metrics and statistics | ||
| - [Upgrading the database][pg-dr-upgrading] engine version | ||
| - [Enabling specific features][pg-dr-managing-extensions] | ||
| - [Managing database users][pg-dr-managing-users] | ||
| - [Managing backups][pg-dr-backing-up] | ||
|
|
||
| You can access the database dashboard from the main dashboard: | ||
|
|
||
| 1. From your web browser, open your [dashboard][dashboard] | ||
| 2. Open the **Project** containing the database you want to manage | ||
| 3. In the **Databases** section, click the database name | ||
|
|
||
|
|
||
| [dashboard]: https://dashboard.scalingo.com/apps | ||
| [architecture-models]: {% post_url databases/about/2000-01-01-architecture-models %} | ||
|
|
||
| [cli]: {% post_url tools/cli/2000-01-01-start %} | ||
|
|
||
| [pg-dr-monitoring]: {% post_url databases/postgresql/dedicated-resources/guides/2000-01-01-monitoring %} | ||
| [pg-dr-upgrading]: {% post_url databases/postgresql/dedicated-resources/guides/2000-01-01-upgrading %} | ||
| [pg-dr-managing-extensions]: {% post_url databases/postgresql/extensions/2000-01-01-managing-extensions %} | ||
| [pg-dr-managing-users]: {% post_url databases/postgresql/dedicated-resources/guides/2000-01-01-managing-users %} | ||
| [pg-dr-backing-up]: {% post_url databases/postgresql/dedicated-resources/guides/2000-01-01-backing-up %} | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.