Managed database hosting
Give your application a SQL database, document store or persistent key store. Each database has its own deployment slot, data directory and client identity.
- Client identity
client.pem- Server trust
server-ca.pem
redis> PING
PONG
See the TLS client commands
How hosted database deployments work
Choose by the queries your app makes
Use PostgreSQL or MySQL for relational records, MongoDB for document collections and Redis for keys, expirations or streams. Start with the engine your application driver supports, then size the deployment for its data and indexes.
See engine allocationsConnect with a client identity
The owner can download the client identity and server trust file from Connection. Your driver presents the identity and checks the server hostname. A successful query from the application confirms the credentials and the database role together.
See commands for each engineA volume for each engine
The engine keeps its data through a process restart. Reserve enough disk for growth, temporary files and indexes. Your web app and database can restart independently and draw their resource allocations from the same account.
Allocate a deployment poolRecovery points by plan
On a node with database snapshots enabled, Backups shows the available recovery points. Pick a point from before the unwanted change and account for later writes when deciding whether to restore.
Read the database recovery procedureChoose a database engine
Start with the client your application already uses and the data it needs to query. The figures below are minimum allocations for one database. Reserve additional space for records, indexes and temporary writes.
- Deploy MySQL on Relay
MySQL
Use relational tables for an application built around a MySQL driver and SQL transactions.
1024 MB RAM · 50% CPU · 2048 MB storage - Deploy PostgreSQL on Relay
PostgreSQL
Use SQL joins, constraints and indexes with a PostgreSQL client.
512 MB RAM · 25% CPU · 1024 MB storage - Deploy MongoDB on Relay
MongoDB
Store related fields together in documents and query collections with a MongoDB driver.
1024 MB RAM · 50% CPU · 2048 MB storage - Deploy Redis on Spark
Redis
Look up keys, expire cached results or append events to a stream.
256 MB RAM · 25% CPU · 512 MB storage
Make the first connection
Allocate the database
Choose an engine and reserve memory, CPU, storage and a slot from your account pool. The image initializes its own directory. Start the database, then open Connection as the deployment owner.
Install the client identity
Download
client.pemandserver-ca.pem. The client file contains a private key. Restrict it to your application user and keep it outside the repository. Configure your driver with the hostname and port shown in Connection.Test with a small query
Enable TLS and hostname verification. Run
SELECT 1for SQL, list the application collections for MongoDB, or sendPINGfor Redis. Then read a known record with your application’s own client settings.
Move an existing dataset and verify the cutover
An empty database that answers a connection test is ready to receive your data. Before switching your application, prove that its own driver can read and write the records it depends on.
Open connection and recovery instructionsChoose a representative record
Record a primary key, document ID or Redis key from the source database, along with the value you expect. Check the engine versions and choose an export and import format supported by both. Estimate space for records and indexes.
Import and test from the app
Use a separate target deployment and its TLS credentials. Import a copy, compare table or collection counts where applicable and read your known record with the real application driver. Test a disposable write using the application role.
Switch while writes are paused
Stop writers, transfer any final changes and verify the record again. Update the application’s endpoint and identity, restart it and confirm a new write reaches the target. Keep the source or final export until you have checked the result.
Database plans
Each database uses one deployment and shares the memory, CPU and storage in your account. Redis fits the Spark free plan. PostgreSQL, MySQL and MongoDB require a larger plan.
| Plan | Memory | Storage | CPU | Deployments | Database backup | History | Per month |
|---|---|---|---|---|---|---|---|
| Spark | 256 MB | 512 MB | 25% | 1 | Every hour | 24 hours | $0.00 |
| Relay | 1 GB | 5 GB | 50% | 2 | Every 15 minutes | 3 days | $2.25 |
| Circuit | 2 GB | 8 GB | 100% | 4 | Every 15 minutes | 7 days | $3.25 |
| Grid | 4 GB | 15 GB | 200% | 8 | Every 15 minutes | 14 days | $6.00 |
| Fleet | 8 GB | 25 GB | 250% | 12 | Every 15 minutes | 30 days | $9.00 |
Spark1 deployment$0.00
- Memory
- 256 MB
- Storage
- 512 MB
- CPU
- 25%
- Deployments
- 1
- Database backup
- Every hour
- History
- 24 hours
Relay2 deployments$2.25
- Memory
- 1 GB
- Storage
- 5 GB
- CPU
- 50%
- Deployments
- 2
- Database backup
- Every 15 minutes
- History
- 3 days
Circuit4 deployments$3.25
- Memory
- 2 GB
- Storage
- 8 GB
- CPU
- 100%
- Deployments
- 4
- Database backup
- Every 15 minutes
- History
- 7 days
Grid8 deployments$6.00
- Memory
- 4 GB
- Storage
- 15 GB
- CPU
- 200%
- Deployments
- 8
- Database backup
- Every 15 minutes
- History
- 14 days
Fleet12 deployments$9.00
- Memory
- 8 GB
- Storage
- 25 GB
- CPU
- 250%
- Deployments
- 12
- Database backup
- Every 15 minutes
- History
- 30 days
Prices in USD before tax. A year costs the same as ten monthly payments.
Compare all plan featuresQuestions and troubleshooting
Get deployment helpWhich databases fit the free plan?
Redis fits a complete Spark allocation on a host with database support enabled. MySQL, PostgreSQL and MongoDB have higher minimums. A Redis deployment on Spark uses the account’s only slot, so an app hosted alongside it needs a larger pool.
Does a backup of my bot also back up its separate database?
The two deployments have separate data. Check recovery points on the database itself. A file backup of a bot can preserve its local files, while database records need a recovery point or an engine-appropriate export.
Why does my client reject the certificate?
Use the database hostname and assigned port from Connection. Configure the trust file for this database and present its client identity. A website URL, raw IP address or certificate from another deployment can fail hostname or identity verification.
How do I replace a client identity?
Stop the database and wait for Offline. Rotate the client identity in Connection, download its replacement, restart and update every application that connects.
What should I verify after restoring a backup?
Restore to the same engine major version. Refresh the server certificate from Connection if the server identity changed. Read a known application record before sending normal traffic to the restored deployment.