Globally Unique Identifier


Modified on 02/10/2003 at 23:11
Creator: Mickaël Rémond

2 - Localisation driven GUID

Joe Armstrong's brain dump:

guid://{m1,m2,m3}m/Date/Seq

m1,m2,... are hints to the machine which might contain a copy of guid://m/Date/Seq

m is the creation machine.

This could be re-written later as

guid://{k1,k2}m/Data/Seq

3 - Meaningless GUID

Ulf Wiger proposal:

new_guid() -> {node(), erlang:now()}.

export_guid({N,{Ms,S,Us}}) -> lists:concat( [atom_to_list(N), ".", integer_to_list(Ms), ".", integer_to_list(S), ".", integer_to_list(Us)]).

Rationale:

(1) The new_guid() function is really cheap

(2) It is also defined such that it is unique (unless we start renaming hosts or messing with the system clock.)

(3) It can be generated either manually or automatically (even though when manually generated, you might want to alter it somewhat (which is a Good Thing, since we don't want conflicts betw manually and automatically generated GUIDs.

(4) The GUID is reasonably readable, and can be re-formatted for better readability (converting to date-time format)

(5) The GUID reflects where the entity was created, not necessarily where it resides. In Command & Control, the basic questions to answer are the 4 'W's: Who?, What?, When?, Where? (*) (+ sometimes, but not always, Why?)

(6) You may receive multiple indications of the same thing, and must be able to tell the indications apart (and do source credibility analysis). This basically means "tag everything".

(7) I often also create a GUID for modified

(*) As in - "Who is reporting?" - "What happened?" - "Where did it happen?" - "When did it happen?"

 

[ News | About us | Documentation | Links | Projects & Contribs | Success stories | Binary packages | Other languages ]
This site is made and run by the Erlang Projects Association
Copyright 2003 Mickaël Rémond, Thierry Mallard
Powered by Zope, CPS and Nuxeo