Mafiree logo
  • About
  • Services
  • Blogs
  • Careers
  • Products
    • orbit logo Orbit
    • streamer logo Xstreami
  • Contact
Schedule a Call
Menu
  • About
  • Services
  • Blogs
  • Careers
  • Products
    • orbit logo Orbit
    • streamer logo Xstreami
  • Contact
  • Schedule a Call
Database
Database Managed Database Services
MySQL MySQL
MySQL Consulting
MySQL Migration Services
MySQL Optimization & Query Tuning
MySQL Database Administration
MySQL Backup & Recovery
MySQL Security & Maintenance
MySQL Cloud Services (AWS RDS, Aurora, Google Cloud SQL, Azure)
MySQL for Ecommerce
MySQL High Availability & Replication
MongoDB MongoDB
MongoDB Consulting
MongoDB Migration Services
MongoDB Optimization & Query Tuning
MongoDB Database Administration
MongoDB Backup & Recovery
MongoDB Security & Maintenance
MongoDB Cloud (Atlas)
MongoDB Solutions by Industry
MongoDB High Availability & Replication
PostgreSQL PostgreSQL
PostgreSQL Consulting
PostgreSQL Migration & Upgrades
Performance Tuning & Query Optimization
PostgreSQL Administration & Managed Services
High Availability, Clustering & Replication
PostgreSQL Backup, Recovery & Disaster Planning
PostgreSQL Security, Compliance & Auditing
PostgreSQL for Analytics & Data Warehousing
PostgreSQL on Cloud & Containers
PostgreSQL Extensions & Open-Source Integrations
PostgreSQL for Every Industry
SQL Server MSSQL
MSSQL Consulting
MSSQL Migration Services
MSSQL Optimization & Query Tuning Services
MSSQL Database Administration Services
MSSQL Backup & Recovery Services
MSSQL High Availability & Replication Services
MSSQL Security & Compliance Services
MSSQL Performance Monitoring & Health Checks
MSSQL Solutions by Industry
Aerospike Aerospike
Aerospike Consulting
Aerospike Migration Services
Aerospike Performance Optimization & Tuning
Aerospike Backup & Recovery
Aerospike High Availability
Aerospike Cloud & Hybrid Deployments
Aerospike for Real-Time Applications (AdTech, FinTech, Retail, IoT)
Clickhouse Clickhouse
ClickHouse Consulting
ClickHouse Migration Services
ClickHouse Optimization & Query Tuning
ClickHouse Database Administration
ClickHouse Backup & Recovery
ClickHouse Security & Maintenance
ClickHouse Cloud Services (ClickHouse Cloud, AWS, GCP, Azure)
ClickHouse Solutions by Industry
ClickHouse High Availability & Replication
TiDB TiDB
TiDB Consulting
TiDB Administration & Maintenance
TiDB Security and Privacy Maintenance
TiDB Performance & Query Optimization
TiDB Migration Services
TiDB Backup & Disaster Recovery
TiDB High Availability Solutions
TiDB Solutions by Industry
TiDB Cloud Services
ScyllaDB ScyllaDB
ScyllaDB Consulting
ScyllaDB Administration & Maintenance
ScyllaDB Security and Privacy Maintenance
ScyllaDB Performance & Query Optimization
ScyllaDB Migration Services
ScyllaDB Backup & Disaster Recovery
ScyllaDB High Availability Solutions
ScyllaDB Solutions by Industry
ScyllaDB Cloud Services
DevOps
DevOps DevOps Services
Version Control Version Control
Kubernetes Kubernetes
Infrastructure Infrastructure Management
Web Servers Web Servers
Networking
Networking Networking Services
Basic Basic
Advanced Advanced
MySQL MySQL
MongoDB MongoDB
PostgreSQL PostgreSQL
MSSQL MSSQL
Aerospike Aerospike
Clickhouse Clickhouse
TiDB TiDB
ScyllaDB ScyllaDB
Version Control Version Control
Kubernetes Kubernetes
Infrastructure Infrastructure Management
Web Servers Web Servers
Basic Basic
Advanced Advanced
MySQL Consulting
MySQL Migration Services
MySQL Optimization & Query Tuning
MySQL Database Administration
MySQL Backup & Recovery
MySQL Security & Maintenance
MySQL Cloud Services (AWS RDS, Aurora, Google Cloud SQL, Azure)
MySQL for Ecommerce
MySQL High Availability & Replication
MongoDB Consulting
MongoDB Migration Services
MongoDB Optimization & Query Tuning
MongoDB Database Administration
MongoDB Backup & Recovery
MongoDB Security & Maintenance
MongoDB Cloud (Atlas)
MongoDB Solutions by Industry
MongoDB High Availability & Replication
PostgreSQL Consulting
PostgreSQL Migration & Upgrades
Performance Tuning & Query Optimization
PostgreSQL Administration & Managed Services
High Availability, Clustering & Replication
PostgreSQL Backup, Recovery & Disaster Planning
PostgreSQL Security, Compliance & Auditing
PostgreSQL for Analytics & Data Warehousing
PostgreSQL on Cloud & Containers
PostgreSQL Extensions & Open-Source Integrations
PostgreSQL for Every Industry
MSSQL Consulting
MSSQL Migration Services
MSSQL Optimization & Query Tuning Services
MSSQL Database Administration Services
MSSQL Backup & Recovery Services
MSSQL High Availability & Replication Services
MSSQL Security & Compliance Services
MSSQL Performance Monitoring & Health Checks
MSSQL Solutions by Industry
Aerospike Consulting
Aerospike Migration Services
Aerospike Performance Optimization & Tuning
Aerospike Backup & Recovery
Aerospike High Availability
Aerospike Cloud & Hybrid Deployments
Aerospike for Real-Time Applications (AdTech, FinTech, Retail, IoT)
ClickHouse Consulting
ClickHouse Migration Services
ClickHouse Optimization & Query Tuning
ClickHouse Database Administration
ClickHouse Backup & Recovery
ClickHouse Security & Maintenance
ClickHouse Cloud Services (ClickHouse Cloud, AWS, GCP, Azure)
ClickHouse Solutions by Industry
ClickHouse High Availability & Replication
TiDB Consulting
TiDB Administration & Maintenance
TiDB Security and Privacy Maintenance
TiDB Performance & Query Optimization
TiDB Migration Services
TiDB Backup & Disaster Recovery
TiDB High Availability Solutions
TiDB Solutions by Industry
TiDB Cloud Services
ScyllaDB Consulting
ScyllaDB Administration & Maintenance
ScyllaDB Security and Privacy Maintenance
ScyllaDB Performance & Query Optimization
ScyllaDB Migration Services
ScyllaDB Backup & Disaster Recovery
ScyllaDB High Availability Solutions
ScyllaDB Solutions by Industry
ScyllaDB Cloud Services
  1. Home
  2. > Blogs
  3. > Proxysql
  4. > Top ProxySQL Features Every DBA Should Know

Top ProxySQL Features Every DBA Should Know

ProxySQL provides several features to improve the performance, flexibility, and security of MySQL environments. This blog covers query caching, query routing, query mirroring, query rewriting, and data masking, along with how these features can help manage database traffic, optimize queries, test changes, and protect sensitive data.

sukan September 10, 2026

Subscribe for email updates

Summarize with AI: ChatGPT Google AI Perplexity Claude Grok

Features in ProxySQL

  • Query Caching
  • Query Routing
  • Mirroing
  • Query Rewrite
  • Data Masking

Query Caching

Query caching is a feature to store the results of the repeated set of queries so that results can be returned quickly to the application/end user and can reduce the disk seek time. You may raise a question, why not MySQL query cache? Its because MySQL cannot scale to a certain level due to its locking and invalidation algorithms.

 

ProxySQL address this issue MySQL has and its caching technique are entirely different from MySQL. Caching mechanism works on basis of query rules that we set. DBA can decide which query to cache and which not to. Caching is based on in-memory key/value.

 

Query Routing

Query Routing feature is used to identify the type (read or write) of hits and route the traffic accordingly to DB servers. Rules can be defined in ProxySQL on how to route the traffic to DB servers. No application changes required for read and write split.

Let’s see some sample rules;

- Can define rules such a way that reads can go to slave and writes to master.
- In case, Galera or Group replication we can share reads / writes to all the nodes or writes to one node and reads to all nodes.
- Can set the weight of traffic to DB servers like 50:50 ratios, 30:70 ratios etc.
- Let us say, we have reporting queries which needs to be pointed to a seperate server. It can be done.
- Basically, query routing (QR) can be based on host name, usernames, regular expressions and digest.
 

Mirroring


Query Mirroring is about sending the queries or traffic to the muliple backend. We can mirror the queries to different servers added in a hostgroup. The question comes why do we need to mirror, when there is already query routing in place. Let’s say that you are having an old version of MySQL, and you have a plan to upgrade it to a latest version but not sure how the latest version is performing. In these cases, query mirroring will be helpful as it mirrors the live traffic without making changes in the application end

Work flow: When ProxySQL receives a query, it will get passed to query processor which identifies whether the queries is mirrored, if so then it duplicates the whole MySQL session and associates it to a mirror queue. If the pool is free then the query will be processed else it stays in the queue. If the queue is full then the query will be lost.This will help if you want to check the query performance across different versions of MySQL without disturbing the application. Do not use this feature for replicating data as this cannot maintain consistency.

 

Query Rewrite

Quite often we have seen that very bad queries hitting the db and causing the entire db to slow down or sometimes bring the server down! Trying to make the changes for these offending queries takes a bit of time and sometimes forever.

ProxySQL query rewrite enables to rewrite a query dynamically. When a replace pattern is added to a match_pattern, ProxySQL will rewrite the query dynamically by replacing the orginal pattern with the modifed one.

 

Data Masking

This is an important features of ProxySQL that helps in masking of data. Certain high secured data can be kept hidden. It generally involves restricting the user privileges for a particular user to whom the data must be hidden. ProxySQL masks the confidential data, by not exposing them to the users who have the access to the data. Let’s consider an example by which some of the credit card details are hidden from the users by masking them.

 

These are some of the features of ProxySQL. There are lot more advantages of ProxySQL such as

  • Connection multiplexing
  • Dynamic Query routing
  • Audit log support
  • LDAP!! [Expected]

Conclusion

ProxySQL provides DBAs with greater control over how MySQL traffic and queries are handled. Features such as query routing, caching, mirroring, rewriting, and data masking can help improve performance while reducing the need for application-side changes.

 

At Mafiree, we work with ProxySQL to help teams manage MySQL traffic more effectively, optimize query performance, and handle changing database workloads without unnecessary application changes.

 

FAQ

The main ProxySQL features include query routing, query caching, query rewriting, query mirroring, connection pooling and multiplexing, monitoring, load balancing, and high-availability support. These features allow database administrators to control and optimize database traffic without requiring major application-side changes.
ProxySQL query routing allows SQL queries to be directed to different backend database servers based on configurable rules. For example, read queries can be routed to replicas while write queries are sent to the primary server. Routing rules can also use criteria such as users, schemas, query patterns, regular expressions, and query digests.
Yes. ProxySQL can implement read/write splitting by routing read traffic to read replicas and write traffic to the primary database. This can help distribute workload and reduce the load on the primary server.
In many common deployments, ProxySQL can implement query routing without modifying application code. The application connects to ProxySQL, while routing decisions are handled through ProxySQL configuration and query rules.
ProxySQL query caching stores the results of selected queries in memory so that subsequent matching requests can potentially be served without executing the query again on the backend database. Cache rules can be configured to determine which queries should be cached.
ProxySQL implements its own query-cache mechanism outside the MySQL server. This allows caching decisions to be controlled at the proxy layer using query rules and avoids relying on the historical MySQL Query Cache implementation. ProxySQL's current documentation treats query caching as part of its query-handling capabilities.
Query mirroring allows traffic received by ProxySQL to be duplicated and sent to another backend. It can be useful for testing a new database version, evaluating query performance, or validating changes against production-like traffic without changing the application. Query mirroring should not be treated as a data-replication mechanism because it does not guarantee transactional or data consistency.
Query rewriting allows ProxySQL to modify matching SQL statements before they are sent to the backend database. Administrators can define matching patterns and replacement patterns to dynamically alter queries. This can be useful as a temporary mitigation for inefficient queries when changing the application immediately is difficult.

Author Bio

sukan

Sukan is Database Team Lead at Mafiree with over a decade of experience in database systems, architecture, and performance optimization. He specializes in MySQL, MongoDB, TiDB, and ClickHouse, developing architectural improvements that make data platforms faster, more efficient, and cost-effective. Sukan writes about practical database engineering topics, real-world performance tuning, data replication, and high-scale system design, drawing from extensive hands-on experience solving complex technical challenges.

Leave a Comment

Comments

T
Tamilselvan March 02, 2018

It is very helpful.

Related Blogs

ProxySQL 3.0 is Here: Top Features for MySQL & PostgreSQL Users

ProxySQL 3.0 introduces powerful capabilities like dynamic query routing, caching, multiplexing, and now PostgreSQL support. This blog explains how ProxySQL improves database performance, enables intelligent load balancing, and helps scale MySQL and PostgreSQL environments without application changes. Backed by real-world use cases from Mafiree, it provides practical insights into when and how to use ProxySQL effectively in production.

  2522 views
How ProxySQL Query Routing Works Dynamically

ProxySQL can help manage MySQL traffic and reduce the impact of unexpected database load. This blog explores a real-world case where a sudden CPU spike was traced to a frequently executed, unindexed query. By using ProxySQL to route the query to a replica, the load on the MySQL master was reduced without requiring immediate application changes.

  24403 views
Whats new in ProxySQL 2.0

Features of ProxySQL 2.0 Version

  3221 views
What Is ProxySQL? A Complete Overview

ProxySQL is one of the advanced software load balancer that we have in market. ProxySQL has an in-built abilty to identify the reads,writes and route the write traffic to master and read traffic between the available slaves. One occurence of a Replication delay or server crash or replication breakag

  2705 views

Subscribe for email updates

Get in touch with us

Highlights

More than 6000 Servers Monitored

Happy Clients

Certified DBAs

24 x 7 x 365 Support

PCI

Database Services

MySQL MongoDB PostgreSQL SQL Server Aerospike Clickhouse TiDB ScyllaDB

Quick Links

Careers Blog Contact Privacy Policy Disclaimer Policy

Contacts

Linkedin Mafiree Facebook Mafiree Twitter Mafiree

Nagercoil Office

Miru IT Park, Vallankumaranvillai,

Nagercoil, Tamilnadu - 629 002.

Bangalore Office

Unit 303, Vanguard Rise,

5th Main, Konena Agrahara,

Old Airport Road, Bangalore - 560 017.

Call: +91 6383016411

Email: sales@mafiree.com


Copyright © - All Rights Reserved - Mafiree