Platform feature · ProxySQL

A database that holds through sale-day spikes.

Add application servers and a Magento store still stops at the same place: the database. ProxySQL sits between your store and its database, pooling connections, caching repeated queries, and routing selected reads to a replica, so the primary keeps its capacity for checkout.

Plays from YouTube when you press play. Watch on YouTube

Meet Magento Florida 2026 · 27 min

How ProxySQL unlocks database scalability for Magento

Pradip Shah, co-founder of luroConnect, on the technical track: what we run in front of the database on our busiest stores, and where it stops helping.

  • Why Magento hits the database wall first, and why a high-availability cluster doesn’t move it
  • Connection pooling: the one-thread-per-connection problem, before and after
  • Four ways to put ProxySQL in front of a cluster or replica, and why the obvious one fails for Magento
  • How we pick which queries a replica may answer, and what we saw over Black Friday
  • The caveats: where ProxySQL makes a store slower, and what it costs to run

Why the database

More servers won’t fix a database that’s out of breath.

Magento reads far more than it writes

Every page bootstrap fires a burst of queries, and browsing traffic dwarfs cart and checkout. The read load grows with every shopper, long before writes do.

Locks make every query wait longer

Transactions that stay open while PHP code runs, and locking reads, hold rows while everything else queues behind them. A busier database is a slower one.

A cluster buys availability, not scale

Popular high-availability plans balance load across application servers, not database servers. You get a standby if a node fails; you don’t get more database.

What ProxySQL does

Less work for the database, without touching your code.

Magento connects to ProxySQL as if it were the database. Every query passes through its rules, which can pool, cache or route it.

Connection pooling

Fewer connections for the database to juggle

MySQL and MariaDB run one thread per connection, so hundreds of PHP workers mean hundreds of threads for the operating system to schedule. ProxySQL multiplexes them onto a small pool of reused connections.

Query caching

Repeated queries answered without the database

Rules can hold the result of a matching query for a set number of milliseconds, so a storm of identical catalog reads becomes one.

Query routing

Selected reads answered by a replica

Queries that are safe to answer from a copy can be routed to a read-only replica, so the primary keeps its capacity for checkout and writes.

CPU usage of a 48-core database server over twelve days. Before connection pooling, frequent spikes reach 3,000 to 4,400 percent, much of it system CPU. After, usage stays mostly between 200 and 1,000 percent with almost no system CPU.
Database server CPU before and after connection pooling. Green is time the operating system spent juggling database threads; with pooling it all but disappears.

Four ways to scale reads

The obvious read/write split doesn’t work for Magento.

ProxySQL can sit in front of a Galera cluster or a primary with replicas. Each layout trades something away.

Layout What you get The catch
Galera cluster, every query load-balanced True load balancing and good read performance. Expensive and complex: at least three nodes, then five, seven. Writes get slower because every node must agree.
Galera cluster, reads balanced, writes to one node Better write performance. Gives up the high availability you bought the cluster for.
Primary + replica, automatic read/write split Built into ProxySQL; one setting. A read straight after a write can land on a replica that hasn’t caught up yet. For a store, that race makes it a non-starter.
Primary + replica, selected reads routed What we run Chosen reads go to the replica; writes and everything else stay on the primary. Slow to set up: rules are written per store, from its own query statistics.

How we choose

Which queries a replica may answer.

ProxySQL records statistics for every normalised query. We read those for your store and write rules from them:

  • Queries are grouped by the tables they touch. Quote, sales and index tables never go to the replica.
  • Rules match the exact fingerprint of a query (ProxySQL’s digest hash), not a regular expression that might catch the wrong thing.
  • Admin and cron servers skip the routing rules entirely, so back-office work always sees the primary.
  • The replica’s InnoDB buffer pool is sized to hold every table routed to it.
  • As queries move, we check the replica’s query cache and the process list for lock contention.

Each database server keeps its own query cache, so routing reads gives the store caches that work in parallel. In our experience, adding CPU by sending queries to a replica gives more throughput than adding the same CPU to the primary.

Not all roses

When ProxySQL isn’t the right tool.

Quiet stores get slower

A proxy is an extra hop. Without the concurrency to pay for it, a not-so-busy store loses a little speed. That is why ProxySQL sits in the High Traffic band, not every plan.

The replica has to be watched

If the replica falls behind the primary, the routing rules come off and its queries go back to the primary until it catches up.

Configuration is manual and easy to get wrong

ProxySQL keeps settings in three places (config file, runtime, on-disk store), and each table has its own load and save commands.

Fingerprints need upkeep

The same query can fingerprint differently across database versions, so rules are rechecked when the database is upgraded.

Writing rules by hand is slow, careful work. We are building tooling to make it declarative: rules kept as a file, compared against what is live and applied automatically, with query statistics used to suggest candidates.

Frequently asked questions

Do I need to change my Magento code?

No. ProxySQL speaks the MySQL protocol, so the store connects to it exactly as it would to the database. The change is one connection setting, made by us.

Are all read queries sent to the replica?

No. An automatic read/write split is unsafe for Magento, because a read straight after a write can reach a replica that has not caught up. We route only queries we have selected from your store’s own statistics; writes, cart, checkout and order data stay on the primary.

Is ProxySQL right for every store?

No. On a quiet store the extra hop costs more than pooling saves. It earns its keep under concurrency: sale days, campaigns, heavy catalog browsing. It is part of the High Traffic band and available as an add-on elsewhere.

Does it work with MariaDB and MySQL?

Yes. ProxySQL sits in front of either, and in front of a single server, a primary with replicas, or a Galera cluster.

What happens if the replica falls behind?

The routing rules come off and those queries go back to the primary until the replica catches up. Shoppers see the primary’s answer, never a stale one.

Do I need a read replica to benefit?

No. Connection pooling and query caching work against a single database server. Routing reads needs a replica, which is a separate add-on.

Is your database the wall on sale day?

ProxySQL is part of the High Traffic band and an add-on in the others. Your store runs in your own AWS or GCP account. Tell us about your peak and we’ll tell you honestly whether ProxySQL would help.