Difficulty: Advanced
How do you implement a distributed lock in Redis?
Use `SET resource_name my_random_value NX PX 30000`. The 'NX' ensures only one setter wins, and 'PX' prevents deadlocks if the client crashes.
SETNX, Redlock, Race Conditions, Resource Locking