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 Database Managed Services
MySQL MySQL
MySQL Consulting Services
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 Services
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 Services
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 Services
Aerospike Migration Services
Aerospike Performance Optimization & Tuning
Aerospike Database Administration
Aerospike Backup & Recovery
Aerospike High Availability
Aerospike Cloud & Hybrid Deployments
Aerospike for Real-Time Applications (AdTech, FinTech, Retail, IoT)
Analytics DB
Analytics DB Analytics DB Services
Clickhouse Clickhouse
ClickHouse Consulting Services
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 & Architecture Planning
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 & Architecture Planning
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 Services
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 Services
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 Services
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 Services
Aerospike Migration Services
Aerospike Performance Optimization & Tuning
Aerospike Database Administration
Aerospike Backup & Recovery
Aerospike High Availability
Aerospike Cloud & Hybrid Deployments
Aerospike for Real-Time Applications (AdTech, FinTech, Retail, IoT)
ClickHouse Consulting Services
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 & Architecture Planning
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 & Architecture Planning
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. > ProxySQL Features

ProxySQL Features

Query Caching - Query Routing - Mirroring - Query Rewrite - Data Masking

sukan February 16, 2018

Subscribe for email updates

In my previous blog, I have explained ProxySQL as a load balancer. In this blog, let’s see the features that ProxySQL have :

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.

Summary :

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]

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.

  9 views
Dynamic query routing with ProxySQL

How ProxySQL helps in achieving query routing without making a application changes.

  25432 views
Whats new in ProxySQL 2.0

Features of ProxySQL 2.0 Version

  2481 views
What is ProxySQL

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

  3425 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 MariaDB Columnstore

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