Tag

SETNX

0 views collected around this technical thread.

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 idempotencyBackendRedis
0 likes · 3 min read
Ensuring API Idempotency with Redis and Unique Serial Numbers
Architecture & Thinking
Architecture & Thinking
May 30, 2023 · Backend Development

Mastering Distributed Locks with Redis: Techniques, Commands, and Best Practices

This article explains the concept of distributed locks, outlines various implementation strategies, and dives deep into Redis-based solutions—including SETNX, GET, GETSET, EXPIRE, and Lua scripting—to achieve mutual exclusion, safety, reentrancy, and automatic lock release in high‑performance systems.

Distributed LockHigh AvailabilityRedis
0 likes · 10 min read
Mastering Distributed Locks with Redis: Techniques, Commands, and Best Practices
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.

Distributed LockJavaLua Script
0 likes · 16 min read
Implementing Distributed Locks with Redis: From Basic to Advanced Schemes
IT Architects Alliance
IT Architects Alliance
Nov 29, 2021 · Databases

Three Redis-Based Rate Limiting Techniques: setnx, ZSet Sliding Window, and Token Bucket

This article explains three Redis-powered rate‑limiting methods—using SETNX for simple counters, leveraging ZSET for a sliding‑window algorithm, and implementing a token‑bucket scheme with LISTs—providing Java code examples, advantages, and practical considerations for high‑concurrency back‑end services.

BackendJavaRate Limiting
0 likes · 7 min read
Three Redis-Based Rate Limiting Techniques: setnx, ZSet Sliding Window, and Token Bucket
Java Architect Essentials
Java Architect Essentials
Nov 18, 2021 · Backend Development

Understanding Redis Distributed Locks: setnx, Redisson, and RedLock

This article explains how Redis setnx, the Redisson client, and the RedLock algorithm work together to implement distributed locks, discusses common pitfalls such as non‑atomic unlocks, and provides Lua scripts and Java pseudocode for safe lock acquisition and release.

Distributed LockJavaLua
0 likes · 10 min read
Understanding Redis Distributed Locks: setnx, Redisson, and RedLock
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.

Distributed LockLua ScriptRedis
0 likes · 10 min read
Understanding Redis Locks: setnx, RedLock, Redisson and Best Practices
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.

Distributed LockRedisRedisson
0 likes · 10 min read
Understanding Redis Locks: setnx, Redisson, and RedLock
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.

Distributed LockLuaRedis
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.

Distributed LockJavaLua
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.

Distributed LockLua scriptingRedis
0 likes · 10 min read
Understanding Redis Distributed Locks: setnx, RedLock, and Redisson