Home > Archive > SQL Anywhere Mobile > March 2005 > Mobilink Primary key strategy









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Mobilink Primary key strategy
Razan

2005-03-30, 9:43 am

I have an application on ASA and we intend to synchronize data with
MobiLink.
By your experience, What is the best way to maintain primary keys uniques ?
ML Guide says :
- Using UUIDs (a bit heavy for the db I think)
- Using Key pools (a bit tricky)
- Using global autoincrement (beware when exhausted...)

Is there another way ?

Thank you,

Razan


Breck Carter [TeamSybase]

2005-03-30, 9:43 am

DEFAULT GLOBAL AUTOINCREMENT is the way to go.

Here's an excerpt from Chapter 1, Creating, in SQL Anywhere Studio 9
Developer's Guide ISBN 1-55622-506-7:

=====
For example, with UNSIGNED BIGINT the partition size can be as large
as 4,294,967,298 with a GLOBAL_DATABASE_ID up to 2,147,483,646. That
means you can have over four billion different default values in each
of two billion databases and they are all unique. With a smaller
number of databases the partition size can grow even larger; with a
GLOBAL_DATABASE_ID limited to 1,000 you can create
1,000,000,000,000,00
0 unique values in each database.
=====

Breck

On 25 Mar 2005 09:26:25 -0800, "Razan" < m_NOSPAM__razan@syba
se.com>
wrote:

>I have an application on ASA and we intend to synchronize data with
>MobiLink.
>By your experience, What is the best way to maintain primary keys uniques ?
>ML Guide says :
>- Using UUIDs (a bit heavy for the db I think)
>- Using Key pools (a bit tricky)
>- Using global autoincrement (beware when exhausted...)
>
>Is there another way ?
>
>Thank you,
>
>Razan
>


--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/A...7/risingroad-20
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
Greg Fenton

2005-03-30, 9:43 am

Breck Carter [TeamSybase] wrote:
> DEFAULT GLOBAL AUTOINCREMENT is the way to go.
>


I concur. The only slightly tricky part of GLOBAL AUTOINC is the
setting of the GLOBAL_DATABASE_ID. But if you want to ensure uniqueness
everywhere, then you either have to have some communication between
databases (setting GLOBAL_DATABASE_ID, downloading key pools, etc...) or
you have to go with UUIDs (which are ugly to work with...try tracking
down a data problem in a database that uses UUIDs in referential
integrity...*shudder*).

The automation of setting GLOBAL_DATABASE_ID's
is actually pretty
straight forward...in fact, I'm working on just that part of
synchronization for a customer today.

greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com