🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.replication
Article #627

Re: sytem wide unique keys

#627
From: Steve Ball
Date: Mon, 28 Jan 2002 10:50
34 lines
2221 bytes
With replication, as each site is running the same program, with the same
database (most the time) you need to keep each database Unique key unique
when the two databases are added togeather. We have gone down the route of
creating a UID for every record that is a combination of a number of values
that make it
unique to the database.

Each database is given a 3 letter code that we store in a table (lets call
it config_table)
We also assign a 3 letter code to each table (lets have TableA, TableB,
TableC).
We also use two letters AA to ensure that if we ever need to seperate
further we can (its a same guard that will proberbly never get used). We
also a generator that goes from - to + 2000000000 (or what ever the maximum
is you can set)

So The UID for tableA, on database ABC, could be TBA   ABC
AA   -2000000000 (or TBAABCAA-2000000000 )
the next record would be TBAABCAA-1999999999
if we added a record to table B we would then have UID =
TBBABCAA-1999999998
The other database would no clash the UID's because the site code keeps them
different for example site DEF on tableA = TBADEFAA-2000000000

I hope this helps.

Steve



"Kiesha" <kestas@kompera.lt> wrote in message news:3c5163fa_1@dnews...
> is there any tehnique to create system wide unique keys using generators ?
>
>
Technical Details
Message-ID: <3c552cc6_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.tele.dk!small.news.tele.dk!195.238.2.15!skynet.be!skynet.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews
References: <3c5163fa_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f89d7,6a5bf8f7572401b9
X-Google-Attributes: gidf89d7,public
X-Google-ArrivalTime: 2002-01-28 02:56:14 PST
From: "Steve Ball" <Steve@ClubRunner.co.uk>
Newsgroups: borland.public.interbase.replication
References: <3c5163fa_1@dnews>
Subject: Re: sytem wide unique keys
Date: Mon, 28 Jan 2002 10:50:22 -0000
Lines: 36
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 195.173.39.197
Message-ID: <3c552cc6_1@dnews>
X-Trace: dnews 1012214982 195.173.39.197 (28 Jan 2002 02:49:42 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.tele.dk!small.news.tele.dk!195.238.2.15!skynet.be!skynet.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews