[Building Sakai] Idea: Change the GUID generator for Sakai

Matthew Jones matthew at longsight.com
Wed Jan 8 12:55:38 PST 2014


Well, we do have the shortened URL tool/service in trunk now that you can
use for this type of purpose and it does ship with a randomize (short) ID,
and checks for conflicts in the algorithm. These URL's are not portable
across systems, and it would probably be inefficient if this process was
used to create the id's in general. You'd need to be careful using
something else random as a URL because of all the url encoding/decoding
you'd end up having to also do, like if you base64 encoded the GUID's or
something. Seems like a waste when this is here.

There are some (most?) tools that don't use GUID's and just use an
auto-increment. Most of the stuff that uses hibernate does this with just
bigint id's (gradebook, samigo, etc). There *is* a uuid and other
generators for hibernate [1] but we really weren't too strong about
enforcing standards like that and (I guess?) cared less over time about
easy 1:1 system portability. Probably hoping that the archive service or
interoperability standards would be able to take care of and figure that
out. (Which it finally does a pretty good job of)

I'd say if you want fancy URL's, just use the shortened URL service. This
should be exposed more places in Sakai. If you don't like GUID's, just use
bigint. Even Glenn wanted to make most of these GUID's into integer keys
anyway years ago. [2]

[1]
http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/mapping.html#d0e5294
[2]
http://galvanometer.blogspot.com/2009/01/improving-sakais-authz-performance.html


On Wed, Jan 8, 2014 at 3:30 PM, Cris J Holdorph <holdorph at unicon.net> wrote:

> I almost completely agree with Matt.  I would bring up one additional
> point though.
>
> URLs
>
> You mention one of the only benefits would be in saving some bytes in
> the database.  However, I think another very small benefit, would be in
> saving some characters in URLs that might be shared.
>
> e.g., if I tell someone to visit the Sakai site (this site does not exist):
>
> http://sakai.unicon.net/portal/site/f7dc1ffb-6bd2-43e0-811f-d58cd12ffa79
>
> using a different/shorter guid, could result in a shorter url, e.g.,
>
> http://sakai.unicon.net/portal/site/XhcsnjHjIWc
>
> I still think the guaranteed uniqueness across sakai installations is
> very important, and I'd prefer to maintain that benefit even if it meant
> having to keep the existing long GUIDs.
>
> ---- Cris J H
>
> On 01/08/2014 10:19 AM, Matthew Jones wrote:
> > This is the "standard" format. [1] You can base64 or some other encode
> > this to save a few bytes, trading space for CPU and performance
> > complexity. I'm not sure what's better.
> >
> > The youtube format has a smaller number set, but their algorithm that
> > generates the number the backing value guarantees uniqueness only based
> > on that internal value, and it's not randomly picked.
> >
> > I believe that the initial reason for using GUID (instead of just auto
> > increment which would have been more efficient) was so you could take
> > this data in one Sakai system, and move it over to another Sakai system.
> > If you used something that was based on an algorithm which was active on
> > another system on fixed numbers, you'd very certainly have collisions.
> > With GUID, the possibility of this is the same as the possibility on the
> > same system.
> >
> > The way MySQL and Oracle index these text values, there really isn't any
> > performance problem with retrieval, so you're really only looking at the
> > savings in a few bytes of storage per GUID. I think, unless you're
> > changing this data type all the way down to a numeric value like an
> > INT/NUMBER, there won't be too much of a noticeable gain?
> >
> > [1] http://en.wikipedia.org/wiki/Globally_unique_identifier
> >
> >
> > On Wed, Jan 8, 2014 at 12:09 PM, Adam Marshall
> > <adam.marshall at it.ox.ac.uk <mailto:adam.marshall at it.ox.ac.uk>> wrote:
> >
> >     In the words of Borat: "I like".
> >
> >     adam
> >
> >     -----Original Message-----
> >     From: sakai-dev-bounces at collab.sakaiproject.org
> >     <mailto:sakai-dev-bounces at collab.sakaiproject.org>
> >     [mailto:sakai-dev-bounces at collab.sakaiproject.org
> >     <mailto:sakai-dev-bounces at collab.sakaiproject.org>] On Behalf Of
> >     Charles Severance
> >     Sent: 08 January 2014 17:02
> >     To: dev sakai
> >     Subject: [Building Sakai] Idea: Change the GUID generator for Sakai
> >
> >     Hi all,
> >
> >     I am wondering if we should just change the guid generator for Sakai
> >     to generate something smaller.  Out GUIDs are
> >
> >     8923c6aa-794f-43f0-8ea2-dc6f96556d6b
> >
> >     Things like YouTube have much more dense guids like
> >
> >     XhcsnjHjIWc
> >
> >     I don't know if there are reliable and yet short guids that use
> >     things like upper and lower case letters, etc.  Our GUIDs are HEX -
> >     not the densest.
> >
> >     I am not talking about any conversion of old GUIDs - just new ones.
> >
> >     What do folks think...
> >
> >     /Chuck
> >
> >     _______________________________________________
> >     sakai-dev mailing list
> >     sakai-dev at collab.sakaiproject.org
> >     <mailto:sakai-dev at collab.sakaiproject.org>
> >     http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
> >
> >     TO UNSUBSCRIBE: send email to
> >     sakai-dev-unsubscribe at collab.sakaiproject.org
> >     <mailto:sakai-dev-unsubscribe at collab.sakaiproject.org> with a
> >     subject of "unsubscribe"
> >     _______________________________________________
> >     sakai-dev mailing list
> >     sakai-dev at collab.sakaiproject.org
> >     <mailto:sakai-dev at collab.sakaiproject.org>
> >     http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
> >
> >     TO UNSUBSCRIBE: send email to
> >     sakai-dev-unsubscribe at collab.sakaiproject.org
> >     <mailto:sakai-dev-unsubscribe at collab.sakaiproject.org> with a
> >     subject of "unsubscribe"
> >
> >
> >
> >
> > _______________________________________________
> > sakai-dev mailing list
> > sakai-dev at collab.sakaiproject.org
> > http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
> >
> > TO UNSUBSCRIBE: send email to
> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
> "unsubscribe"
> >
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to
> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
> "unsubscribe"
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20140108/892cae9f/attachment.html 


More information about the sakai-dev mailing list