Can I do transactions and locks in CouchDB?

前端 未结 7 1948
难免孤独
难免孤独 2020-11-29 15:40

I need to do transactions (begin, commit or rollback), locks (select for update). How can I do it in a document model db?

Edit:

The case is this:

    <
7条回答
  •  伪装坚强ぢ
    2020-11-29 15:58

    Expanding on MrKurt's answer. For lots of scenarios you don't need to have stock tickets redeemed in order. Instead of selecting the first ticket, you can select randomly from the remaining tickets. Given a large number tickets and a large number of concurrent requests, you will get much reduced contention on those tickets, versus everyone trying to get the first ticket.

提交回复
热议问题