Asynchronous Commit

79 views
Skip to first unread message

KTWalrus

unread,
May 9, 2012, 12:19:38 AM5/9/12
to codership
I'm investigating Galera to scale a forum written in PHP. If I
understand it, when using Galera replication, my app will now possibly
wait longer at the commit points than when using MySQL asynchronous
replication. I don't worry too much about this when all the nodes are
local (LAN), but what if some of the nodes are on higher latency/
slower bandwidth connections (WAN)?

As I understand, my app's wait time will be governed by the slowest
node in the cluster. Is there some way to have the wait time governed
by the slowest local node (LAN) only and let my PHP code continue from
the commit point more predictably?

Also, I think I read that all updates are done using a star topology
where an update on one node is simultaneously communicated to all
other nodes in the cluster. I'd rather have the nodes on a LAN be
considered a Galera Cluster and the clusters on the WAN be a Galera
Cluster of Clusters. So, writes between Clusters are only
communicated once between two Clusters (through the broadcast IP) and
applied to all nodes in the remote Cluster.

Anyway, this is a bit hard to describe, but can Galera make a
distinction between WAN and LAN links and optimize performance/
bandwidth using this knowledge?

I'm thinking of the situation where I have 4 nodes in 4 datacenters in
4 continents (16 node cluster) and whether this would really work
(especially if the links between the datacenters were high latency and
slow at times).

Alex Yurchenko

unread,
May 9, 2012, 3:05:32 AM5/9/12
to codersh...@googlegroups.com
Unfortunately nothing that you're asking about is supported by Galera
at the moment.

Also note, that while "cluster-of-clusters" concept may intuitively
appear to be sound, it does not really work as you might expect. In
short, if you want your multi-master cluster to span 4 continents,
you'll have to be synchronous throughout - this is required to maintain
global transaction id.

If you want asynchronous relation between your datacenters you could
use native MySQL replication for that (provided your data is
partitioned) - but that will make 4 different clusters.

Henrik Ingo

unread,
May 9, 2012, 3:11:58 PM5/9/12
to KTWalrus, codership
What you are asking for is that you setup small galera clusters in
each LAN, and then connect these with MySQL replication.

MySQL replication works as usual, note the following:
* From 2 small galera (LAN) clusters, you just pick one node from
each and set them up as MySQL master slave.
* You need to leave binlog-format=ROW (galera needs this, it is good anyway)
* You need to enable log-slave-updates

The advantage of just using galera replication across everything
(compared to above) is simplicity. The commit time latencies have been
measured to be in the 100-300 ms range (this is pretty much what you
can predict by pinging across oceans too) so for some apps this will
be just fine. (If there are not a lot of writes, and they are all in
one big transaction, which happens toward the end of execution,
etc...)

henrik
> --
> You received this message because you are subscribed to the Google Groups "codership" group.
> To post to this group, send email to codersh...@googlegroups.com.
> To unsubscribe from this group, send email to codership-tea...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/codership-team?hl=en.
>



--
henri...@avoinelama.fi
+358-40-8211286 skype: henrik.ingo irc: hingo
www.openlife.cc

My LinkedIn profile: http://www.linkedin.com/profile/view?id=9522559
Reply all
Reply to author
Forward
0 new messages