SlideShare a Scribd company logo
Using Galera Replication to Create
Geo-distributed Clusters on the WAN
Philip Stoev
Codership Oy
Agenda
•  A very quick overview of Galera Cluster
•  What is a geo-distributed database and why use it?
•  Galera’s approach
•  Configuration considerations
•  AWS demo
Galera Cluster Overview
Synchronous
– each transaction is immediately replicated on all nodes at commit
– no stale slaves
Multi-Master
– read from and write to any node
– automatic transaction conflict detection
Replication
– a copy of the entire dataset is available on all nodes
– new nodes can join automatically
For MySQL
– based on a modified version of MySQL (5.5, 5.6 with 5.7 coming up)
– InnoDB storage engine
And more …
•  Recovers from node failures within seconds
•  Data consistency protections
– avoids reading stale data
– prevents unsafe data modifications
•  Cloud and WAN support
What is a Geo-distributed
Database Cluster?
•  There are database nodes in different physical locations
– multiple data centers, regions, continents …
•  Nodes work together as a single entity
– rather than be in some subordinate relationship
Why Have a Geo-Distributed Database?
•  Distribute global data globally
•  Bring data closer to the users
•  Go beyond availability zones and achieve multi-
datacenter redundancy
– multiple availability zones can fail at the same time
•  Use multiple cloud providers
Galera’s Approach
Galera’s Approach
•  Single logical MySQL database
– behaves as a single entity with multiple connection points
•  Each node has a complete replica of the database
– can respond to any read request without delay
– removes latency for many operations
– may reduce the number of caching layers required
•  Each node is a master
– no primary/secondary relationship
– no need to promote a secondary to master on master failure
Galera Features for WAN
•  Optimized network protocol
– packets exchanged over WAN only at transaction commit time
•  Topology-aware replication
– each transaction is sent to each datacenter only once
– if needed, node synchronizes with nearest neighbors
•  Traffic encryption
•  Detection and automatic eviction of unreliable nodes
– node will be evicted if it repeatedly suffers network issues
– it will not be allowed to rejoin without a manual intervention
What Data Can Take Advantage of
Synchronous WAN Replication?
•  Global in nature
– configuration data, authentication databases, SSO, etc.
– e.g. OpenStack's Keystone and Glance databases
•  High read-to-write ratio
(in a distributed system, consistent writes require communication)
•  Very high consistency requirements
– financial data, payments, bank accounts
•  High write availability requirements
– writes must be possible at all times (without violating consistency)
Designing Your Cluster Topology
•  Use an odd number of data centers
•  If two data centers, run a Galera arbitrator
•  Consider multiple nodes per datacenter
Latency Considerations
•  Delay at commit time is generally equal to max RTT
– the highest latency dominates the overall response time
•  A client can commit a maximum of 1/RTT transactions/
second
– consolidate updates into larger transactions
– larger connection pool may be required
•  In multi-master setups, you can successfully update a
given row a maximum of 1/RTT times per second
– or conflicts can occur and an error will be returned to client
Bandwidth/Throughput Considerations
•  All links between nodes are important for overall
performance
•  Galera slows down commits to what the network is able
to handle
•  Full snapshot transfers (SST) across WAN are
bandwidth-intensive
– have more than one node at each location
Configuration
•  Configure gmcast.segment = ID
– each location should have a separate ID
•  Review default values for:
– evs.inactive_timeout (15 seconds); evs.suspect_timeout (5 seconds)
•  Size gcache appropriately
– to avoid snapshot transfers (SST) over WAN
•  Set up optional auto-eviction
•  Set up optional encryption
–  SST encryption is configured separately
Network Configuration
•  Use static/reserved public IPs
•  Open firewall ports: 3306, 4567, 4568, 4444
– but not to the entire world
•  Settings that use the public IPs:
– wsrep_cluster_address
– wsrep_node_address
•  Settings that use the private IPs:
– ist.recv_bind
Performance Configuration
•  wsrep_provider_options:
– gcs.max_packet_size=1048576
– evs.send_window=512; evs.user_send_window=256
– gcs.fc_limit=128
•  wsrep_slave_threads
•  binlog_row_event_max_size, binlog_cache_size=2M
•  at the TCP level:
–  net.core.rmem_max = 16777216
–  net.core.wmem_max = 16777216
–  net.core.rmem_default = 16777216
–  net.core.wmem_default = 16777216
–  net.ipv4.tcp_rmem = 4096 87380 16777216
–  net.ipv4.tcp_wmem = 4096 65536 16777216
–  net.ipv4.tcp_slow_start_after_idle = 0
Demo
•  EC2 nodes in US East, Brazil and Australia
– m4.large instances (2 virtual CPUs, 8GB RAM, $0.12/hour)
– latencies:
Brazil
Sao Paulo
Australia
Sydney
US East
Virginia
319
229
119 ms
Questions
•  Please use the Question/Chat box in the GoToWebinar
panel
Thank You
http://www.galeracluster.com
Discussion group:
codership-team@googlegroups.com

More Related Content

PDF
Getting started with kubernetes
PDF
HashiCorp Vault configuration as code via HashiCorp Terraform- stories from t...
PDF
Airflow presentation
PDF
SeaweedFS introduction
PDF
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
PPTX
Everything You Need To Know About Persistent Storage in Kubernetes
PDF
Airflow introduction
PDF
Ceph Object Storage Performance Secrets and Ceph Data Lake Solution
Getting started with kubernetes
HashiCorp Vault configuration as code via HashiCorp Terraform- stories from t...
Airflow presentation
SeaweedFS introduction
Room 2 - 6 - Đinh Tuấn Phong - Migrate opensource database to Kubernetes easi...
Everything You Need To Know About Persistent Storage in Kubernetes
Airflow introduction
Ceph Object Storage Performance Secrets and Ceph Data Lake Solution

What's hot (20)

PPTX
MySQL Performance Tuning 101
PPTX
Kafka at Peak Performance
PPTX
Kubernetes Probes (Liveness, Readyness, Startup) Introduction
PDF
Apache Airflow
PDF
Dynamically Scaling Data Streams across Multiple Kafka Clusters with Zero Fli...
PPTX
Prometheus (Prometheus London, 2016)
PPTX
The journey to the kubernetes metrics
PDF
How to Survive an OpenStack Cloud Meltdown with Ceph
PPTX
Citrix Troubleshooting 101
PPTX
KEDA Overview
PDF
High Availability for OpenStack
PDF
Apache Airflow
PDF
Running Kubernetes in Production: A Million Ways to Crash Your Cluster - DevO...
PDF
Cloud datacenter network architecture (2014)
PDF
Analytics at Speed: Introduction to ClickHouse and Common Use Cases. By Mikha...
PDF
Ansible Automation to Rule Them All
PPTX
Using and extending Alfresco Content Application
PPT
Introduction to san ( storage area networks )
PDF
Introduction to the Mysteries of ClickHouse Replication, By Robert Hodges and...
PDF
Redis cluster
MySQL Performance Tuning 101
Kafka at Peak Performance
Kubernetes Probes (Liveness, Readyness, Startup) Introduction
Apache Airflow
Dynamically Scaling Data Streams across Multiple Kafka Clusters with Zero Fli...
Prometheus (Prometheus London, 2016)
The journey to the kubernetes metrics
How to Survive an OpenStack Cloud Meltdown with Ceph
Citrix Troubleshooting 101
KEDA Overview
High Availability for OpenStack
Apache Airflow
Running Kubernetes in Production: A Million Ways to Crash Your Cluster - DevO...
Cloud datacenter network architecture (2014)
Analytics at Speed: Introduction to ClickHouse and Common Use Cases. By Mikha...
Ansible Automation to Rule Them All
Using and extending Alfresco Content Application
Introduction to san ( storage area networks )
Introduction to the Mysteries of ClickHouse Replication, By Robert Hodges and...
Redis cluster
Ad

Viewers also liked (9)

PDF
Conceptos y-tecnicas-de-la-arquitectura-bioclimatica
PPTX
Andrea Teran Carvajal
DOCX
Taller 5 organigrama
PDF
slzkq.pdf
PPTX
Entorno virtual de aprendizaje
PPTX
Estudio Ascot - Discusión y Análisis por el Grupo Médico CARDIOVEN
PPTX
Antihipertensivos
PPTX
Dermalytics Stanford 2016
PPTX
シードアクセラレーション面談用ppt(ワールドインキュベーター)
Conceptos y-tecnicas-de-la-arquitectura-bioclimatica
Andrea Teran Carvajal
Taller 5 organigrama
slzkq.pdf
Entorno virtual de aprendizaje
Estudio Ascot - Discusión y Análisis por el Grupo Médico CARDIOVEN
Antihipertensivos
Dermalytics Stanford 2016
シードアクセラレーション面談用ppt(ワールドインキュベーター)
Ad

Similar to Using galera replication to create geo distributed clusters on the wan (20)

ODP
Using Galera Cluster to Power Geo-distributed Applications on the WAN
PDF
How to understand Galera Cluster - 2013
PDF
Galera Cluster 4 for MySQL 8 Release Webinar slides
ODP
Do more with Galera Cluster in your OpenStack cloud
PPT
Taking Full Advantage of Galera Multi Master Cluster
PDF
MySQL Galera 集群
PDF
9 DevOps Tips for Going in Production with Galera Cluster for MySQL - Slides
PPTX
Migrating to XtraDB Cluster
PDF
M|18 Under the Hood: Galera Cluster
PPT
Galera Cluster Best Practices for DBA's and DevOps Part 1
PDF
Highly Available Load Balanced Galera MySql Cluster
PPTX
Migrating to XtraDB Cluster
PDF
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #2: Galera Cluster
PDF
Introduction to Galera Cluster
PDF
MariaDB Galera Cluster webinar — 2025 Edition.pdf
PDF
What’s new in Galera 4
PPT
Galera webinar migration to galera cluster from my sql async replication
PDF
Scaling with sync_replication using Galera and EC2
PDF
Galera Cluster 4 presentation at Percona Live Austin 2019
PDF
FOSDEM 2012: MySQL synchronous replication in practice with Galera
Using Galera Cluster to Power Geo-distributed Applications on the WAN
How to understand Galera Cluster - 2013
Galera Cluster 4 for MySQL 8 Release Webinar slides
Do more with Galera Cluster in your OpenStack cloud
Taking Full Advantage of Galera Multi Master Cluster
MySQL Galera 集群
9 DevOps Tips for Going in Production with Galera Cluster for MySQL - Slides
Migrating to XtraDB Cluster
M|18 Under the Hood: Galera Cluster
Galera Cluster Best Practices for DBA's and DevOps Part 1
Highly Available Load Balanced Galera MySql Cluster
Migrating to XtraDB Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #2: Galera Cluster
Introduction to Galera Cluster
MariaDB Galera Cluster webinar — 2025 Edition.pdf
What’s new in Galera 4
Galera webinar migration to galera cluster from my sql async replication
Scaling with sync_replication using Galera and EC2
Galera Cluster 4 presentation at Percona Live Austin 2019
FOSDEM 2012: MySQL synchronous replication in practice with Galera

Recently uploaded (20)

PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
AI in Product Development-omnex systems
PDF
top salesforce developer skills in 2025.pdf
PPTX
Essential Infomation Tech presentation.pptx
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
System and Network Administration Chapter 2
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
Navsoft: AI-Powered Business Solutions & Custom Software Development
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Reimagine Home Health with the Power of Agentic AI​
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
VVF-Customer-Presentation2025-Ver1.9.pptx
How Creative Agencies Leverage Project Management Software.pdf
Operating system designcfffgfgggggggvggggggggg
AI in Product Development-omnex systems
top salesforce developer skills in 2025.pdf
Essential Infomation Tech presentation.pptx
CHAPTER 2 - PM Management and IT Context
PTS Company Brochure 2025 (1).pdf.......
Softaken Excel to vCard Converter Software.pdf
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
System and Network Administration Chapter 2
Design an Analysis of Algorithms I-SECS-1021-03
Upgrade and Innovation Strategies for SAP ERP Customers

Using galera replication to create geo distributed clusters on the wan

  • 1. Using Galera Replication to Create Geo-distributed Clusters on the WAN Philip Stoev Codership Oy
  • 2. Agenda •  A very quick overview of Galera Cluster •  What is a geo-distributed database and why use it? •  Galera’s approach •  Configuration considerations •  AWS demo
  • 3. Galera Cluster Overview Synchronous – each transaction is immediately replicated on all nodes at commit – no stale slaves Multi-Master – read from and write to any node – automatic transaction conflict detection Replication – a copy of the entire dataset is available on all nodes – new nodes can join automatically For MySQL – based on a modified version of MySQL (5.5, 5.6 with 5.7 coming up) – InnoDB storage engine
  • 4. And more … •  Recovers from node failures within seconds •  Data consistency protections – avoids reading stale data – prevents unsafe data modifications •  Cloud and WAN support
  • 5. What is a Geo-distributed Database Cluster? •  There are database nodes in different physical locations – multiple data centers, regions, continents … •  Nodes work together as a single entity – rather than be in some subordinate relationship
  • 6. Why Have a Geo-Distributed Database? •  Distribute global data globally •  Bring data closer to the users •  Go beyond availability zones and achieve multi- datacenter redundancy – multiple availability zones can fail at the same time •  Use multiple cloud providers
  • 8. Galera’s Approach •  Single logical MySQL database – behaves as a single entity with multiple connection points •  Each node has a complete replica of the database – can respond to any read request without delay – removes latency for many operations – may reduce the number of caching layers required •  Each node is a master – no primary/secondary relationship – no need to promote a secondary to master on master failure
  • 9. Galera Features for WAN •  Optimized network protocol – packets exchanged over WAN only at transaction commit time •  Topology-aware replication – each transaction is sent to each datacenter only once – if needed, node synchronizes with nearest neighbors •  Traffic encryption •  Detection and automatic eviction of unreliable nodes – node will be evicted if it repeatedly suffers network issues – it will not be allowed to rejoin without a manual intervention
  • 10. What Data Can Take Advantage of Synchronous WAN Replication? •  Global in nature – configuration data, authentication databases, SSO, etc. – e.g. OpenStack's Keystone and Glance databases •  High read-to-write ratio (in a distributed system, consistent writes require communication) •  Very high consistency requirements – financial data, payments, bank accounts •  High write availability requirements – writes must be possible at all times (without violating consistency)
  • 11. Designing Your Cluster Topology •  Use an odd number of data centers •  If two data centers, run a Galera arbitrator •  Consider multiple nodes per datacenter
  • 12. Latency Considerations •  Delay at commit time is generally equal to max RTT – the highest latency dominates the overall response time •  A client can commit a maximum of 1/RTT transactions/ second – consolidate updates into larger transactions – larger connection pool may be required •  In multi-master setups, you can successfully update a given row a maximum of 1/RTT times per second – or conflicts can occur and an error will be returned to client
  • 13. Bandwidth/Throughput Considerations •  All links between nodes are important for overall performance •  Galera slows down commits to what the network is able to handle •  Full snapshot transfers (SST) across WAN are bandwidth-intensive – have more than one node at each location
  • 14. Configuration •  Configure gmcast.segment = ID – each location should have a separate ID •  Review default values for: – evs.inactive_timeout (15 seconds); evs.suspect_timeout (5 seconds) •  Size gcache appropriately – to avoid snapshot transfers (SST) over WAN •  Set up optional auto-eviction •  Set up optional encryption –  SST encryption is configured separately
  • 15. Network Configuration •  Use static/reserved public IPs •  Open firewall ports: 3306, 4567, 4568, 4444 – but not to the entire world •  Settings that use the public IPs: – wsrep_cluster_address – wsrep_node_address •  Settings that use the private IPs: – ist.recv_bind
  • 16. Performance Configuration •  wsrep_provider_options: – gcs.max_packet_size=1048576 – evs.send_window=512; evs.user_send_window=256 – gcs.fc_limit=128 •  wsrep_slave_threads •  binlog_row_event_max_size, binlog_cache_size=2M •  at the TCP level: –  net.core.rmem_max = 16777216 –  net.core.wmem_max = 16777216 –  net.core.rmem_default = 16777216 –  net.core.wmem_default = 16777216 –  net.ipv4.tcp_rmem = 4096 87380 16777216 –  net.ipv4.tcp_wmem = 4096 65536 16777216 –  net.ipv4.tcp_slow_start_after_idle = 0
  • 17. Demo •  EC2 nodes in US East, Brazil and Australia – m4.large instances (2 virtual CPUs, 8GB RAM, $0.12/hour) – latencies: Brazil Sao Paulo Australia Sydney US East Virginia 319 229 119 ms
  • 18. Questions •  Please use the Question/Chat box in the GoToWebinar panel