MultiConnectMultiConnectDocs Website home
MultiConnectCloud › Database Deployments

4. Topology and failover

Every database runs two copies of your data on different machines, whichever topology you pick. Topology decides what the reader endpoint is served by.

Topology Reader endpoint Choose it when
Standalone Served by the primary. The second copy is a hidden standby You want the simplest setup
Master-Read Replica Served by the second copy, which is read-only Your application does a lot of reading, such as reports, search or dashboards, and can send those queries to a separate endpoint

Topology cannot be changed after the database is created.

Even with Standalone, it is worth sending read-only work to the reader endpoint from the start. The endpoint already exists, so nothing changes if you need it later.

Reads can trail writes

Copying from the primary to the second copy is asynchronous. A row you have just written may not be on the reader for a short time, usually milliseconds, longer under heavy writes. Read your own writes from the writer, and send to the reader anything that can be slightly stale.

The reader endpoint refuses INSERT, UPDATE and DELETE. A read-only error from it means it is working, not failing.

The Connection section on the deployment's page shows Replica Lag. A lag that keeps growing means the second copy is not keeping up with your writes.

What a failover looks like from your side

If the machine running the primary fails, the second copy is promoted to primary.

What happens What you do
Every open connection to the old primary closes Nothing, if your connection pool discards dead connections and reconnects
New connections are refused for a short time Retry connection errors a few times with a short delay
The writer endpoint now reaches the promoted copy Nothing. The hostname and port are unchanged, and there is no DNS to wait for
Writes that had not yet reached the second copy are lost, usually a fraction of a second Make important writes safe to send again, or confirm them by reading them back
A new second copy is built Nothing. The Replica Status section shows Running on one copy of the data. until it is ready

Do not blindly retry a write after a dropped connection. It may already have committed, and an INSERT retried after a failover can insert twice.

After a failover, the Connection section shows Last Failover with the time and reason.

Failover Policy

Option What happens if the primary's machine fails
Automatic The second copy is promoted without you doing anything. This is the default and the right choice for almost everyone
Manual Nothing is promoted automatically, and the event is recorded on the deployment. The database stays unavailable until the primary's machine recovers, or until you ask MultiConnectCloud support to switch it to the second copy. There is no switch-over button on the dashboard

The policy is chosen when you create the database and cannot be changed afterwards. If a database fails over twice within an hour, it is switched to Manual automatically, because a failover loop loses data each time it repeats.