couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Blakey <antony.bla...@gmail.com>
Subject Re: Bulk Docs
Date Mon, 16 Mar 2009 00:00:58 GMT

On 16/03/2009, at 10:02 AM, Chris Anderson wrote:

> Damien once mentioned on IRC a clever way to do ordered lists. Keep
> each item in it's own document, and store the list position as a
> float. To insert an item between two others, average their
> position-floats and use that. In the case of replication with other
> items on the list from remote nodes, approximate order should be
> preserved.

I've user that technique in the past. The problem is that after a  
while you end up rounding off due to limited precision, and the user  
is left wondering why they can't change the order of their items. And  
you can't just renumber because that's begging the question.

An alternative is to use ascii strings and rely on the fact that a <  
am < b, which allows infinite subdivision, although the problem then  
is that string length is unbounded, and then you need to consider the  
lifetime of the data and the insertion statistics, so it's not  
suitable for all ordering problems.

I think it's obvious that any system such as this is going to require  
unbounded precision - which is what the string length represent.

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

The greatest challenge to any thinker is stating the problem in a way  
that will allow a solution
   -- Bertrand Russell


Mime
View raw message