cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Hosting in various countries

From: Jamie Lokier <jamie_at_shareable.org>
Date: Fri, 26 Mar 2010 04:24:15 +0000

Yang Tse wrote:
> 2010/3/23, Jamie Lokier wrote:
>
> > The only time you'd want the same contents completely and
> > transactionally synchronised is for the reasons you have distributed
> > databases: geographic redundancy, network load spreading, offline
> > access etc.
>
> Exactly. That is the capability I'm searching for. Three or four
> sync'ed public repositories located at different countries. If all of
> these repos could be master repos simultaneously each of us could work
> against the one we would feel more comfortable.
>
> If not possible to do the above, my second option would be one public
> master repo that got replicated to another two or three public repos.
> The problem with this second option Is that a choice has to be done in
> order to designate which country should hold the origin repo.

If you are concerned about country for political reasons, well, is
sending a commit from the USA directly to a repo in EU any different
from sending a commit to a USA repo and that forwarding it on to the
EU repo? The code is "exported" in either case. The fact each
developer's machine is also a repo anyway blurs it further.

Technically, I suggest just triggering a push after every change to
all the other servers using the appropriate hook. (Don't do a push on
*every* change, as that might push 100s of times if you uploaded 100s
of changes at once. I'm not sure which behaviour is done by git's
post-commit trigger)

If you do that on multiple servers it becomes two-way. Even though
it's not transactional in the sense you want, it'll work ok in
practice. It will fail when a merge conflict occurs due to
near-simultaneous commit of _conflicting_ changes at different
locations... Scripts need to be prepared for that, e.g. send an email
on sync error.

That seems like a problem, but if you think about it, the consequences
are similar in a transactional system if the inter-server network or
any server are briefly down when someone tries to commit. Except,
politically, with transactions it's harder to argue that you did the
commit in a "comfortable" country, as all countries are involved
simultaneously.

-- Jamie
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-03-26