incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Blakey <antony.bla...@gmail.com>
Subject Re: Proposal: Extending immutability
Date Mon, 12 Jan 2009 12:29:53 GMT

On 12/01/2009, at 10:26 PM, Noah Slater wrote:

> On Mon, Jan 12, 2009 at 05:15:39PM +1030, Antony Blakey wrote:
>> --- Revised Proposal ---------
>>
>> Each document, whether canonical or derived, has a globally unique
>> identity consisting of a UUID and the document ID.
>>
>> In the case of a canonical document, the UUID is the UUID of the
>> database (or cluster), which is assigned when a database is created.
>>
>> In the case of a (derived) view map result, it is the UUID of the map
>> function (not the design doc), which is assigned to each map function
>> (i.e. view) in a design doc when the design doc is created or  
>> updated.
>>
>> Furthermore, there is a triple {UUID, document id, document rev} that
>> globally identifies a document at a given point in time. The key
>> characteristic being that a {UUID, id, rev} identifies an immutable
>> value.
>
> Why use UUID like this? Why not let the database (&c) name suffice?

Because if the database is deleted and the name reused, intermediaries  
can't tell. We presume that's not likely, but in a world of database- 
per-user (as discussed on IRC recently), which could conceivable be  
extended to domains other than users, who nows what the future might  
bring. The same goes for _externals wanting to invalidate secondary  
indexes in such a scenario.

i.e. the UUID of a database represents a context in which (id + rev)  
is immutable. If you use the db name, that's no longer true because  
you no longer have a globally unique namespace.

Antony Blakey
--------------------------
CTO, Linkuistics Pty Ltd
Ph: 0438 840 787

Isn't it enough to see that a garden is beautiful without having to  
believe that there are fairies at the bottom of it too?
   -- Douglas Adams


Mime
View raw message