Locking and Redis

后端 未结 2 521
野性不改
野性不改 2021-02-03 11:28

We have 75 (and growing) servers that need to share data via Redis. All 75 servers would ideally want to write to two fields in Redis with INCRBYFLOAT operations. W

2条回答
  •  执笔经年
    2021-02-03 12:05

    Redis does not lock. Also, it is single threaded; so there are no race conditions. Reads or Writes do not block.

    You can run millions of INCRBYFLOAT on the same key without any problems. No need for external processes. Reading those fields does not pose any problems.

    That said, "Millions of updates to two keys" sounds strange. If you can explain your use case, perhaps there might be a better way to handle it within Redis.

提交回复
热议问题