0

We have 5 islands where we have Galera nodes. There are frequent internet disconnections on Islands. When a node get disconnected its tables get locked for read and write. But it sync and becomes available when the internet resume. In MariaDB Replication read and write is available for the disconnected node, but it is not a good solution.

Is it possible to have read and write on Galera disconnected node? Is there any other solution available for such a scenario?

1 Answers1

0

Perhaps Galera is not the right solution for a very flaky network.

If each Island had its own server that was reliable 'enough', half the problem is solved. Getting the data to (and from) the other Islands needs to be accomplished with application code behind the schemes.

The schema and data flow design would need to avoid various cases where UNIQUE (or PRIMARY) keys could be created simultaneously on separate Islands. UUIDs is one solution, but it does not perform well for huge databases.

Then there is the issue of "stale" data. If the server on an isolated island has "old" data from the other islands, might a user mess things up by acting on that stale data?

Bottom line: Either work on making the network more robust, or stand on your head to make the application robust.

Alternatives...

Circular with more than 2 is really bad. Any outage leaves the rest in an odd state -- some replication is happening, some is not. And if a server actually dies, then it is a big nightmare to repair.

Multi-source replication... Given that you have small databases, and intER-island access is readonly, this could be a good solution. You have one server that is the Slave to all the others. That is, each Island would have a Master, and (when the network is working) replicate stuff to that common Slave. (Is one Island more likely to stay connected?)

All forms of replication/clustering resume replicating and pretty quickly "catch up" after the network comes alive again.

As for UUIDs versus AUTO_INCREMENT -- If all writes to any particular table and all related tables are only coming through the one Island's server, then I don't see a need for UUIDs.

(Anyway, with only 100MB/island, UUIDs probably won't fall off the performance cliff.)

Rick James
  • 106,233
  • 9
  • 103
  • 171
  • I agree with you. We will be using UUID. The DBs are less than 50mb and may grow upto100mb so they are not big. Also one island team can not do changes in other islands entires. They can only view it. I think circular mariadb replication will be a better option as it allows to add entries when internet is off for an hour. And sync back nicely when online. – Asad Mahmand Feb 10 '19 at 14:46