couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cottlehuber <>
Subject Re: Data modelling
Date Thu, 12 Jul 2012 14:41:39 GMT
On 12 July 2012 15:47, Matthieu Rakotojaona
<> wrote:
> Just a precision :
> On Thu, Jul 12, 2012 at 1:07 PM, Bernhard Gschwantner
> <> wrote:
>> With that construction, you can be sure that it will never happen that you
>> deduct an amount from one account and never add it to the other. If you
>> make this two transaction documents, It could be that you try to create
>> both documents, but only one succeeds. Or if you replicate your database,
>> the first one is replicated, and then the network connection goes down.
> You can use the _bulk_docs endpoint with the all_or_nothing option, to
> use some kind of transaction :
> I know that replication uses the bulk API for putting the docs on the
> target, but I don't know if it includes this option.
> --


Yes this is possible on a single instance but you can't guarantee
anything greater than a single document transaction as soon as you
subsequently use _changes, replication or views on top of that DB.


View raw message