Miget is now Lyngbak. Same platform, same plans, same API.Why the name →

Startups get $300 or more in Lyngbak credits.Apply →

Moving production infrastructure? We migrate it for you, free.Talk to us →

PricingEnterpriseDashboard
Start for Free
← All templates

MariaDB Replication

Asynchronous primary/replica MariaDB - a writable primary streaming to a read-only replica.

2 GiB

2 services, 20 GB disk

$11.50/mo

flat resource

$0.025/h

Usage Billing

What is MariaDB Replication?

This is classic asynchronous MariaDB replication: one primary accepts writes and streams its binary log to a read-only replica. It is the standard topology for read-scaling (send reads to the replica) and for keeping a hot standby copy of your data.

The official MariaDB image wires it from environment variables - the primary creates the replication user automatically, and the replica configures itself against the primary and starts replicating on first boot, so there are no init scripts. The replica is started read-only.

Replication is asynchronous: the replica can lag slightly under load, and a failed primary does not auto-promote (that is a manual or external-tooling step). For synchronous, automatic multi-primary HA, use mariadb-galera.

What you get

  • Writable primary + read-only replica
  • Binlog replication wired from environment variables
  • No init scripts - the image configures the replica
  • Read-scaling and hot-standby topology
  • Both nodes internal-only
  • GPLv2

How it runs on Lyngbak

ServiceRolePublic
mariadb-primarywritable primary (:3306)no (internal)
mariadb-replicaread-only replica (:3306)no (internal)

Before you deploy

  • MARIADB_ROOT_PASSWORD

    root password (same on both nodes)

  • MARIADB_PASSWORD

    app user password

  • MARIADB_REPLICATION_PASSWORD

    replication account password

Sizing and billing

1 GiB per node suits typical workloads. The replica holds a full copy of the data, so size both volumes the same. Asynchronous - expect small replica lag under load.

Hobby resource$11.50/mo1 vCPU, 1 GiB + 1 GiB RAM add-on, 20 GiB disk incl. add-on, shared CPU
Pro resource$26.50/mo1 vCPU, 2 GiB, 20 GiB disk incl. add-on, dedicated CPU
Usage Billing, shared CPU$0.025/h1 vCPU, 2 GiB reserved. $18/mo for a full month, billed by the second.
Usage Billing, dedicated CPU$0.094/h2 vCPU, 4 GiB reserved. $68/mo for a full month, billed by the second.

A resource is a flat monthly price, with RAM and disk add-ons when the stack needs a little more than a tier, and room for your own apps on a larger one. On Usage Billing each service takes the smallest size that fits it and is billed by the second it runs, so a stopped stack stops costing CPU and RAM. Its 19.53 GiB of volumes cost $0.15 per GiB a month ($2.93/mo) for as long as they exist. One workspace can use both. See pricing

Compared with the managed service

ServicePlanPriceIncludes
AWS RDSprimary + read replica$30/motwo smallest instances/mo + storage

A managed read replica is a second billed instance; here the primary + replica is one stack, billed for the compute it reserves. Prices from each vendor's pricing page, June 2026.

Run it locally first

The same compose file runs with plain Docker Compose. Clone the template source, copy .env.example to .env, and run docker compose up -d.

Questions

What is this good for?

Read-scaling (route read-heavy queries to the replica to offload the primary) and keeping a hot standby copy of your database. It is the most common MySQL/MariaDB replication setup.

Does it fail over automatically?

No. Asynchronous replication does not auto-promote the replica if the primary dies - promotion is a manual or tooling-driven step. For automatic failover use mariadb-galera (synchronous multi-primary).

How is the replica set up?

Automatically. The official image creates the replication user on the primary and, on the replica, configures replication against MARIADB_MASTER_HOST and starts it on first boot - no scripts to run.

More in Databases

ClickHouse Cluster

3-node ClickHouse cluster - one shard, three replicas, embedded Keeper. Real replicated OLAP without ZooKeeper pods.

Open the template →

MariaDB

The community MySQL fork, as a single self-hosted node - drop-in compatible.

Open the template →

MariaDB Galera

3-node synchronous multi-primary MySQL-family HA on the official image - every node writes, any node can die.

Open the template →
MariaDB primary/replica replication on Lyngbak | Lyngbak (formerly Miget)