Re: replicating data over 2 servers

From: Jim Dixon (jdd_at_dixons.org)
Date: 05/27/03

  • Next message: Nick Kraal: "FreeBSD/iPAQ"
    Date: Tue, 27 May 2003 22:33:01 +0100 (BST)
    To: <freebsd-isp@freebsd.org>
    
    

    On Tue, 27 May 2003 nbari@unixmexico.com wrote:

    > hi all, i have to servers (A, B) with round robin DNS, users enter to
    > server A and server B and they write to a txt file, how can i sync the
    > file from both server so it can be always the same? for example if a user
    > enter to server A and modify some data, replicate that modification to
    > server B so when user enter to server B he can see his changes, and the
    > same if user modify a file on server B, replicate that file to server A,
    > any idea?

    We need more information.

    How often does the data get changed? How much delay is tolerable?
    Are the two servers on the same LAN or in different places on the
    Internet? Most important, how do you define "the same"? Is it
    tolerable if the servers are out of sync for a few milliseconds?
    for a few seconds? minutes?

    You probably need a protocol for writing like this:

    1 lock local copy of data
    2 lock remote copy of data
    3 write new values
    4 unlock remote copy
    5 unlock local copy

    This guarantees that data on the two servers will be consistent. For
    better performance (less delay perceived by the user):

    1 read-lock local copy (ie, no writing permitted, but reading OK)
    2 write-lock remote copy (no reading, no writing)
    3 write-lock local copy
    4 update values
    5 drop local lock to read-lock
    6 unlock remote copy
    7 unlock local copy

    You can elaborate the protocol to allow for server failures. Dealing
    with network failures is more interesting.

    You could do this with a Perl script and ssh without much trouble,
    assuming that the data was coarse-grained, ideally a single item ;-)

    If the data has a complex structure and there is lots of it, then you
    probably need a distributed database.

    --
    Jim Dixon  jdd@dixons.org   tel +44 117 982 0786  mobile +44 797 373 7881
    _______________________________________________
    freebsd-isp@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-isp
    To unsubscribe, send any mail to "freebsd-isp-unsubscribe@freebsd.org"
    

  • Next message: Nick Kraal: "FreeBSD/iPAQ"

    Relevant Pages

    • Re: Server Sync and OMA Wont work.
      ... I currently have 5 phones that sync with exchange. ... A stand alone PC is set next to the server, joined to ... Microsoft CSS Online Newsgroup Support ... I need log files for further analyze. ...
      (microsoft.public.windows.server.sbs)
    • RE: ActiveSync, Smartphone, and Small Business Server
      ... Then I attached the smartphone and set up a new ... I got a sync error (for the server part of the ... But in the example log files, the sync command from the ...
      (microsoft.public.windows.server.sbs)
    • Re: Peer to Peer
      ... My authoritative server would be my ciso router that does sync with stratum ... "problems with w32time" followed the instructions and it seemed to work. ... Configure the machine to sync with an outside time source: ... w32tm -s to run periodically if the time service does not function on peer ...
      (comp.protocols.time.ntp)
    • Re: Wireless Sync Issue
      ... I did talk to Sprint, and they were clueless, saying there was no ... sometimes making changes in a host file on the server. ... Using an O2 ATOM and unable to sync via GPRS after a USB sync unless I stop ... and the server is accessible from the Internet via ...
      (microsoft.public.pocketpc.activesync)
    • Re: Update: REPOST: My Documents Redirection Sync Errors
      ... offline when the users use them. ... setting I was talking about in the Share settings on the server). ... I store Office templates on ... > could delete these rogue sync entries. ...
      (microsoft.public.windows.server.sbs)