Re: Synchronizing autonumber fields
| From: | Ralph Deffke | Date: | Tue, 11 Aug 2009 08:39:29 +0000 |
| Subject: | Re: Synchronizing autonumber fields | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-296611@lists.php.net to get a copy of this message | ||
hi there,
this is typical app for db repliction mechanism. it depnds of the size off
your project.
have a look here:
http://dev.mysql.com/doc/refman/5.1/en/replication-howto.html
if this is oversized for u do a dump of each table without the
auto_increment fields. if u read in these tables the main database then does
use its own record id.
to identifie these records use a subsidairy finegerprint field.
another way would be not to use a ai field for identifying the record, use a
timestamp field to have an unique index on the tables. it is very unlikeley
that two records are written at the same time in the various subsidaries. a
timestamp field is a breakdown to the milisecond. however there is still a
chance of 1 to some billion, that two records have the same key.
just some possibilities
cheers
ralph
ralph_deffke@yahoo.de
""Leidago !Noabeb"" <leidago@googlemail.com> wrote in message
news:5bcf496e0908110004w94d29c2j4b01806822ca0143@mail.gmail.com...
> Hi
>
> I have the following tables setup in MYSQL:
>
> Region 1 Region 2
> HQ
> Tbl1 with autonumbered (PK) Tbl1 with autonumbered (PK)
> Tbl1 autonumbered-PK
>
> To explain the above. Basically there are two regions that collect
> information and then at the end of each month they have to send the
> information to HQ. This is fine, but the problem comes when the
> information (the data in the tables) is submitted to HQ. All three
> tables have the same names and the same structure. We want to
> synchronize the information sent by the regions into one table at HQ.
> How can we do this without having the duplicate number problem?
>
> Thanks