# Distributed Locking (Redlock)

> How do you implement a distributed lock with Redis? What is Redlock, and what are its limitations?

Canonical: https://www.internhack.in/learn/interview/redis-caching/redis-distributed-locking-redlock
Last updated: 2026-11-28

Difficulty: Advanced

## Question

How do you implement a distributed lock with Redis? What is Redlock, and what are its limitations?

*The full answer is for InternHack members. Open the page link above to read it.*

## Concepts covered

SET NX PX, Lock Token, Redlock, Fencing Token, Lua Compare-and-Delete

Previous: [Penetration, Breakdown, & Snowslide](https://www.internhack.in/learn/interview/redis-caching/redis-cache-pen-break-snow) · Next: [Pipelining](https://www.internhack.in/learn/interview/redis-caching/redis-pipelining) · [All of Redis & Caching](https://www.internhack.in/learn/interview/redis-caching)

## More Redis & Caching questions

- [Redis Streams](https://www.internhack.in/learn/interview/redis-caching/redis-streams-vs-kafka)
- [LRU vs LFU in depth](https://www.internhack.in/learn/interview/redis-caching/redis-eviction-lru-vs-lfu)
- [Lua Scripting](https://www.internhack.in/learn/interview/redis-caching/redis-lua-scripting)
- [Replication: Master-Slave](https://www.internhack.in/learn/interview/redis-caching/redis-replication-basics)
- [Memory Optimization](https://www.internhack.in/learn/interview/redis-caching/redis-internal-memory-optimization)
- [Redis Bitmaps](https://www.internhack.in/learn/interview/redis-caching/redis-bitmaps-use-case)

## Related

- [Learn](https://www.internhack.in/learn)
- [Interview Prep](https://www.internhack.in/learn/interview)
- [Redis & Caching](https://www.internhack.in/learn/interview/redis-caching)
