CACHEDB_CASSANDRA module
Admin Guide
Section titled “Admin Guide”Overview
Section titled “Overview”This module is an implementation of a cache system designed to work with Cassandra servers. It uses the Key-Value interface exported from the core.
Advantages
Section titled “Advantages”- memory costs are no longer on the server
- many servers can be used inside a cluster, so the memory is virtually unlimited
- the cache is 100% persistent. A restart of OpenSIPS server will not affect the DB. The Cassandra DB is also persistent so it can also be restarted without loss of information.
- Cassandra is an open-source project so it can be used to exchange data with various other applicationsr
- By creating a Cassandra Cluster, multiple OpenSIPS instances can easily share key-value information
Limitations
Section titled “Limitations”- keys (in key:value pairs) may not contain spaces or control characters
Dependencies
Section titled “Dependencies”OpenSIPS Modules
Section titled “OpenSIPS Modules”None.
External Libraries or Applications
Section titled “External Libraries or Applications”The following libraries or applications must be installed before running OpenSIPS with this module loaded:
- thrift 0.6.1 Thrift 0.6.1 can be downloaded from http://archive.apache.org/dist/thrift/ Download the archive, extract sources, run ./configure,make,sudo make install.
Exported Parameters
Section titled “Exported Parameters”cachedb_url (string)
Section titled “cachedb_url (string)”The urls of the server groups that OpenSIPS will connect to in order to use the from script cache_store,cache_fetch, etc operations. It can be set more than one time. The prefix part of the URL will be the identifier that will be used from the script.
The database part of the URL needs to be in the format Keyspace_ColumnFamily
...modparam("cachedb_cassandra", "cachedb_url","cassandra:group1://localhost:9061/Keyspace1_Users");modparam("cachedb_cassandra", "cachedb_url","cassandra:cluster1://random_url:8888/Keyspace2_Keys");......cache_store("cassandra:group1","key","$ru value");cache_fetch("cassandra:cluster1","key",$avp(10));cache_remove("cassandra:cluster1","key");...connection_timeout (int)
Section titled “connection_timeout (int)”The timeout in ms that will be triggered in case a connection attempt fails.
...modparam("cachedb_cassandra", "connection_timeout",1000);...send_timeout (int)
Section titled “send_timeout (int)”The timeout in ms that will be triggered in case a Cassandra write takes too long
...modparam("cachedb_cassandra", "send_timeout",1000);...receive_timeout (int)
Section titled “receive_timeout (int)”The timeout in ms that will be triggered in case a Cassandra read takes too long
...modparam("cachedb_cassandra", "receive_timeout",1000);...wr_consistency_level (int)
Section titled “wr_consistency_level (int)”The consistency level desired for write operations. Options are:
- 1 - Ensure that the write has been written to at least 1 replica’s commit log and memory table before responding to the client.
- 2 - Ensure that the write has been written to N / 2 + 1 replicas before responding to the client.
- 3 - Ensure that the write has been written to ReplicationFactor / 2 + 1 nodes, within the local datacenter (requires NetworkTopologyStrategy)
- 4 - Ensure that the write has been written to ReplicationFactor / 2 + 1 nodes in each datacenter (requires NetworkTopologyStrategy)
- 5 - Ensure that the write is written to all N replicas before responding to the client. Any unresponsive replicas will fail the operation.
- 6 - Ensure that the write has been written to at least 1 node, including HintedHandoff recipients.
- 7 - Ensure that the write has been written to at least 2 replica’s before responding to the client.
- 8 - Ensure that the write has been written to at least 3 replica’s before responding to the client.
Default is 1
...modparam("cachedb_cassandra", "wr_consistency_level",7);...rd_consistency_level (int)
Section titled “rd_consistency_level (int)”The consistency level desired for read operations. Options are the same as for write consistency level.
...modparam("cachedb_cassandra", "rd_consistency_level",7);...Exported Functions
Section titled “Exported Functions”The module does not export functions to be used in configuration script.
Known Issues
Section titled “Known Issues”Due to the fact that Cassandra cannot store counters and regular columns in the same ColumnFamily, add() and sub() methods are not exported through the Key-Value interface.
Also, the module does not currently support Authentication.
Future realeases of this module will address this issue.
Contributors
Section titled “Contributors”By Commit Statistics
Section titled “By Commit Statistics”Top contributors by DevScore(1), authored commits(2) and lines added/removed(3)
| # | Name | DevScore | Commits | Lines++ | Lines— |
|---|---|---|---|---|---|
| 1. | Vlad Paiu (@vladpaiu) | 183 | 4 | 21128 | 7 |
| 2. | Stefan Darius (@dariusstefan) | 7 | 4 | 226 | 26 |
| 3. | Razvan Crainea (@razvancrainea) | 4 | 2 | 8 | 8 |
| 4. | fabriziopicconi | 3 | 1 | 1 | 1 |
(1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits)
(2) including any documentation-related commits, excluding merge commits
(3) ignoring whitespace edits, renamed files and auto-generated files
By Commit Activity
Section titled “By Commit Activity”| # | Name | Commit Activity |
|---|---|---|
| 1. | Stefan Darius (@dariusstefan) | Jun 2026 - Jul 2026 |
| 2. | Razvan Crainea (@razvancrainea) | Feb 2012 - Jun 2026 |
| 3. | fabriziopicconi | Apr 2014 - Apr 2014 |
| 4. | Vlad Paiu (@vladpaiu) | Dec 2011 - Aug 2012 |
(1) including any documentation-related commits, excluding merge commits
Documentation
Section titled “Documentation”Contributors
Section titled “Contributors”Last edited by: Razvan Crainea (@razvancrainea), Vlad Paiu (@vladpaiu).
License
Section titled “License”All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0