2

I want to do synchronous and asynchronous replication, synchronize for some databases, and asynchrony for others.

Asynchronous I am doing it through MariaDB, through the traditional system that has replication. But I want to implement synchronous replication also with Mysql / MariaDB. The problem is that I do not know if Mysql Cluster also does that work, or if it is not necessary to have Mysql installed only or MariaDb and only use Mysql Cluster for both.

Thank you.

Garnica1999
  • 215
  • 2
  • 12

2 Answers2

2

Disclosure: I am working for the MySQL Cluster team - "MySQL Cluster" as in NDB Cluster.

MySQL NDB Cluster always uses synchronous replication between its nodes. You can still use asynchronous replication to other MySQL instances or MySQL Clusters.

AFAIK only MySQL offers NDB and as open source.

Due to the usual network limitations synchronous replication is better suited for high availability in the local data center. It gives you an always consistent view of your data, two or more active instances and makes programing against it much easier.

Asynchronous is more for replication between data centers or availability zones where you can live with temporary inconsistencies in the data and have your programming model set up accordingly.

  • Hello, is that I have implemented my database in the MariaDB engine, but I do not know if it can be integrated with MYSQL Cluster or it will give problems. – Garnica1999 Nov 06 '18 at 21:09
  • I never looked at MariaDB - but I doubt MySQL NDB Cluster engine and MariaDB will go together. You would have to use MySQL in order to use MySQL NDB Cluster – Bernd Ocklin Nov 08 '18 at 19:26
1

"MySQL Cluster" has more than one meaning, so I will avoid it.

"Galera" is the underlying cluster technology in MariaDB, PXC, and (if you do the installation yourself), MySQL.

Galera provides essentially-synchronous among (typically) 3 nodes. Meanwhile, each node can have any number of asynchronous Slaves hanging off it.

Also, one Galera cluster can asynchronously replicate to another such cluster. This is sometimes done with a cluster in each of two datacenters.

Mixing sync and async at the database level is quite unusual, and seems strange. The general principle of Replication is that all servers will have exactly the same (barring delays) data. Please elaborate on what you want to do. Also, think out of the box when it comes to topologies.

Rick James
  • 135,179
  • 13
  • 127
  • 222
  • Hello, what I want to do is the following, I am working on MariaDB, and I have replicated a database with a master and 2 slaves. I have them replicated with the default tool that MariaDB brings. What I want to do is that for example, the slaves are synchronized in a specific hour and on a specific date. I do not know how to do that part, and I do not know if Galera can facilitate that task. – Garnica1999 Nov 06 '18 at 21:08
  • @ElPapu - All forms of replication are always on. There is no concept of synchronizing at given times. It is a lot simpler to "continually" replicate than to "synchronize". Please explain why you want the hour/date technique. Maybe there is a better solution to the underlying problem. – Rick James Nov 06 '18 at 21:17
  • My case is this: I was asked to make a replica of a database mounted on MariaDB, I must do 2 examples, the first one is immediate replication, that I already have it with the tool that MariaDB has by default for this job, the second one replication must go at a specific time and date, whichever one wants, there is no restriction in that part. The problem is that I do not know if with the default tool it serves to do that, or I'm in touch to implement other ways of doing the above. – Garnica1999 Nov 06 '18 at 22:14
  • @ElPapu - If my boss gave me that task, I would push back saying "Why do you want to pay me to invent a tool that when there is a similar tool that seems to achieve the same goals but in a different way." – Rick James Nov 06 '18 at 22:23
  • The other thing that was happening to me was with the task scheduler, in this case Windows, to program "worth the redundancy" a task in which the replicaicon is activated and deactivated, although I do not know how to implement that part ... – Garnica1999 Nov 06 '18 at 23:20
  • On the slave, `STOP SLAVE;` and `START SLAVE;` At a crude level, that is _all_ you need. – Rick James Nov 07 '18 at 02:36