Re: Database syncronization
Date: Mon, 29 Apr 2002 16:27:56 +0200
Message-ID: <3CCD586C.6090108_at_XXltt.rwth-aachen.de>
Hi!
Some DBMS provide replication-agents to do that job. If Your's doesn't (mysql?) you'll have to do it on your own. As PK use globally unique identifiers. If your database doesn't support creating them you'll find apropriate functions in your operating system (under Win32 there's a tool called guidgen, under linux look for uuidgen).
Eckardt
Bytter wrote:
> Hi,
>
> I've got a problem that I can't seem to resolve in a simple way. My problem
> is: one database in 'n' computers (to make it simple, lets start with 2).
> Both have the same tables, which have the same fields. But both run on two
> different computers. On both, they can add new things, delete old ones, and
> modify existing entries. But, at one time, they must syncronize. They data
> must be shared: those entries added, must be added, those modified must be
> modified, and so on... (simple uh :)) Let's start using a simple table, with
> an unsigned long int primary key:
>
> Names
> -------
> Cod (LONG INT) (PK) (auto-increment)
> Name (varchar)
>
> Ok until here... Now let's run it on two diferent computers. Tables are
> empty, we create two diferent entries on both computers. They get the same
> 'Cod'... :-(
>
> Now, let's change our 'Cod' to a TIMESTAMP... The problem seems to be
> resolved but then, who said that it wouldn't be possible two create two
> entries at the same second? Nothing guarantees that the clock is
> synchronized, nothing guarantees how many users are using it at the SAME
> TIME... So, problem unresolved.
>
> Third try: add an ID to the end of 'Cod', and mantain it TIMESTAMP. Well,
> fine... Problem is when 'n' (number of computers running the database
> independently) starts to grow... It doesn't seem a genial way to do it...
>
> So, what's next ? Any ideas ? I'm really needing some help here... Oh, and
> they are meant to be practically implemented (consider performance).
>
> Sorry about my english, but my thanks in advance,
>
> Hugo Jose Ferreira
>
>
-- =========================================== Eckardt Augenstein augenstein<at>ltt.rwth-aachen.de http://www.ltt.rwth-aachen.de/Received on Mon Apr 29 2002 - 16:27:56 CEST
