An in-memory database is a modern data management system that stores data in the system’s main memory (most often RAM), as opposed to a traditional database that uses disk/device storage. When you process data in an in-memory database, only the RAM is used/accessed. There is no need to access the secondary memory and navigate the entire stack every time you want to read or write records. Instead, you quickly access the data directly in-memory.
Why does this matter? Because, in today’s high-speed 5G environments, latency matters.
Latency is the lag between a user’s action and an application’s response to that action. Disk latency is measured in milliseconds but RAM latency is in nanoseconds—a 1,000,000x boost in performance.
Plus, data in an in-memory database is always ready and available for use, whereas traditional in-disk databases use compressed or encrypted data that isn’t directly usable. In-memory databases are also structured to allow efficient navigation using direct pointers. This allows you to easily go from index to row, column to column, or row to row, without slowing down or missing a step.
How an in-memory database works
In-memory databases are also called “main-memory” databases for one obvious reason: the data (and instructions required for handling it) are located in the main memory. Unlike an in-disk memory, there’s no need to perform disk I/O to access and process data. This reduces seek-time and eliminates unnecessary round-trips through the tech stack.
An in-memory database has advanced in-memory data structures optimized for working with memory. Direct pointers are used to manage interrelationships between different parts of the database. Algorithms are simpler and transactions require fewer copy operations and CPU instructions. The data is used as-is, without any translating or caching required. Sharing data between applications and tasks is also simple and quick because the data is stored in one place and accessed through a single process with multiple threads.
An in-memory database generally supports ACID transactions:
- Atomic: all changes to the data must be performed successfully or not at all
- Consistent: data must be in a consistent state before and after the transaction
- Isolated: no other process can change the data while the transaction is running
- Durable: the changes made by the transaction must persist and will remain until another transaction happens
The catch is with durability. Since in-memory databases store all the data in volatile memory, a power outage or RAM crash can cause data loss. This makes data updates non-durable. The easiest way to mitigate this problem is to use a non-volatile RAM such as a flash drive. Alternatively, you can persist data to a disk (SSD works, as does HDD) at specified intervals. Another possible work-around is to maintain a commit log and use it to recreate the database.
Modern, built-for-5G in-memory databases use cross data center replication techniques to protect against data loss in a data center. Keeping replicas of all data records in multiple computers in a cluster builds data redundancy and ensures that data records aren’t lost.
Another noteworthy point about in-memory databases is that it’s essential that all the data sits in the main memory. So you may have to choose between working with small datasets or investing in more memory resources. The good news is that in-memory databases’ specialized data structure and algorithms make them easy to scale out.
SQL databases were typically designed as standard relational database management systems (RDBMS), while most NoSQL and NewSQL databases can be considered in-memory databases.
Advantages of an in-memory database
The most important differentiator of an in-memory database is speed. With speed as a foundation, there are many advantages to using in-memory databases:
- Predictable low-latency: because the data is always in-memory and doesn’t require disk I/O, you can scale without losing latency—millionth row, first row, or billionth row, it doesn’t matter.
- Real-time value: extreme low latency allows enterprises to make intelligent decisions on data in less than 200 milliseconds—before it loses its value. This can measurably unlock hidden revenue and prevent revenue leakage.
- High availability: an in-memory database simplifies availability and redundancy, which eliminates downtime and the resulting revenue loss.
- Instantaneous ACID adherence: immediate transactional consistency allows applications to make accurate decisions involving shared, finite resources at massive scale, which is especially useful in 5G environments.
In-memory database vs. a data platform
Where a database is used only for storing and processing data, a data platform manages the full data lifecycle, from ingestion to action, and uses machine learning to apply recent and near real-time historical analysis to learn from all the data coming in and use every bit of data to determine if an event is anomalous or not and thus worth taking action on.
A database is a vital part of any data platform, and a data platform equipped with an in-memory database is a powerful tool for unlocking the value of data in real time, especially in the age of 5G and IoT.
When is an in-memory database a good choice?
In-memory databases are ideal for environments that demand real-time responses even as they handle voluminous traffic and unplanned usage spikes. This makes them a very good choice for industries such as telecommunications, banking, gaming, mobile advertising, and over-the-top media.
In-memory database use cases:
- Detecting data anomalies as they happen and block fraudulent traffic before it overwhelms the network, thus stopping DDoS attacks in their tracks.
- Enabling in-event data analysis to supply enterprise customer service teams with real-time data to upsell customers during calls.
- Keeping track of running balance for prepaid phone card users is simplified with in-memory databases.
- Leveraging real-time data to publish in-game leaderboards for gaming industry companies..
- Analyzing crowd-sourced data in real time for intelligently routing on-road traffic for fleet services.
VoltDB – a NewSQL data platform with an in-memory database
VoltDB is a built-for-5G fast data platform for enterprises who intend to capture the emerging business growth opportunities presented by 5G, Industrial IoT, and more. We accelerate business insights from data that let you make real-time decisions, before the data loses its value.
By combining in-memory data storage with predictable low-latency and other key capabilities, we can power BSS/OSS, customer management, mediation, IIoT, and revenue assurance applications that need to act in single-digit milliseconds to drive revenue or prevent revenue loss, without compromising on data accuracy.