Replication of autonumber IDs

Startbeitrag von Peter Muckle am 07.06.2017 15:49

Hi All,

I've just started looking into universal replication using HFSQL between mobile and cloud.

One thing I don't understand is how autonumber IDs are resolved - my users will be adding new records, then adding linked records. Are the numbers changed during replication?

Thanks, will probably have more questions about this topic.




Hi Peter,

it looks like yo are talking about pcsoft's black box...

In that case, they simply reserve a range of autoID for each DB. My understanding (based on personal testing) is that each DB has a range corresponding to an INT on 4, ie 2 billions records, and you can have in theory 2 billions DBs, thus using the full 8 bytes of the mandatory autoID size in pcsoft replication system.

Don't look for too much information on their replication system, it's just not there.

Best regards

von Fabrice Harari - am 07.06.2017 16:19
Hi Fabrice,

sounds to me as there were GUIDs instead of integers a little bit more practical ... just a small part of 50 years of IT experience ... btw we do synchronize a few hundred cash registers of our customers using GUIDs. I just don't see the use of those age old integers used as auto IDs. Maybe, it's a dBase heritage, who knows? Ok, it's late, good night!

von GuenterP - am 07.06.2017 20:09
Although I coded it myself in WX, the native availability of an HF/WL GUID data type has been requested for many years with tech support by me... I guess it's not sexy enough to put in their yearly novelties brochure ;-) lol

von Pierre D. - am 07.06.2017 20:39
Hi Pierre,

15 years ago we (Systemhaus Predl) published a GUID function on our web site (it had been for WINDEV 5.5 already), and there is an official GetGUID function available since version 15!

von GuenterP - am 08.06.2017 04:27
Hi Guenter,

I agree, I find GUID more practical for replication too, which is why I'm using them in WXReplication.

However, the question was about autoIDs in PCSot native replication system.

Best regards

von Fabrice Harari - am 08.06.2017 11:41
Thanks Fabrice and everyone else for your answers and comments. So the replication engine assigns a block of IDs before the initial sync. That makes sense.

Previously I have used GUIDs combining deviceID and a count in seconds from a given date, and may go back to this approach.

Presently I only have a need for unidirectional replication, with most data going from mobile to server, so I thought I'd look at the black-box version first for simplicity. Ideally I'd like to compare the speed between a replication and sending data through httpforms (for the latter I would use GUIDs). The records only have a couple of fields each but there may be a lot of records to send. Replication looks easier for delivering filtered data to users from what I can see.

Thanks again


von Peter Muckle - am 08.06.2017 13:33
Hi Peter

it seems that yo are not using the word GUID the same way.

From your explanation, it looks like you have been using a composite key that you made logically unique, not a GUID.

A guid is a string of hexadecimal values like this a53e98e4-0197-4513-be6d-49836e406aaa (with or without formatting) and the mysterious mathematical magic behind the system allowing to generate guid makes them supposedly unique at the level of the universe...

When I fist started to use GUID, I created a file with a unique string key and coded a loop generating guid and writing them in the file. I let that run on a computer for 2 weeks before starting to believe the tale.

I stopped before the hard drive was full, though, so I must have SOME faith in the theory

Best regards

von Fabrice Harari - am 08.06.2017 17:33
Thanks for the correction Fabrice



von Peter Muckle - am 08.06.2017 17:52
Zur Information: hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.