Redis scripts do not expire keys atomically
This post by an Ably engineer discusses the use of Redis for key-based storage in their pub/sub messaging platform and how they resolved a problem related to maintaining the integrity of related keys when using expire operations within Lua scripts. The issue was that naively expiring multiple keys in the same script did not guarantee atomicity, leading to potential inconsistencies. The solution involved using EXPIREAT to set an absolute expiry time for all related keys and reordering key expiry to ensure consistency.
Company
Ably
Date published
Jan. 25, 2022
Author(s)
Andrew Dunstall
Word count
743
Hacker News points
67
Language
English