All Questions
Caching hard

You are designing a Lua script for Redis Cluster to atomically move money between two users: `user:A` and `user:B`. Why might this fail?

  1. A Server-side Lua scripts are fundamentally unsupported in a Redis Cluster environment due to the lack of cross-node execution support.
  2. B Global transaction atomicity is an impossible architectural goal for any NoSQL system that utilizes a sharded, multi-master topology.
  3. C If the keys hash to different Hash Slots located on different physical nodes, the operation is a 'Cross-Slot' call and is rejected by the cluster.
  4. D Redis Cluster does not support the internal floating-point arithmetic required to perform accurate financial calculations within a script.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions