Guides & Tutorials
Practical setup guides, performance tuning for free-threaded Python, migration workflows, and upgrade notes.
Install NimbusKV from PyPI, configure SQLite, Redis extras, and local development test suites.
Configure CPython 3.13t/3.14t with PYTHON_GIL=0 for true multi-core parallel read execution.
Understand the deterministic write mutex overhaul, ReentrantWriteError, and atomic notifications.
Transition smoothly from the legacy LiveDict library to the modern NimbusKV API.
1. Installation & Environment Setup
NimbusKV requires Python 3.9+ and has minimal dependencies. It is published on PyPI.
To run from source or contribute to the library:
2. Free-Threaded Python (3.13t/3.14t)
NimbusKV automatically detects free-threaded Python builds at runtime. On standard GIL Python, read operations run safely under the GIL; on free-threaded builds, concurrent reads execute with genuine parallel multi-core performance.
NimbusKV relies on MagicStack's immutables library for its HAMT persistent map. Because C-extensions can accidentally re-enable the GIL, you must set PYTHON_GIL=0 (or run Python with python -X gil=0) to prevent GIL re-enablement.
3. Upgrading to v3.1.0
NimbusKV v3.1.0 is an infrastructure-hardening release. Public API signatures remain backwards compatible with v3.0.x, but two critical behavioral improvements were introduced:
Prior versions (v3.0.0 through v3.0.1) used an optimistic CAS retry loop. Under hot keys with high thread counts, this caused retry storms and CPU churn. v3.1.0 replaces CAS with a single short write mutex, giving deterministic throughput.
Attempting to call write operations (set(), delete()) from inside an atomic() or mutate() callback now raises an immediate ReentrantWriteError rather than deadlocking.
4. Migrating from LiveDict
If you are upgrading an existing codebase from the legacy livedict package, the primary change is the package and class name:
NimbusKV supports both dictionary-style access (ld["key"] = val) and explicit method calls (ld.set(key, val, ttl=...)). For TTL expirations and reactive events, the explicit method syntax is recommended.