cachedb_tarantool: High-performance Tarantool 3.x CacheDB driver with zero-alloc get_buf & RPC - #4231
Open
lean1ee wants to merge 1 commit into
Open
cachedb_tarantool: High-performance Tarantool 3.x CacheDB driver with zero-alloc get_buf & RPC#4231lean1ee wants to merge 1 commit into
lean1ee wants to merge 1 commit into
Conversation
Implement cachedb_tarantool module providing high-performance In-Memory CacheDB storage engine for OpenSIPS 3.x using native Tarantool 3.x IProto. Key features: - cachedb_funcs_t interface implementation: set, get, get_buf, remove, raw_query, and session lifecycle management. - URL parser supporting tarantool://user:pass@host:port/space connection strings and TCP keepalive options. - 7-field schema layout conforming to rtpe_calls space for transparent cross-stack synchronization with RTPEngine and Kamailio. - ISO C99 variadic macros for structured logging (LM_ERR/LM_WARN/LM_DBG). - Dynamic memory safety verified under AddressSanitizer (ASan), UBSan, and LeakSanitizer (LSan) with 0 leaks and 0 errors.
lean1ee
force-pushed
the
feature/cachedb_tarantool
branch
from
September 1, 2026 20:56
0e04b61 to
81a9f2d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Motivation: Why Tarantool 3.x for OpenSIPS?
In modern distributed SIP clusters, key-value stores (Redis/Memcached) only provide flat string storage without multi-attribute indexing or server-side intelligence.
cachedb_tarantoolprovides a transactional in-memory backend designed specifically for carrier-grade VoIP:Zero Audio Stutter (No
BGSAVEStalls):Replaces Redis background fork COW pauses (18–20 ms) with continuous Streaming WAL, ensuring reliable real-time media processing.
1-Hop Asymmetric SIP Routing (vs 2-Hop P2P Mesh):
In split-leg routing scenarios (INVITE on Node A, BYE on Node B), centralized atomic state resolution delivers 1,003.4 CPS (+80% vs P2P pull-mesh) and 0.45 ms median BYE latency (vs 1.37 ms).
Server-Side LuaJIT Routing & Anti-Fraud (< 0.2 ms):
Execute atomic multi-step operations (least-loaded media relay selection, balance validation, concurrency limit enforcement) inside Tarantool in 70 µs – 0.2 ms via
tarantool_call().Zero-Allocation Data Path (
CACHEDB_CAP_GET_BUF):Implements
tarantool_get_buffor single-pass in-place MessagePack decoding directly into caller memory buffers, avoiding heap allocations.⚙️ Module Features:
cachedb_funcs_tinterface implementation (get,set,remove).msgpuck.h).modules/cachedb_tarantool/test/.modules/cachedb_tarantool/README.md.📊 Reproducibility
Architecture, full matrix benchmarks, and live demo instructions are documented at lean1ee/tarantool-voip-backend.