Home / Companies / Upstash / Blog / Post Details
Content Deep Dive

How Upstash Redis Runs More Commands in Parallel

Blog post from Upstash

Post Details
Company
Date Published
Author
Mehmet Dogan
Word Count
2,905
Company Posts That Month
33
Language
English
Hacker News Points
-
Post removed?
No
Summary

Upstash Redis has evolved its command execution model from a single critical section to a key-based locking system, allowing for improved concurrency and maintaining Redis-compatible semantics. Initially, Upstash Redis employed a serialized pipeline similar to traditional Redis, where commands were executed in a single-threaded manner to ensure data integrity. However, this approach limited performance by making independent commands wait unnecessarily. The current implementation introduces key-based locking, where commands lock only the specific keys or hash slots they operate on, enabling parallel execution of commands on unrelated keys while preserving isolation for those that share keys or hash slots. This change allows for increased throughput and reduced tail latency, especially in workloads with independent key operations, although the performance gains depend on the workload's characteristics. Key-based locking ensures that commands maintain a stable view of the in-memory store, while the introduction of hash tags and opt-in key-locking flags for Lua scripts and Redis Functions provides further control over command execution, allowing dynamic key management without compromising data integrity.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.