[WF-Infra] System wide unique ID's proposal

Philippe Jadin philippe at 123piano.com
Sat Oct 27 14:56:00 PDT 2001


As we all noticed, broken links are a constant problem when refering to
content on worldforge servers. Someone moved a page, an image has been
renamed, the irc logs have moved to another server, ... (well it's a
problem on every site of course)

For example : what will happen when moria.mit.edu:8080/wf will become
worldforge.org ? This will be a pure (I really mean "pure") mess ;-). Of
course we can use relative links, but what happens when a page is moved,
because it makes more sense?

So, I'd like to introduce a simple idea that would help keeping those
links working.

Every element we can link to should have a unique ID. This ID would be
independant from the physical location of the element. This way, an
element can be moved to another location, or it's server may change it's
url without problem.

1. The unique ID

I thought that it would be a good idea to add a prefix to the unique id,
depending on the nature of the content :

- Web pages (zope) : web-xxxxxxxx (generated by zope)

- RT tickets : rt-xxxxxx (using existing tickets numbers of course -
generated by postgresql)

- Media : media-xxxxxxx (generated by the media repository -> same
system as for webpages)

- IRC logs : irc-xxxxx (either a date or a bookmark I guess. Any other
idea ?)

- News item : news-xxxxxx (either from eidetic or zope)

- Forum thread : forum-xxxxxxx (when there will be one for discussing
media needs for example)

2. How to use it?

In our webpages, we would put something like :
<a href="/link?id=web-123456">Link to web page 123456</a>

This could even be : 
<a href="web-123456">Link to web page 123456</a>
... if we added a custom handler for 404 in zope (it's a possibility
we'll need to test)

There would be also a search system that would gives you the right page
(or element) simply by typing the id in a search box.

In discussions, we could refer to anything easily:

<Billy> Hey Joe, look at my new media : www.worldforge.org/media-123456
<Joe> Looks nice, Billy ;-)

3. Implementation

Mithro found a way to generates auto incrementing uniques ID's in zope.
For other type of content, most of the time we already have a unique ID
(generated by a postgresql DB, or so). In this case we'd use the
exisiting ID.

Conclusion ?

Before :

<Ben> Hi, I'm new to worldforge, what can I read guys ?
<Joe> Ben : look at moria.mit.edu:8080/project/newbie for the newbie
guide (from the top of my head)
<Ben> I get a 404 :-(
<Joe> Oh yes, we moved to worldforge.org I guess

After : 
<Ben> Hi, I'm new to worldforge, what can I read guys ?
<Joe> Ben : look at www.worldforge.org/web-547 for the newbie guide
(from the top of my head)
<Ben> I get a 404 :-(
<Ben> Just kidding ;-) - it looks interesting!
<Joe> You are welcome

What do you think of this idea|id ? (or sould I say id|idea...)

Philippe (/me likes little stories)

More information about the Infra mailing list