In-Memory Database

An in-memory database (IMDB) is a computer system that stores and retrieves data records that reside in a computer’s main memory, e.g., random-access memory (RAM). With data in RAM, IMDBs have a speed advantage over traditional disk-based databases that incur access delays since storage media like hard disk drives and solid-state drives (SSD) have significantly slower access times than RAM. This means that IMDBs are useful for when fast reads and writes of data are crucial.

In-Memory Database
An in-memory database (or in-memory data store) partitions its data into RAM.

It is worth noting that the notion of an IMDB does not imply the structure of the stored data. In other words, IMDBs can store relational (tabular) data, document data, key-value data, or even a combination.

How Does an In-Memory Database Work?

IMDBs work by keeping all data in RAM. That is the medium in which data is stored in RAM versus disks or SSDs. IMDBs essentially replace the disk-accessing component of disk-based databases with RAM accesses. In some IMDBs, a disk-based component remains intact, but RAM is the primary storage medium. Since RAM is volatile (e.g., data is lost if the computer loses power), some IMDBs also store data on disk as a preventative measure to minimize the risk of data loss.

Most IMDBs also guard against data loss in a single data center (a capability known as “high availability”) by keeping copies (“replicas”) of all data records in multiple computers in a cluster. This data redundancy ensures that any data record will not be lost upon failure of any given computer.

In-Memory Database Example Use Cases

An example use case would be a high traffic eCommerce site that needs to store shopping cart contents for hundreds of thousands of customers at any given time. Response times at that scale would be too slow for many disk-based databases, so IMDBs are used to keep up with the load and ensure a positive customer experience.

Another use case entails business intelligence (BI) analytics, in which data is retrieved and presented in a visual way (i.e., in dashboards). Many types of business users want to see data presented in multiple ways, as well as to drill down into greater data detail. To do so efficiently, they leverage an in-memory database that can quickly deliver data so users spend more time analyzing and making decisions, and less time waiting for the system to respond.

Alternatives to In-Memory Databases

The term IMDB is also used loosely to refer to any general-purpose technology that stores data in memory. For example, an in-memory data grid (IMDG), which is a distributed system that can store and process data in memory to build high-speed applications, has provisions for IMDB capabilities. Data structures in IMDGs known as “maps” (a construct that most Java developers are familiar with) are basically key-value stores that can be used as an IMDB. Hazelcast IMDG is an example IMDG that supports high-speed distributed maps so it can be used as an IMDB for fast lookups and writes of record-oriented data.

As another example, in-memory caching systems are used to speed up access to slow databases (especially disk-based), essentially emulating the performance of IMDBs. While these caches are not true IMDBs since they do not store data long term, they work in conjunction with disk-based databases as a (mostly) functional equivalent to IMDBs. The IMDBs temporarily store frequently-accessed data that reside in the underlying database to deliver that data faster to applications. Hazelcast IMDG is often used as a caching system for speeding up access to data that resides in disk-based databases.

Related Topics

In-Memory Data Grid

In-Memory Processing

Memory Caching

In-Memory Computation

Further Reading

IMDG vs. IMDB – A Business-Level Perspective

Transformational Drivers and In-Memory Data Grids

Step Away From The Database

Relevant Resources

White Paper

In-Memory Database vs In-Memory Data Grid

In-Memory Databases (IMDB) and In-Memory Data Grids (IMDG) are two technologies that address real-time computing and big data needs without having to start over with an entirely new set of IT systems. While they may sound similar, the differences are significant and understanding your options will help you make better decisions. Your business operates in an environment with constantly evolving technology. For business and IT leaders, it can be overwhelming to keep up with new developments and determine what is critical to implement immediately, and what technologies can or should wait. In-memory processing technologies are becoming pervasive and have a direct and indirect effect on how a business operates. Hazelcast has created this whitepaper to discusses these technologies and the respective implications.
Webinar
| Video
| 60 minutes

Introduction to In-Memory Data Grids

The speed at which today’s evolving data is exploding (90% of all data was collected in the last 2 years) imposes complex business problems that prevailing technology platforms can not address. This is preventing Enterprises from quickly extracting business value from this data. This poses further challenges as the value of data and the insights we can get from them decrease if it takes too long to take action. In this talk, we will learn how Hazelcast® addresses these problems and helps Enterprises overcome the challenges of extracting business value from massive scale data. You will be introduced to Distributed Systems and In-Memory Computing with Hazelcast. This talk will cover some familiar distributed data structures like Maps, Lists, Queues, etc., along with running complex business algorithms in parallel over a Hazelcast cluster by using Distributed Executor Service, EntryProcessors and In-Memory MapReduce.
View All Resources