# A Performance Evaluation of In-Memory Databases Operations in Session Initiation Protocol
## 3 SIP with NoSQL  
NoSQL (Not only SQL) is an umbrella to all database systems other than traditional SQL databases [20]. NoSQL databases store data models with a different structure than the traditional row and column table model out there in relational database management systems [21]. Unlike relational databases, key-value databases do not have a specified structure. Relational databases store their data in tables in which an individual column has a pre-assigned data type. However, NoSQL has four different categories of databases, which are key-value store, document-based, column-oriented, and graph databases. Each of these is designed for particular data types and requirements. According to SIP, key-value is the desired store structure to be used generally, enriched with a collection of keys and value pairs. On one hand, a key is a unique identifier for one or a set of values. On the other hand, values are real data that SIP retrieves from a database. Values can be any type of data--numbers, strings, or other complex data structures. For instance, URI has an identifier of the client as keys and their values can be example.ip.com, IPv4, and/or IPv6 [22]. Generally, the NoSQL database stores its data in different means of storage, disk or in-memory (RAM) storage. In-memory databases are purpose-built databases that utilize memory for data storage, unlike other databases which store data in disk (e.g., SSD) storage [23]. The main reason for SIP to use in-memory database storage is to operate with minimal response time during real-time communication--that is, to overcome the overhead of database operations (read/write) against the disk. Hitting a database during SIP communication is considered a high impact in terms of time. This is the primary fact that leads SIP servers to store the most necessary and frequent high-hit ratio data into cache [24]. The cache is a high-speed data storage layer which is the place where a subset of data is stored and is transient in nature. The aim of the cache is that, when the subsequence requests particular data, it will be provided faster than in the disk storage. Data reside in the cache storage for a period of time depending on the expiration time which can be assigned prior. Caching provides SIP servers with efficient data retrieval from the in-memory database. That, in turn, increases SIP performance with high-quality service for end users. Technically, the SIP server deals with variant names of key-value cache modules, and in this research, three different structures will be used, and they are as follows:  
* Local : it is a local cache database module used in the OpenSIPS server that resides in the server's shared memory. Because it is local, it performs very fast due to the low external communication. The local cache database requires no package installation, and it uses the same shared memory of OpenSIPS called shmem class. However, the main issue beyond the Local cache is persistency; it loses all cached data once the server encounters any failure or restarts. OpenSIPS accesses the Local cache by using a key-value interface called cached_local. For example, to fetch a password from the local cache stored at the integer, attribute 55 can use: cache_fetch(\"local\", \"passwd_$tu\", $svp(i:55))
* Memcached: is a well known in-memory key-value store system used relatively for light data storage and high-speed data retrieval. Memcached is considered one of the high-performance caching systems. The main advantage of the Memcached system is the ability to access data through multi-threaded connections. In other words, a single thread can be open for accepting a single connection to handle one client. Memcached copes with simple data structures, integers, and strings, Thus, to store other data types, pre-processed operations have to be performed to serialize to string or binary before storing. The good news of SIP is that it utilizes a simple data structure (integers and strings) in the database; thus, it requires no further data pre-processing in Memcached.