---
title: "MySQL hosting on Edge | MySQL or MariaDB on real VMs"
description: "Run MySQL or MariaDB on Edge: dedicated vCPUs and local NVMe, GTID replication on a free private network and backups in S3-compatible storage. No IOPS bills."
url: https://edge.network/solutions/mysql
---

For MySQL

# MySQL with GTID replicas on a private network

MySQL or MariaDB on dedicated vCPUs and local NVMe, with GTID replication over a free private network and dumps and binlogs shipped to S3-compatible storage. The classic LAMP database, run properly.

[Deploy a VM](/console/access/new?product=compute)[Have our engineers run MySQL](/solutions/expert-services)

The setup on this page costs $79.94 a month, with no egress line.

Why MySQL on Edge

## InnoDB on local NVMe, tuned by you

MySQL lives on disk, memory and network. Here none of them comes with a pricing tier.

-   ### NVMe with no IOPS bills
    
    Local NVMe on every VM. No burst credits, no provisioned IOPS and no throttling on the busiest night of the month.
    
-   ### Replication, your way
    
    Async, semi-sync or Group Replication between VMs on a private network. Same MySQL features, none of the lock-in.
    
-   ### Binlogs and dumps to S3
    
    Ship binary logs and nightly dumps to Edge Storage for point-in-time recovery, priced like storage rather than snapshots.
    
-   ### MariaDB or Percona if you prefer
    
    Same install pattern, different package. Run MySQL, MariaDB or Percona Server; it's your VM and your call.
    
-   ### Tune it yourself
    
    Size innodb\_buffer\_pool\_size to the RAM you have, pick your engines and plugins, and benchmark with sysbench on real hardware.
    
-   ### Private by default
    
    Bind to the private interface and open 3306 only to your network range. The database never faces the internet.
    

Reference architecture

## A GTID primary with one async replica

A primary on local NVMe, an async replica on a second VM, and dumps and binlogs in a bucket. Standard MySQL operations, on fast disk.

-   [Compute](/compute)
    
    Runs MySQL or MariaDB on a VM with its data directory on local NVMe.
    
-   [Compute](/compute)
    
    An optional async replica on a second VM, fed over the private network.
    
-   [Storage](/storage)
    
    Holds nightly dumps and the binary log archive for point-in-time recovery.
    
-   [DNS](/dns)
    
    A db. record for the primary's private address, so failover is one record change.
    

Deploy

## Primary and replica from one bootstrap script

Save one bootstrap script, create two VMs from it, and connect them with GTID replication.

1.  01
    
    ### Save a MySQL bootstrap
    
    ${server\_id} is a script parameter, filled in per VM when it's created. Ubuntu 24.04 ships MySQL 8.0; swap the package for mariadb-server if you prefer.
    
    mysql.sh
    
    ```
    #!/bin/bash
    set -e
    export DEBIAN_FRONTEND=noninteractive
    apt-get update && apt-get install -y mysql-server
    cat > /etc/mysql/mysql.conf.d/edge.cnf <<'EOF'
    [mysqld]
    bind-address               = 0.0.0.0
    server_id                  = ${server_id}
    log_bin                    = mysql-bin
    gtid_mode                  = ON
    enforce_gtid_consistency   = ON
    binlog_expire_logs_seconds = 604800
    innodb_buffer_pool_size    = 5G
    EOF
    systemctl restart mysql
    ```
    
2.  02
    
    ### Create the primary and a replica
    
    Attach both VMs to one private network, and add a security group that allows 3306 from 10.185.0.0/24 only.
    
    shell
    
    ```
    $ edge compute scripts create --name mysql-8 --file mysql.sh
    
    $ edge compute create --name mysql-1 --size s-4vcpu-8gb \
        --image ubuntu-24 --region london \
        --script mysql-8 --script-param server_id=1
    $ edge compute create --name mysql-2 --size s-4vcpu-8gb \
        --image ubuntu-24 --region london \
        --script mysql-8 --script-param server_id=2
    ```
    
3.  03
    
    ### Start GTID replication
    
    Create a repl user on mysql-1 with REPLICATION SLAVE, then point mysql-2 at it. Seed the replica from a backup first if you already have data.
    
    mysql-2
    
    ```
    CHANGE REPLICATION SOURCE TO
      SOURCE_HOST = '10.185.0.3',
      SOURCE_USER = 'repl',
      SOURCE_PASSWORD = '<pw>',
      SOURCE_AUTO_POSITION = 1,
      SOURCE_SSL = 1;
    START REPLICA;
    SHOW REPLICA STATUS\G
    ```
    
4.  04
    
    ### Ship dumps and binlogs to Edge Storage
    
    Run both from cron on the replica or the primary. Any S3 tool works; this uses the AWS CLI with the Edge endpoint.
    
    shell
    
    ```
    $ mysqldump --all-databases --single-transaction \
        --source-data=2 --routines --triggers | gzip | \
      aws s3 cp - s3://mysql-backups/dumps/$(date +%F).sql.gz \
        --endpoint-url https://storage.edge.network
    
    $ aws s3 sync /var/lib/mysql/ s3://mysql-backups/binlogs/ \
        --exclude "*" --include "mysql-bin.*" \
        --endpoint-url https://storage.edge.network
    ```
    

Prefer to hand it off? [Give the job to your AI agent](/solutions/agentic-development) or [have our engineers do it](/solutions/expert-services).

What it costs

## A replicated MySQL pair, itemised

Two VMs and a bucket. No instance-hour premium, no snapshot storage premium and no charge for the replication traffic between them.

-   No per-IOPS or per-snapshot lines
-   Replication traffic on the private network is free
-   MySQL, MariaDB or Percona at the same price

[See compute pricing](/compute/pricing)

Estimated monthly bill on Edge

Primary and async replica, ~100 GB of data, 7 days of dumps and binlogs

USD

-   Primary VM$38.47Performance: 4 vCPU, 8 GiB, 160 GB NVMe
-   Replica VM$38.47Performance: 4 vCPU, 8 GiB, 160 GB NVMe
-   Storage$3.00205 GB of dumps and binlogs: first 5 GB free, then 200 GB × $0.015
-   DNS$0.00Private record for the primary
-   Egress$0.00

Total$79.94

FAQ

## Replicas, backups and leaving RDS

Something else? [Ask an engineer](/contact).

How does this compare to RDS MySQL or Aurora?

Cheaper, with no per-instance-hour markup or snapshot fees, and faster on like-for-like hardware thanks to local NVMe. The trade-off: you own backups, upgrades and HA, or our Expert Services team does.

MySQL or MariaDB?

Either. Most apps that say MySQL run unchanged on MariaDB, and the install pattern is the same. Pick the one your team knows best.

How do I do high availability?

An async replica gives you read scaling and a warm standby. Use semi-sync or Group Replication when you need stronger guarantees, and Orchestrator, MySQL Router or MaxScale for automated failover.

What about backups?

Logical: mysqldump or mydumper to Edge Storage. Physical: Percona XtraBackup or MariaDB Backup. Either way, archive the binlogs too for point-in-time recovery.

How do my apps connect?

Set DB\_HOST to the primary's private IP, or to a DNS record pointing at it. Apps in the same region connect over the private network; add ProxySQL if you want reads split to the replica.

Related stacks

## Other databases, plus BookStack on MySQL

[All 38 stacks](/solutions/stacks)

-   [RedisIn-memory cache and queue, your way](/solutions/redis)
-   [PostgreSQLSelf-hosted Postgres on dedicated NVMe](/solutions/postgresql)
-   [MongoDBSelf-hosted document store with replica sets](/solutions/mongodb)
-   [BookStackOpen-source documentation platform](/solutions/bookstack)

## Run your next MySQL primary on NVMe

Start free. Migrate from RDS or stand up a fresh primary; Expert Services can plan the cutover.

[Deploy a VM](/console/access/new?product=compute)[Have our engineers move MySQL](/solutions/expert-services)

Billed hourly from a prepaid balance. Egress is free on every product.
