[thesite] Community News Category

.jeff jeff at members.evolt.org
Thu Dec 6 00:35:06 CST 2001


rudy,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: rudy
>
> in general the actual PK number should never matter
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

the exception, imo, is when the pk is visible in the url for purposes of
retrieving data.  in that instance the length of the pk is critical if
you're trying to keep urls as short and memorable as possible.  this is even
more important when working with pk's that will be encrypted to prevent
tampering and placed in the url as the encryption process will increase the
length of the pk exponentially.

a situation i ran into last year illustrates this quite well.  here at work
we use sybase adaptive server enterprise.  if the server is shut down or
rebooted without first shutting down the sybase services it burns an
identity gap upon restart.  by default this gap is ridiculous amount (can't
recall the exact percentage offhand, but it's something like 1%).  if your
pk column is a numeric(18) which is what we were using at the time, you go
from 2 or 3 digit pk's to 12 digits.  in one of the applications the pk is
encrypted (using a seed 2 characters long) and passed in the url to display
a receipt.  instead of 8-10 character encrypted pk's, we now have 24-26
character encrypted pk's in the url.  in the case of this site, add in the
shortest domain and "query string" (we use ssurl's) information possible and
we're looking at 64-66 characters.  we're getting close to bumping up to
that magic 70 character limit for url's in emails being mostly guaranteed to
not get wrapped.  now, what happens when we burn a gap again (you know you
can't trust that it'll only happen once)?  we've burned approximately 4-6
gaps so far and are still within the 12 digit threshold (we're at
700000000000+).  3 more and we're now at 11 digit pk's that balloon to 36-38
characters when encrypted which pushes the encrypted urls up over the magic
70 character limit to 76-78 characters.  this is now problematic.  some of
this can be rectified by changing the default gap that sybase will burn, but
it's an issue nonetheless.

a view of the world from my point of view.

before any of your run off to respond to this and the fact that it's not
applicable to changing the categoryid of "community news" from 1 digit to 2
digits, let me remind you that i'm already aware of that fact.

thanks,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/






More information about the thesite mailing list