explaingit

sysown/proxysql

6,806C++Audience · ops devopsComplexity · 4/5LicenseSetup · hard

TLDR

A high-performance intermediary that sits between your application and a MySQL database to distribute queries across multiple servers, pool thousands of connections, and route traffic without changing any application code.

Mindmap

mindmap
  root((proxysql))
    What it does
      Proxy MySQL traffic
      Route queries
      Pool connections
    Routing rules
      Reads to replicas
      Writes to primary
      Custom regex rules
    Compatible databases
      MySQL
      MariaDB
      Percona Server
    Use cases
      High-traffic production
      Connection overload relief
      Zero-code query routing
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Distribute MySQL read queries across multiple replica servers to reduce load on the primary database

USE CASE 2

Pool thousands of application connections so the MySQL server is not overwhelmed by too many direct open connections

USE CASE 3

Route write queries to the primary and read queries to replicas automatically without changing any application code

USE CASE 4

Handle high-traffic MySQL workloads that open-source alternatives could not support in production environments

Tech stack

C++MySQLMariaDBPercona Server

Getting it running

Difficulty · hard Time to first run · 1day+

Requires configuring MySQL replication and ProxySQL's admin interface, documentation is on the external wiki, not the README.

GPL license, free to use and modify, but distributing modified versions requires releasing your source code under the same GPL terms.

In plain English

ProxySQL is a piece of software that sits between your application and your MySQL database, acting as an intermediary that handles incoming database connections. Rather than your application talking directly to the database server, it talks to ProxySQL first, which then forwards queries along. This arrangement allows ProxySQL to do things like distribute queries across multiple database servers, route certain types of queries to specific servers, and keep connections pooled so the database is not overwhelmed. The project was created because the developers found existing open-source options insufficient for high-traffic production environments. It supports MySQL and its close relatives, including Percona Server and MariaDB. It is written in C++ and released under the GPL license. The README for this repository is minimal, pointing to the project's website, a blog with benchmarks, a community forum, and a wiki for documentation. For detailed configuration guidance and technical documentation, the wiki linked from this repository is the primary resource.

Copy-paste prompts

Prompt 1
Set up ProxySQL to route all SELECT queries to my two MySQL read replicas and all writes to the primary, show me the admin SQL commands to configure hostgroups and query rules
Prompt 2
My app opens too many direct MySQL connections and the server is overwhelmed. Walk me through configuring ProxySQL connection pooling to fix this without changing app code
Prompt 3
Queries are not routing correctly to my replicas in ProxySQL. Here is my hostgroup config, what is wrong and how do I fix it?
Prompt 4
How do I monitor active queries, connection counts, and query routing in ProxySQL through its admin interface?
Open on GitHub → Explain another repo

← sysown on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.