Tagged articles
22 articles
Page 1 of 1
Xuanwu Backend Tech Stack
Xuanwu Backend Tech Stack
Dec 23, 2025 · Backend Development

Mastering Redis Distributed Locks: From SETNX to RedLock and WatchDog

This article walks through the evolution of Redis distributed locks—from basic SETNX mutual exclusion to atomic SET with expiration, Lua‑based safe unlocking, Redisson's WatchDog auto‑renewal, and the RedLock algorithm—highlighting pitfalls, best‑practice implementations, and interview‑style Q&A for robust production use.

JavaRedlockWatchdog
0 likes · 15 min read
Mastering Redis Distributed Locks: From SETNX to RedLock and WatchDog
Lobster Programming
Lobster Programming
May 27, 2025 · Backend Development

Ensuring API Idempotency with Redis and Unique Serial Numbers

This article explains how to achieve API idempotency by having clients send a short‑lived unique serial number, storing it as a Redis key with SETNX and an expiration, and handling the Redis response to process or reject duplicate requests.

API idempotencyredissetnx
0 likes · 3 min read
Ensuring API Idempotency with Redis and Unique Serial Numbers
Wukong Talks Architecture
Wukong Talks Architecture
Apr 2, 2023 · Backend Development

Implementing Distributed Locks with Redis: From Basic to Advanced Schemes

This article examines the shortcomings of local locking in microservices, introduces distributed locking concepts, and walks through five progressive Redis-based lock implementations—from a simple SETNX bronze approach to a Lua‑scripted diamond solution—detailing their mechanisms, code examples, and trade‑offs.

JavaLua Scriptdistributed-lock
0 likes · 16 min read
Implementing Distributed Locks with Redis: From Basic to Advanced Schemes
Programmer DD
Programmer DD
Oct 9, 2021 · Databases

Mastering Redis Locks: From SETNX to RedLock and Redisson

This article explains the fundamentals of Redis locking mechanisms, covering SETNX usage, the pitfalls of naive implementations, Lua‑based atomic unlock scripts, the Redisson client library, and the RedLock algorithm, while providing practical code examples and diagrams to illustrate each concept.

LuaRedlockdistributed-lock
0 likes · 10 min read
Mastering Redis Locks: From SETNX to RedLock and Redisson
Architecture Digest
Architecture Digest
Oct 2, 2021 · Databases

Understanding Redis Locks: setnx, RedLock, Redisson and Best Practices

This article explains how Redis locking works, covering the setnx command, the importance of using unique values, atomic unlock via Lua scripts, the Redisson client features, and the RedLock distributed algorithm, while highlighting common pitfalls and practical recommendations.

Lua ScriptRedlockdistributed-lock
0 likes · 10 min read
Understanding Redis Locks: setnx, RedLock, Redisson and Best Practices
MaGe Linux Operations
MaGe Linux Operations
Oct 1, 2021 · Backend Development

Mastering Redis Distributed Locks: From SetNX to RedLock and Redisson

This article explores the most common Redis locking mechanisms—SetNX, RedLock, and Redisson—detailing their principles, pitfalls, and implementation nuances, including code examples, Lua scripts for atomic unlocks, and best‑practice recommendations for building reliable distributed locks in backend systems.

Backend DevelopmentRedlockdistributed-lock
0 likes · 11 min read
Mastering Redis Distributed Locks: From SetNX to RedLock and Redisson
Top Architect
Top Architect
Oct 1, 2021 · Backend Development

Understanding Redis Locks: setnx, Redisson, and RedLock

This article explains how Redis locking works by detailing the setnx command, its modern usage with the SET command and PX expiration, common pitfalls, safe unlocking with unique values and Lua scripts, and introduces Redisson's lock implementations and the RedLock algorithm for distributed environments.

Backend DevelopmentRedlockredis
0 likes · 10 min read
Understanding Redis Locks: setnx, Redisson, and RedLock
Su San Talks Tech
Su San Talks Tech
May 16, 2021 · Backend Development

Mastering Distributed Locks with Redis: From Bronze to Diamond Solutions

This article examines why local locks fail in distributed systems, introduces Redis‑based distributed locking, and walks through five progressive solutions—from a simple SETNX implementation to atomic Lua scripts—highlighting each approach's drawbacks and how to mitigate them.

Backendredissetnx
0 likes · 16 min read
Mastering Distributed Locks with Redis: From Bronze to Diamond Solutions
MaGe Linux Operations
MaGe Linux Operations
Jul 29, 2020 · Backend Development

How to Build Safe Distributed Locks with Redis and Redisson

This article explains why simple SETNX/EXPIRE commands can cause deadlocks, shows how to achieve atomic lock operations with Lua scripts or the Redis SET command, and demonstrates how to use the Redisson library for re‑entrant, auto‑renewing distributed locks in Java.

Lua Scriptdistributed-lockredis
0 likes · 8 min read
How to Build Safe Distributed Locks with Redis and Redisson
Top Architect
Top Architect
Jul 13, 2020 · Databases

Understanding Redis Distributed Locks: setnx, Redisson, and RedLock

This article explains the fundamentals and pitfalls of using Redis for distributed locking, covering the setnx command, the SET command with NX and PX options, Lua‑based lock scripts, Redisson’s lock implementations, and the RedLock algorithm, along with practical code examples.

LuaRedlockdistributed-lock
0 likes · 12 min read
Understanding Redis Distributed Locks: setnx, Redisson, and RedLock
Architecture Digest
Architecture Digest
Jul 4, 2020 · Databases

Understanding Redis Locks: setnx, RedLock, and Redisson

This article explains the fundamentals of Redis locking mechanisms, including the setnx command, the RedLock algorithm, and how the Redisson Java client implements distributed locks with Lua scripts, highlighting pitfalls, best practices, and code examples for safe lock acquisition and release.

JavaLuaRedlock
0 likes · 10 min read
Understanding Redis Locks: setnx, RedLock, and Redisson
Architect's Tech Stack
Architect's Tech Stack
Jun 11, 2020 · Backend Development

Understanding Redis Distributed Locks: setnx, RedLock, and Redisson

This article explains how Redis can be used for distributed locking, covering the setnx command, the SET command with NX and PX options, common pitfalls, Lua‑based atomic unlock scripts, the Redisson client, and the RedLock algorithm for achieving reliable locks across multiple nodes.

Backend DevelopmentLua scriptingRedlock
0 likes · 10 min read
Understanding Redis Distributed Locks: setnx, RedLock, and Redisson
Programmer DD
Programmer DD
Jun 11, 2020 · Backend Development

Mastering Redis Distributed Locks: From SETNX to RedLock and Redisson

This article explores Redis locking mechanisms, explaining the SETNX command, its limitations, the use of PX for timeouts, Lua scripts for atomic unlocks, and introduces Redisson’s advanced lock implementations including RedLock, while highlighting practical pitfalls and best‑practice recommendations for reliable distributed synchronization.

LuaRedlockredis
0 likes · 11 min read
Mastering Redis Distributed Locks: From SETNX to RedLock and Redisson
21CTO
21CTO
Nov 8, 2017 · Backend Development

Mastering Redis Distributed Locks: From Basics to Robust Java Implementations

This article explains how to build reliable distributed locks with Redis, covering essential commands, common pitfalls, improvements using GETSET, Lua scripting for atomicity, and complete Java code examples that address deadlock and unlock vulnerabilities.

JavaLua Scriptdistributed-lock
0 likes · 15 min read
Mastering Redis Distributed Locks: From Basics to Robust Java Implementations