couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Smith <>
Subject Re: Why MD5 is used for hashes, also about non-deterministic IDs.
Date Tue, 15 Nov 2011 06:18:49 GMT
On Tue, Nov 15, 2011 at 5:19 AM, Dustin Sallings <> wrote:
> On Nov 14, 2011, at 8:41 PM, Alex Besogonov wrote:
>> Now, it might not sound too threatening, but this attack breaks the
>> main invariant of
>> CouchDB - database replicas won't ever be eventually consistent!
>> Also, I'd like to use stronger hash just on general principles.
>        I'd prefer to get rid of this functionality altogether.  It's wrong even
in cases where people aren't being malicious.
>        Example:
>        I have a document that represents how many things I've got.
>        On node A, I increment the number of things.  I go from 5 things to 6 things.
>        On node B, I increment the number of things.  I go from 5 things to 6 things.
>        Replication catches up, sees the same digest, and now I have six things --
but this is incorrect.  I have seven things (or at least a conflict).

Hi, Dustin. I think your data model is incomplete.

You seem to care where or when or under what circumstances a change
occurred. Yet you don't care enough to store that information in the
document. That is an odd approach. A timestamp, for example, would
trigger a conflict.

Also, no doubt your example is as simple as possible; but for
posterity, the idiomatic way to count things is to have one document
per thing and _count them up in a reduction. In that case, you would
have seven things and no conflicts.

Iris Couch

View raw message