SlideShare a Scribd company logo
DATABASE PROXIES
CRASH COURSE
ALEJANDRO DUARTE
Developer Advocate
MariaDB
alejandro_du
Software Engineer · Author · DevRel
WHO IS THIS GUY?
AGENDA
1. What is a database proxy
2. Scaling reads
3. Other use cases
4. Disadvantages & advantages
alejandro_du
WHAT IS A PROXY?
alejandro_du
PROXY
alejandro_du
Client Server
Proxy
PROXY
alejandro_du
Client Server
Proxy
Hello,
Server
Hello,
Client
PROXY
alejandro_du
Client Server
Forward Proxy
PROXY
alejandro_du
Client Server
Reverse Proxy
PROXY
alejandro_du
Client Server
+ High Availability
+ Scalability
+ Integrations
+ Security
Reverse Proxy
WHAT IS A
DATABASE PROXY?
alejandro_du
DATABASE PROXY
alejandro_du
Web Server Database
SQL
SQL
+ High Availability
+ Scalability
+ Integrations
+ Security
Database Proxy
CONCEPTS AND
ARCHITECTURE
alejandro_du
MAXSCALE: ARCHITECTURE
alejandro_du
Protocol
Client
Filter Filter
CORE
Parser
Router
Uses
Protocol Monitor
Monitors
Updates
Cluster state
Database cluster
MAXSCALE: CONFIGURATION
alejandro_du
● .cnf (and .json) files [maxscale]
threads=auto
admin_host = 0.0.0.0
admin_secure_gui = false
[node1]
type=server
address=10.0.0.2
port=3306
protocol=MariaDBBackend
[node2]
type=server
address=10.0.0.3
port=3306
protocol=MariaDBBackend
$ maxctrl create server node1 10.0.0.2
$ maxctrl create server node2 10.0.0.3
$ maxctrl create server node3 10.0.0.4
$ maxctrl create monitor 
mdb_monitor mariadbmon 
--monitor-user monitor_user 
--monitor-password 'monitor_pw' 
--servers node1 node2 node3
$ maxctrl create service query_router_service 
readwritesplit 
user=maxscale 
password=password 
--servers node1 node2 node3
MAXSCALE: CONFIGURATION
alejandro_du
● .cnf (and .json) files
● Command line (maxctrl)
MAXSCALE: CONFIGURATION
alejandro_du
● .cnf (and .json) files
● Command line (maxctrl)
● REST
$ cat new_server.txt
{
"data": {
"id": "node4",
"type": "servers",
"attributes": {
"parameters": {
"address": "10.0.0.1",
"port": 3306
}
}
}
}
$ curl -X POST -d @new_server.txt 
127.0.0.1:8989/v1/servers
MAXSCALE: CONFIGURATION
alejandro_du
● .cnf (and .json) files
● Command line (maxctrl)
● REST
● Web GUI
alejandro_du
alejandro_du
alejandro_du
alejandro_du
alejandro_du
SCALING READS
alejandro_du
READ-WRITE SPLITTING
alejandro_du
MariaDB Replication
Primary Replica
alejandro_du
READ-WRITE SPLITTING
alejandro_du
MariaDB Replication
Primary Replica
Writes Reads
Web application
Replica
Web application
jdbc:mariadb:replication://primary,rep1,rep2/db
!
READ-WRITE SPLITTING
alejandro_du
MariaDB Replication
Primary Replica Replica
Web application
SQL
Writes Reads
jdbc:mariadb://maxscale/db
TOPOLOGY ISOLATION
alejandro_du
Web application
SQL
jdbc:mariadb://maxscale/db
TOPOLOGY ISOLATION
alejandro_du
Web application
SQL
jdbc:mariadb://maxscale/db
Primary
TOPOLOGY ISOLATION
alejandro_du
Web application
SQL
jdbc:mariadb://maxscale/db
X
TOPOLOGY ISOLATION
alejandro_du
Web application
SQL
jdbc:mariadb://maxscale/db
X
Promoted ✓
TOPOLOGY ISOLATION
alejandro_du
Web application
SQL
jdbc:mariadb://maxscale/db
✓
TOPOLOGY ISOLATION
alejandro_du
Web application
SQL
jdbc:mariadb://maxscale/db
✓
Replica
TOPOLOGY ISOLATION
alejandro_du
Web application
SQL
jdbc:mariadb://maxscale/db
✓
Replica
OTHER USE CASES
alejandro_du
SCALABILITY (AND PERFORMANCE)
alejandro_du
● Read-write splitting
SCALABILITY (AND PERFORMANCE)
alejandro_du
● Read-write splitting
● Load balancing
SCALABILITY (AND PERFORMANCE)
alejandro_du
● Read-write splitting
● Load balancing
● Causal reads
SCALABILITY (AND PERFORMANCE)
alejandro_du
● Read-write splitting
● Load balancing
● Causal reads
● Caching
HIGH AVAILABILITY
alejandro_du
● Automatic failover
HIGH AVAILABILITY
alejandro_du
● Automatic failover
HIGH AVAILABILITY
alejandro_du
● Automatic failover
● Transaction replay
INTEGRATIONS
alejandro_du
● Change data capture
(CDC)
INTEGRATIONS
alejandro_du
● Change data capture
(CDC)
● Data ingestion
INTEGRATIONS
alejandro_du
● Change data capture
(CDC)
● Data ingestion
● NoSQL protocol
(MongoDB)
NOSQL PROTOCOL
alejandro_du
Web application
MQL SQL
SECURITY
alejandro_du
● Query log
SECURITY
alejandro_du
● Query log
● Query limit
SECURITY
alejandro_du
● Query log
● Query limit
● Result limit
SECURITY
alejandro_du
● Query log
● Query limit
● Result limit
● Data masking
alejandro_du
SELECT *
FROM person
DISADVANTAGES
alejandro_du
PROXY USAGE DISADVANTAGES
alejandro_du
● They add elements to the infrastructure
● Require configuration
● Can increment costs (licenses / cloud usage)
ADVANTAGES
alejandro_du
● Abstract away database infrastructure
○ It all looks like a standalone database instance to developers
○ DBAs can add or remove replicas and cluster nodes when needed
○ No need for developers to implement things like load balancing or data
masking
○ DBAs can make changes without interrupting applications
● Hide and manage failures
○ No need for developers to create new connections or retry transactions
○ No need for DBAs to perform a manual failover after being alerted
alejandro_du
Nicolas Tobias
alejandro_du
Nicolas Tobias
Well, in one word, it is a database proxy that since I discovered last
year, I haven't stopped using.
github.com/mariadb-developers/read-write-split-java-app
alejandro_du
Thank you!
@alejandro_du
alejandro-du
alejandro.duarte@mariadb.com

More Related Content

PDF
Manual Tecnico OGG Oracle to MySQL
PPTX
Tips to drive maria db cluster performance for nextcloud
PDF
Rapid Application Development with WSO2 Platform
PDF
When it all GOes right
PPTX
MongoDB Days UK: Run MongoDB on Google Cloud Platform
PDF
The Accidental DBA
PDF
Towards a ZooKeeper-less Pulsar, etcd, etcd, etcd. - Pulsar Summit SF 2022
PPTX
Resilience Testing
Manual Tecnico OGG Oracle to MySQL
Tips to drive maria db cluster performance for nextcloud
Rapid Application Development with WSO2 Platform
When it all GOes right
MongoDB Days UK: Run MongoDB on Google Cloud Platform
The Accidental DBA
Towards a ZooKeeper-less Pulsar, etcd, etcd, etcd. - Pulsar Summit SF 2022
Resilience Testing

Similar to Database Proxies CRASH COURSE.pdf (20)

PDF
MySQL Fabric: Easy Management of MySQL Servers
PDF
JDV for Codemotion Rome 2017
PDF
High performance json- postgre sql vs. mongodb
PDF
NoSQL design pitfalls with Java
PPTX
Revolutionizing the Data Abstraction Layer with IBM Optim pureQuery and DB2
PDF
Andrzej Ludwikowski - Event Sourcing - what could possibly go wrong? - Codemo...
PPTX
Azure Database Services for MySQL PostgreSQL and MariaDB
PDF
MongoDB World 2018: Transactions and Durability: Putting the “D” in ACID
PDF
Using MongoDB to Build a Fast and Scalable Content Repository
PDF
Our Multi-Year Journey to a 10x Faster Confluent Cloud
PPTX
MySQL backup and restore performance
PDF
REPEAT_1_Deep_dive_on_new_features_in_Amazon_RDS_for_SQL_Server_DAT364-R1(1).pdf
PPTX
ProxySQL for MySQL
DOCX
Oracle GoldenGate
PDF
12-factor-jruby
PDF
Event Sourcing - what could possibly go wrong?
PDF
MySQL Utilities -- PyTexas 2015
PDF
PostgreSQL - масштабирование в моде, Valentine Gogichashvili (Zalando SE)
PDF
Grails 101
PDF
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MySQL Fabric: Easy Management of MySQL Servers
JDV for Codemotion Rome 2017
High performance json- postgre sql vs. mongodb
NoSQL design pitfalls with Java
Revolutionizing the Data Abstraction Layer with IBM Optim pureQuery and DB2
Andrzej Ludwikowski - Event Sourcing - what could possibly go wrong? - Codemo...
Azure Database Services for MySQL PostgreSQL and MariaDB
MongoDB World 2018: Transactions and Durability: Putting the “D” in ACID
Using MongoDB to Build a Fast and Scalable Content Repository
Our Multi-Year Journey to a 10x Faster Confluent Cloud
MySQL backup and restore performance
REPEAT_1_Deep_dive_on_new_features_in_Amazon_RDS_for_SQL_Server_DAT364-R1(1).pdf
ProxySQL for MySQL
Oracle GoldenGate
12-factor-jruby
Event Sourcing - what could possibly go wrong?
MySQL Utilities -- PyTexas 2015
PostgreSQL - масштабирование в моде, Valentine Gogichashvili (Zalando SE)
Grails 101
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
Ad

Recently uploaded (20)

PDF
Designing Intelligence for the Shop Floor.pdf
PDF
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
PPTX
GSA Content Generator Crack (2025 Latest)
DOCX
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
PDF
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PDF
How Tridens DevSecOps Ensures Compliance, Security, and Agility
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PDF
Complete Guide to Website Development in Malaysia for SMEs
PDF
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PPTX
Trending Python Topics for Data Visualization in 2025
PPTX
Tech Workshop Escape Room Tech Workshop
PPTX
"Secure File Sharing Solutions on AWS".pptx
PDF
DNT Brochure 2025 – ISV Solutions @ D365
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PPTX
Introduction to Windows Operating System
PDF
Salesforce Agentforce AI Implementation.pdf
PPTX
Patient Appointment Booking in Odoo with online payment
Designing Intelligence for the Shop Floor.pdf
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
GSA Content Generator Crack (2025 Latest)
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
How Tridens DevSecOps Ensures Compliance, Security, and Agility
Why Generative AI is the Future of Content, Code & Creativity?
Complete Guide to Website Development in Malaysia for SMEs
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
Trending Python Topics for Data Visualization in 2025
Tech Workshop Escape Room Tech Workshop
"Secure File Sharing Solutions on AWS".pptx
DNT Brochure 2025 – ISV Solutions @ D365
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Monitoring Stack: Grafana, Loki & Promtail
Introduction to Windows Operating System
Salesforce Agentforce AI Implementation.pdf
Patient Appointment Booking in Odoo with online payment
Ad

Database Proxies CRASH COURSE.pdf