couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Davis" <>
Subject Re: Can I guarantee uniqueness in a field without using _id?
Date Mon, 12 Jan 2009 22:24:20 GMT
> Unless anybody can think of a way to guarantee uniqueness in CouchDB, I
> think I am going to abandon the notion of GUARANTEED uniqueness and instead
> implementcode to PREFER uniqueness. Then at the end of the day, we can write
> some code that will tell us if that 1 in a million chance (i.e. two
> simultaneous inserts/updates) left our database in a state where there are
> two docs with the same unique field.
> Since the odds are quite low that it will actually happen, I think we can
> deal with the times that it happens manually so long as we know about it.
> Sunny

You have just identified the problem and solution that CouchDB solves
with using a traditional RDBMS in a distributed environment. Check out
the discussion on the CAP hypothesis (Others call it a theorem, I'm
not convinced, but the basic idea is there).

Or more succinctly, guaranteed uniqueness requires global state,
global state does not scale.

Paul Davis

View raw message