Hi Olaf, > On 13. Dec 2020, at 11:13, Olaf Krueger <[email protected]> wrote: > > Hi again, > > we're working on a booking app. > In order to prevent over booking of a particular slot (A slot can booked only > once), it's crucial to know if a slot is already booked or even not. > > We're using a cluster of 3 CouchDB nodes, so having the eventual consistency > issue in mind the question is, if it's possible to basically achieve the > above requirement. > > The idea is to create an own document for each booking by using a custom _id, > e.g. > { > _id: = "slot1:booked > } > > But that would probably only work if CouchDB guarantees the uniqness across > all nodes. > Is that the case? > Or do we have to accept that consistency is sacrificed in favour of > availability?
Yes. > Or do we need to think about using another DB which sacrifies availability in > favor of consistency? Unless you can resolve a double-booking after the fact, yes. A memcached or redis instance is often used in conjunction with CouchDB, but other unique-id-register mechanisms exists. Best Jan — > > Many thanks! > Olaf > >
