Understanding Database Endpoints
Database endpoints are the different ways to access the database through the network.
Listing Database Endpoints with CLI
Because Dedicated Resources databases are not yet generally available, you must first enable preview features to use the related CLI commands:
export SCALINGO_PREVIEW_FEATURES=true
Run the following command to list your database endpoints:
scalingo --database <db-id> database-endpoints
┌──────────────────────────┬────────────────────┬───────────────────────────────────────────────────────┬───────┐
│ ID │ TYPE │ HOSTNAME │ PORT │
├──────────────────────────┼────────────────────┼───────────────────────────────────────────────────────┼───────┤
│ 6a316183d0f1f10ecbcca123 │ public-rw │ mydb-1234.postgresql.osc-fr1.scalingo-dbs.com │ 30092 │
│ 6a316183d0f1f10ecbcca456 │ private-peering-rw │ mydb-1234.peering.postgresql.osc-fr1.scalingo-dbs.com │ 30092 │
└──────────────────────────┴────────────────────┴───────────────────────────────────────────────────────┴───────┘
Types of Database Endpoints
Public RW
Public RW (public-rw) stands for public read/write. Its hostname resolves to
the public IP configured for the database. It will always route requests to the
servers able to receive read and write operations on the database.
In case of a cluster failover (maintenance/incident), the gateway instance targeted by the endpoint will change transparently, the IP resolved by the hostname will not change.
Private Peering RW
Private Peering RW (private-peering-rw) stands for private peering
read/write. Its hostname resolves to the private IP address on the database
gateway instance which is considerd as primary at a given time.
This hostname:port couple will only be reachable from networks linked with a Net Peering to the database.
In case of a cluster failover (maintenance/incident), the hostname DNS resolution will be automatically updated to resolve on an available gateway instance.
Build a Connection String from an endpoint
When configuring an application, choose the endpoint matching the network path you want to use to reach your database.
For example, use the public endpoint to connect through the public Internet, or the Private Peering endpoint to connect through Net Peering.