MySQL
MySQL that keeps going when a server fails.
Run one server while you build, or three or more that each keep a full copy of your data. Your app connects to a router, which always sends it to the server in charge.
- 1 to 9
- Servers
- Router
- One address to connect to
- Private
- Not on the internet
- 1s
- Billing unit
What you get
A database that stays up.
A copy on every server
With three or more servers, each one holds all your data. Writes keep working as long as more than half the servers are up.
One address for your app
Your app connects to a router, never to a server. If a server fails, the router sends traffic to the one that took over.
Connection variables
DATABASE_URL,MYSQL_HOST,MYSQL_PORT,MYSQL_USERandMYSQL_PASSWORDare ready to reference from your other services.Scheduled backups
Daily, twice a day or weekly, written to a bucket in the same project or to any S3-compatible bucket you name.
Restore into a new database
Pick a backup when you create a database and it starts with that data. Check it, then point your app at it.
Bring your data
Load a dump from your old server with
mysqldumpandmysql, over the connection URL.
How it works
Choose how many servers.
One server
Fine for development. If it stops, the database is down until it restarts.
Three or more
Use an odd number. Three survives one failed server, five survives two. Going from three to four adds cost without surviving more failures.
Routers
One router is enough. Add a second if you do not want the router itself to be a single point of failure.
# In the api service's variables
DATABASE_URL=${{mysql.DATABASE_URL}}
# MySQL starts empty, so create a database first
mysql> CREATE DATABASE myapp;
Tables need a primary key and the InnoDB engine, so every server can copy each write.
Pricing
Servers and routers are both billed.
Every server and every router is a node, billed at the same vCPU and memory rates as a container. A 3-server cluster with 1 router is 4 nodes. The create dialog shows the total before you apply.
- vCPU₦0.0096 / vCPU / secondPer node, servers and routers
- Memory₦0.0048 / GB / secondPer node, servers and routers
- Disk₦0.0002 / GB / secondPer server. Routers hold no data
- Backups₦36 / GB / monthStored in a bucket at the storage rate
Example
1 server + 1 router · 1 vCPU · 1 GB
₦80,942 / month
Before VAT, running all month. Change it in the estimator.
Estimate your cost- Storage is set when you create the database and cannot be changed later, so leave room to grow.
Questions
Common questions
- Can I restore to an exact moment?
- No. MySQL restores to a backup that has already run. If you need to go back to a precise second, use Postgres.
- Why is there no database name in the URL?
- MySQL starts with no databases. Create one with your first connection, then add its name to the URL.
- Can I add servers later?
- Yes. That is why every table needs a primary key and InnoDB from the start, even on one server.
- Can I change the MySQL version?
- The version is fixed when you create the database. To move to a newer one, create a new database and move your data across.
Works well with
Related services
Create a MySQL
database.
Start with one server and a router. Billed by the second.