开发者

A Persistent Store for Increment/Decrementing Integers Easily and Quickly

开发者 https://www.devze.com 2023-02-05 21:26 出处:网络
Does there exist some sort of persistent key-value like store that allows for quick and easy incrementing, decrementing, and retrieval of integers (and nothing else). I know that I coul开发者_Python百

Does there exist some sort of persistent key-value like store that allows for quick and easy incrementing, decrementing, and retrieval of integers (and nothing else). I know that I coul开发者_Python百科d implement something with a SQL database, but I see two drawbacks to that:

  1. It's heavyweight for the task at hand. All I need is the ability to say "server[key].inc()" or "server[key].dec()"
  2. I need the ability to handle potentially thousands of writes to a single key simultaneously. I don't want to deal with excessive resource contention. Change the value and get out - that's all I need.

I know memcached supports inc/dec, but it's not persistent. My strategy at this point is going to be to use a SQL server behind a queueing system of some sort such that there's only one process updating the database. It just seems... harder than it should be.

Is there something someone can recommend?


Redis is a key-value store that supports several data types. Integer is present, along with incr and decr commands.

0

精彩评论

暂无评论...
验证码 换一张
取 消