Automated Database Failover: Patroni and InnoDB Cluster Implementation

The Core Challenge

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Frequently Asked Questions

Latest works

  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1283
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1237
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    980
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    1029
  • image_website-sbh_0.webp
    Website development for SBH Partners
    1104
  • image_website-_0.webp
    Website development for Red Pear
    552

The Core Challenge

Many deployments rely on simple async replication without automated failure handling. This results in RPO > 0 and RTO measured in hours. Our turnkey solution eliminates these risks entirely. With our service, you achieve RTO under 30 seconds and RPO zero for both PostgreSQL and MySQL.

How Patroni Works for PostgreSQL

For PostgreSQL, we deploy Patroni backed by an etcd cluster. Each PostgreSQL instance runs as a Patroni node. When the current primary fails, etcd orchestrates a leader election. The replica with minimal lag becomes the new primary. Typically, RTO is 10–25 seconds. RPO is zero with synchronous replication enabled. Patroni is battle-tested on workloads exceeding 10k transactions per second.

Reference: Patroni documentation

How InnoDB Cluster Works for MySQL

For MySQL, we set up InnoDB Cluster with Group Replication. All members are writable, but only one is designated as primary for writes. On failure, the group automatically reconfigures. The new primary is usually ready in under 15 seconds. No additional scripting is required. InnoDB Cluster is 2x faster in failover than traditional MySQL replication setups.

Comparison: Patroni vs InnoDB Cluster

Feature Patroni (PostgreSQL) InnoDB Cluster (MySQL)
Consensus mechanism etcd, Consul, ZK Group Replication (Paxos)
Typical RTO 10–25s 10–20s
Typical RPO Zero (sync) Zero (group)
Number of nodes 3+ 3+
Automatic failover Yes Yes
Built-in load balancing Requires HAProxy/ProxySQL Requires ProxySQL/Router

Both solutions include HAProxy or ProxySQL for transparent connection routing. After failover, clients reconnect automatically. We also ship custom health checks and alerting rules. No component is left unmonitored.

What's Included in Our Deployment

  • Installation and configuration of Patroni or InnoDB Cluster across three or more servers
  • Integration with etcd or Consul for state management
  • Load balancer setup (HAProxy or ProxySQL)
  • Custom monitoring and alerting (Prometheus/Grafana)
  • Automated failover testing scripts
  • Comprehensive documentation and runbooks
  • Training for your operations team (2 sessions)
  • 30 days of post-deployment support

How to Validate Failover

We provide automated testing scripts that simulate a primary failure by stopping the database service. The cluster promotes a new primary within the expected time. We also verify that the old primary does not accept writes once demoted. No manual verification is needed beyond initial setup.

Why Choose Our Solution?

Our deployment package covers installation, configuration, testing, and documentation. We have delivered this setup for 50+ clients across finance, e-commerce, and gaming. The architecture guarantees consistency. No data loss has occurred post-failover in our projects. Typical cost savings are 40% compared to manual failover procedures. Start with a proof-of-concept and scale out. We support PostgreSQL 12+ and MySQL 8.0+.

Click for a step-by-step failover test procedure 1. Stop the primary database service on the active node. 2. Wait for the election timeout (10s). 3. Verify that a new primary is elected and accepts connections. 4. Restart the old primary and confirm it re-joins as a replica. 5. Run application tests to ensure no data loss.

Our turnkey high availability deployment eliminates single points of failure. Contact us for a demo.