Tuesday, July 27, 2010

Re: Stability of auto IDs

On 7/27/2010 8:40 AM, bruno desthuilliers wrote:
> On 27 juil, 07:19, Torsten Bronger <bron...@physik.rwth-aachen.de>
> wrote:
>> Hall chen!
>>
>> Currently, our Django app relies on the stability of various auto ID
>> fields which are implicitly generated by Django/database backend.
>
> auto ID are a RDBMS feature, Django is not involved. They are usually
> just sequential long ints. And as the name imply, they are meaningless
> and automatically generated, so whatever language / techno you use for
> the frontend, you just can't rely on auto ID. From a practical POV,
> starting from a mint empty DB and inserting records in the same order
> without any other client app accessing to the DB, you should probably
> get the same IDs, but there's absolutely no garantee.
>
Quite right. The major purpose of an auto ID is to be guaranteed unique.

We mostly look things up by primary key across relationships: to select
a user or a product then selection on the other attributes leads to a
much more satisfactory user experience.

POOR: Change the price of widget #345,231 to $3.14

GOOD: Change the price of the "2 cm left-handed tap widget" to $3.14

regards
Steve

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment