Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
MariaDB High Performance

You're reading from   MariaDB High Performance Familiarize yourself with the MariaDB system and build high-performance applications

Arrow left icon
Product type Paperback
Published in Sep 2014
Publisher
ISBN-13 9781783981601
Length 298 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Pierre Mavro Pierre Mavro
Author Profile Icon Pierre Mavro
Pierre Mavro
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Performance Introduction FREE CHAPTER 2. Performance Analysis 3. Performance Optimizations 4. MariaDB Replication 5. WAN Slave Architectures 6. Building a Dual Master Replication 7. MariaDB Multimaster Slaves 8. Galera Cluster – Multimaster Replication 9. Spider – Sharding Your Data 10. Monitoring 11. Backups Index

Dual master replication and risks


A dual master replication is very simple to implement. If you know how to build a slave, you'll be able to create a dual master easily. It's in fact a slave replication on both sides. The following diagram shows dual-sided replication:

This means that in theory you can write to both MariaDB instances at the same time. However, doing so is likely to result in inconsistent data between the two hosts, breaking replication (because of PRIMARY/UNIQUE key collisions) and, worse than that, you may end up having inconsistent data between two hosts.

Tip

Do not write on to both the masters at the same time!

The preceding tip mentions a rule that you need to follow to avoid issues in the production usages. You can minimize this kind of issue by adding the following two options in your MariaDB configuration file:

auto-increment-increment=2
auto-increment-offset=1
  • This will avoid primary key collisions on the same rows of the same table:

  • auto-increment-increment: This sets...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime