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

Charles Severance csev at umich.edu
Wed Jan 8 20:35:04 PST 2014


Matt - 

You keep making this too complex.  Short URLs require a database table.   We cannot afford to add lookups all the places where we work with GUIDs.

I am simply saying we change this line of code:

kernel-impl/src/main/java/org/sakaiproject/id/impl/UuidV4IdComponent.java

    public String createUuid()
    {
        return UUID.randomUUID().toString();
    }

Not to use the toString() method but instead take UUID.randomUUID() and generate a Base-62 encoding of  the uuid instead of a Base-16 encoding with some dashes.

Nothing more.   Instantly makes all of our URLs shorter.  Low risk - no performance impact.

/Chuck

See also: http://stackoverflow.com/questions/772802/storing-uuid-as-base64-string

On Jan 8, 2014, at 4:50 PM, Matthew Jones <matthew at longsight.com> wrote:

> Sorry, I must have only skimmed the summary.
> 
> In that case, I don't see much point. Shortened URL service already does this better. If we're going, short, you want to go as short as possible, get rid of portal/site all that, maybe even a shorter domain name. Whether it's a 10 character encoded or 36 character encoded URL doesn't seem like it makes any difference in an expanded form. And it ends up making (slightly) harder for those in tiered support to figure out the relationship between the URL and the site, you'd have to go through this type of algorithm or site look-up table somewhere to get that information out of the database? Then you'd probably want these encoded ids to work with /direct/ to work with /access/, to work with the admin tools, not just portal. Seems dangerous if it's not super easy to expand these to the user again anywhere anyway.
> 
> Look at something like on Amazon, this URL is far from pretty, it's got a ton of crazy data in it, but a small bit is the short part.
> http://www.amazon.com/Sakai-Free-as-Freedom-Alpha-ebook/dp/B005227LYO/ref=sr_1_1?ie=UTF8&qid=1389217620&sr=8-1&keywords=charles+severance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20140108/a6a6f554/attachment.html 


More information about the sakai-dev mailing list