Atomic operations in azure table storage

前端 未结 4 704
天命终不由人
天命终不由人 2020-12-17 14:57

I am looking to implement a page view counter in azure table storage. If say two users visit the page at the same time, and the current value on PageViews = 100, is it guara

4条回答
  •  情话喂你
    2020-12-17 15:15

    I came along with the same question. With Azure python library, I'm developing a simple counter increment using eTag and If-Match instead of lock. The basic idea is to retry to increase the counter until the update successfully runs under a certain criteria, which is no other updates interfere this running update. If the request of updates are heavy, sharding should be invoked.

    https://github.com/flyakite/simple-scalable-datastore/blob/master/datastore/azuretable.py

提交回复
热议问题