Skip to main content
v3.1.1•Apache 2.0 Licensed•Python 3.9 – 3.14t Ready

Reactive, Lock-Free Key-Value Store for Concurrent Python

Lock-free reads always, deterministic write mutexes, automatic background TTLs, reactive subscriptions, and true multi-core parallel scaling on free-threaded Python (3.13t / 3.14t).

$pip install nimbuskv
from nimbuskv import NimbusKV

# In-memory reactive store with automatic background TTL
with NimbusKV() as store:
    store.set("user:101", {"status": "active"}, ttl=60)
    print(store.get("user:101"))
    
    # Check remaining TTL deadline in seconds
    print(store.ttl("user:101"))
[SET] user:101 (TTL: 60s)
HAMT root snapshot swap
Python 3.9+
Standard CPython Support
3.13t & 3.14t Ready
Free-Threaded Multi-Core
Apache 2.0
Permissive Open Source
5 / 6 Passed
5 Passed · 1 Gotcha Handled
02 — Interactive Proof

Test In-Browser Store Simulation

Verify key mutation, generational TTL deadlines, atomic compound increments, and subscription events in real-time.

JavaScript Simulator EngineOpen Concurrency LabsFull Playground
Store SimulatorBrowser simulation, not running Python
Preset Operations
Python Code Invocation
>>>
Live Store State (HAMT Snapshot)3 keys active
session:user_42TTL: 15s
{"username":"alex_dev","role":"admin"}
counter:visitsPersistent
124
config:cache_modePersistent
lock_free_hamt
Reactive Subscription Stream
setsession:user_42:TTL=15s (Generation: 1)
Just now
atomiccounter:visits:Incremented to 124
Just now
Execution Transparency: The embedded widget above runs a client-side JavaScript simulation for instant feedback. For full CPython 3.12 WebAssembly compilation, visit the dedicated Playground.
Explore Concurrency Labs
03 — Why the Design Matters

Snapshot Architecture & Multi-Core Evidence

How persistent Hash Array Mapped Tries (HAMT) enable lock-free reads while deterministic write coordination eliminates CAS retry storms.

1. Readers Never Acquire Locks

Reader threads access the immutable HAMT root pointer directly. Reads never block on writers and exhibit zero latency jitter.

2. Short Write Mutex Coordination

Writes acquire a short mutex (<2µs) to construct the new HAMT root via structural sharing and atomically swap the root pointer.

3. Reactive Notification & Wakeup

Registered subscribers receive set, delete, and expire callbacks, while worker threads suspended in wait_for() wake up immediately.

Verified Benchmark Proof

Multi-Threaded Throughput & Latency Profile

Performance Lab & Comparator
4.19M ops/s
Peak Concurrent Read Throughput
Lock-free reads (4 threads)
365.6k ops/s
Peak Disjoint Write Throughput
Synchronized snapshot swap (1 threads)
5 / 6
Correctness Tests Verified
Zero race conditions or lost updates
04 — Get Productive

Adopt NimbusKV for Your Specific Workload

Explore idiomatic Python code tours, verify your architecture fit, and start building with production-ready patterns.

Adoption AssistantInteractive Decision Flow

Is NimbusKV Right for My Application?

Select what you are building and your process deployment architecture to receive an honest fit assessment, copyable code, and key trade-offs.

Recommended Approach

Use NimbusKV's immutable snapshot core with temporary cached values & session store. Readers execute lock-free in <0.65µs without contending with mutations.

Important Limitations to Know
  • TTLs are evaluated lazily upon read and proactively swept by an internal min-heap thread.
  • Heap compaction (v3.1.1) drops stale reschedule entries, but highly dynamic workloads should avoid millisecond-scale churn on millions of unique keys.
Verified Example — NimbusKV v3.1.1
from nimbuskv import NimbusKV
import time

# Embedded, zero-overhead in-memory cache
store = NimbusKV()

# Store session with a 30-second TTL
store.set("session:token_user_42", {"uid": 42, "role": "admin"}, ttl=30)

# Instant lock-free read (<0.65µs, never blocks writers)
session = store.get("session:token_user_42")
print(f"Active user: {session['uid']}")

Idiomatic Python Code Tour

Tested on Python 3.9 – 3.14t
quickstart.pyVerified with NimbusKV v3.1.1 · Standard CPython · Oct 2026
from nimbuskv import NimbusKV
# In-memory store with automatic background TTL
with NimbusKV() as store:
store.set("session:abc", {"user_id": 42}, ttl=3600) # expires in 1 hour
print(store.get("session:abc"))
# Check remaining TTL in seconds
print(store.ttl("session:abc"))
05 — Trust and Community

Credible Signals & Continuous Verification

Transparent release metadata, verifiable CI pipelines, honest technical limitations, and continuous improvements.

Latest Production Releasev3.1.1

NimbusKV v3.1.1— Concurrency Hardening & Memory Safety

Release DateOctober 2026
LicenseApache 2.0 Permissive
Python Support3.9 – 3.14t (Free-Threaded)
CI Verification100% Tests Passing
Key Improvements in v3.1.1

TTL Heap Compaction (_compact)

Memory Fix

Periodically rebuilds the internal min-heap to drop stale expiration deadlines from repeatedly rescheduled keys, preventing unbounded memory growth under hot keys.

Deterministic Write Mutex (<2µs hold)

Concurrency

Replaced optimistic CAS retry loops with a single short write mutex, completely eliminating retry-storm throughput collapse under high thread contention.

ReentrantWriteError Deadlock Guard

Safety

Detects reentrant mutation calls inside atomic() or mutate() callbacks and raises immediately instead of hanging in an unrecoverable deadlock.

Permissive Apache 2.0 License

Licensing

Officially licensed under Apache 2.0 (migrated from GPLv3 in v3.1.0), enabling frictionless commercial, cloud, and proprietary enterprise adoption.

Ready to update? Run pip install --upgrade nimbuskv. Fully backwards-compatible with v3.1.0 code.
Upgrade guide

Ready to build with lock-free concurrency?

Install NimbusKV and start leveraging reactive in-memory storage on Python 3.9 through free-threaded 3.14t.

$pip install nimbuskv