You are viewing a plain text version of this content. The canonical link for it is here.
Posted to replication@couchdb.apache.org by Paketix <pa...@bluewin.ch> on 2014/05/27 11:35:54 UTC
CouchDB / 200 sites global replication *without* full mesh
dear community,
I would like to implement global configuration replication for a cloud service.
the customer can update its service configuration at any site and changes are replicated worldwide.
eg.
main CouchDB sites in
- USA
- Europe
- Asia
main sites are full-mesh connected OR connected like a backbone ( USA---Europe---Asia ) always with bi-directional replication between main sites.
sub sites in each region are connected in a ‚LDAP tree‘ way which connects to main site in the region.
eg:
- Western Europe will do a bi-directional replication to Europe node only
- France node will do a bi-directional replication to Western Europe node only
- Germany node will do a bi-directional replication to Western Europe node only
- and so on …
this would mean a 3-layered approach down to each country node
a fourth layer may consist of different towns in the county
eg:
- Frankfurt node will do a bi-directional replication to Germany node only
- Berlin node will do a bi-directional replication to Germany node only
any way to do such a structure with CouchDB?
anyone already using such a strucure?
is it possible to connect 200 servers this way (globally)?
any ideas about replication time to expect in such a configuration (if possible at all…)?
are there tools which are better suited to implement my needs?
hope this is not too crazy of an idea :)
kind regards
/pat
Re: CouchDB / 200 sites global replication *without* full mesh
Posted by Jens Alfke <je...@couchbase.com>.
On May 27, 2014, at 12:20 PM, Matthieu Rakotojaona <ma...@gmail.com> wrote:
> The issue you have here is that CouchDB is really "low-level" in that it
> only manages 1-1 replication. A global mesh of CouchDB nodes will need a
> third-party tool.
Not necessarily. If this is a fixed set of servers with static IP addresses, you just need to configure each CouchDB instance with a couple of persistent replications to its ‘neighbors’. This configuration might have to be updated periodically if servers are added or moved, but that shouldn’t be a big job.
What you’re saying is more applicable to a dynamic environment like a set of home computers or mobile devices. “Mesh networking” does usually refer to such situations, but I think the OP is using “mesh" in a more general sense.
—Jens
Re: CouchDB / 200 sites global replication *without* full mesh
Posted by Matthieu Rakotojaona <ma...@gmail.com>.
Excerpts from Paketix's message of 2014-05-27 11:35:54 +0200:
> any way to do such a structure with CouchDB?
> is it possible to connect 200 servers this way (globally)?
The issue you have here is that CouchDB is really "low-level" in that it
only manages 1-1 replication. A global mesh of CouchDB nodes will need a
third-party tool.
> any ideas about replication time to expect in such a configuration (if possible at all…)?
You can consider replication to be instant on the application level;
all the time will be spent in the network. You're going to have to find
an excellent third-party tool that guarantees short paths from any node
to any other node if you want global synchronization to happen fast :)
> are there tools which are better suited to implement my needs?
Your problem looks like it could be solved by multicast trees or
spanning trees, just like IRC networks. The goal of such structures is
to make sure a message spreads through the network with as few
duplicates as possible.
The notorious problem of IRC networks though (and spanning trees in
general) is that whenever a node fails, your network is split; there is
no redundancy in the links (of course, because it's the whole point of
spanning trees)
I don't know of any application that does this easily, though.
> hope this is not too crazy of an idea :)
Actually, this is one of the most interesting use of CouchDB, so if you
come up with something interesting, please share !
> kind regards
> /pat
--
Matthieu Rakotojaona
Re: CouchDB / 200 sites global replication *without* full mesh
Posted by Jens Alfke <je...@couchbase.com>.
On May 27, 2014, at 5:39 AM, Riyad Kalla <rk...@gmail.com> wrote:
> I would probably recommend you go with a smaller master-master
> replicated network, one in each major region and then allow a bunch of
> slaves around each primary to do master-slave replication.
That conflicts with the OPs requirement that "the customer can update its service configuration at any site”. And I don’t think it’s necessary to limit any of the nodes to being slaves. Yes, replication conflicts are possible, but only in cases where a user changes settings at two different sites at roughly the same time, which would be very unlikely since the sites are geographically dispersed.
> I'd also point out that every
> single write to every single database having a potential 200x write
> multiplier across your mesh network might have unforseen consequences
> especially during times of heavy traffic
If the documents being written are “service configurations”, I’m guessing they don’t change that often and they’re not terribly big. So the amount of traffic doesn’t sound like a concern. (Also, any document change only gets sent once across any particular arc of the mesh.)
As for topology: The most efficient setup in terms of overall bandwidth would be a spanning tree. But for robustness in case any of the nodes or arcs fail, as well as lower latency, you might want to add some redundant connections between otherwise-non-adjacent nodes.
—Jens
Re: CouchDB / 200 sites global replication *without* full mesh
Posted by Riyad Kalla <rk...@gmail.com>.
1. "Any way to do with CouchDB?" - Yes
2. "Anyone already doing this?" - Not sure, maybe someone on the thread can
weigh in. I don't think global/master-master replicated setups are that
uncommon in CouchDB land though.
3. "Is it possible to connect 200 servers this way?" - Technically, yes,
but I would probably recommend you go with a smaller master-master
replicated network, one in each major region and then allow a bunch of
slaves around each primary to do master-slave replication. I say that
because EVERY master-master replication you have setup is an opportunity
for a replication conflict. Those may introduce unexpected results into
your network, so try and minimize them. I'd also point out that every
single write to every single database having a potential 200x write
multiplier across your mesh network might have unforseen consequences
especially during times of heavy traffic -- this is just a gut feeling,
nothing scientific.
4. "How is the performance?" - Replication in CouchDB happens almost
instantaneously, so your big question here is frequency and network lag.
5. "Tools that might be better suited?" - Not sure about better
(multi-master is a common boon of CouchDB), but Netflix does this with
Cassandra (the setup is non-trivial and very large though), you can
accomplish something similar with Riak (random: but it bothers me their
CEO, CTO and Chief Arch all quit at the same time), I believe Couchbase
also supports multi-master and I would never rule out PostgreSQL only
because it is such a damn nice datastore (may need 3rd party software for
multi-master setup -
http://www.postgresql.org/docs/9.3/static/different-replication-solutions.html
)
On Tue, May 27, 2014 at 2:35 AM, Paketix <pa...@bluewin.ch> wrote:
> dear community,
> I would like to implement global configuration replication for a cloud
> service.
> the customer can update its service configuration at any site and changes
> are replicated worldwide.
> eg.
> main CouchDB sites in
> - USA
> - Europe
> - Asia
> main sites are full-mesh connected OR connected like a backbone (
> USA---Europe---Asia ) always with bi-directional replication between main
> sites.
> sub sites in each region are connected in a ‚LDAP tree‘ way which connects
> to main site in the region.
> eg:
> - Western Europe will do a bi-directional replication to Europe node only
> - France node will do a bi-directional replication to Western Europe node
> only
> - Germany node will do a bi-directional replication to Western Europe node
> only
> - and so on …
> this would mean a 3-layered approach down to each country node
> a fourth layer may consist of different towns in the county
> eg:
> - Frankfurt node will do a bi-directional replication to Germany node only
> - Berlin node will do a bi-directional replication to Germany node only
>
> any way to do such a structure with CouchDB?
> anyone already using such a strucure?
> is it possible to connect 200 servers this way (globally)?
> any ideas about replication time to expect in such a configuration (if
> possible at all…)?
> are there tools which are better suited to implement my needs?
>
> hope this is not too crazy of an idea :)
> kind regards
> /pat