In-Memory Data Grid
In-Memory Data Grid is the core technology behind GridGain’s capability to process large data sets with low latency in Real Time context. Easily scaling from a single computer to terabytes of data and thousands of nodes GridGain In-Memory Data Grid technology provides capability to parallelize the data storage by storing partitioned data in in-process memory – the closest location the data can theoretically reside in relation to the application using it.
Having data as close to application as theoretically possible is what makes GridGain’s In-Memory Compute Grid able to process large data sets stored in In-Memory Data Grid with low latency in Real Time.

In-Memory Data Grids allow to treat grids and clouds as a single virtualized memory bank that smartly partitions data among the participating computers and providing various caching and accessing strategies.
The goal of In-Memory Data Grids is to provide extremely high availability of data by keeping it in memory and in highly distributed (i.e. parallelized) fashion. GridGain In-Memory Data Grid subsystem is fully integrated into the core of GridGain and is built on top of the existing functionality such as pluggable auto-discovery, communication, and marshaling, peer-to-peer on demand class loading, and support for functional programming.
Among its key features are:
- Local, full replicable and partitioned cache types
- Pluggable expiration policies (LRU, LIRS, random, time-based)
- Named caches
- Read-through and write-through logic with pluggable cache store
- Synchronous and asynchronous cache operations
- Pluggable data overflow storage via new swap space SPI
- PESSIMISTIC, OPTIMISTIC and EVENTUALLY_CONSISTENT transactions
- READ_COMMITTED, REPEATABLE_READ, SERIALIZABLE isolation levels
- JTA/JCA integration
- Data replication and data invalidation in synchronous and asynchronous modes
- Partitioned cache with active replicas (backups)
- Advanced distributed query capability including:
- SQL-based affinity co-located queries
- Lucene-based text affinity co-located queries
- H2-based text affinity co-located queries
- Predicate-based full-scan affinity co-located queries
- Support for pagination
- Local and remote filtering
- Local and remote transformation
- Local and remote reduction
- Full integration for compute grid for dynamic affinity routing
- OOP and FP-based APIs for Java, Scala and Groovy
Zero Deployment
GridGain is the first platform which In-Memory Data Grid features zero-deployment capability enabling users to simply bring up default GridGain nodes online and they immediately become part of the data grid topology and can store any user objects without any need for explicit deployment of user’s classes.
Example
This is a full source of example that is putting 20 values into distributed partitioned cache (spread over any number of available nodes) and then executes 20 distributed closures that get properly co-located with the data in in-memory data grid.
In Java:
public class Demo {
private static final int keyCnt = 20;
private static Grid g;
public static void main(String[] args) throws Exception {
g = G.start("examples/config/spring-cache.xml");
try {
GridCache cache =
g.cache("partitioned");
populate(cache);
visit(cache);
}
finally {
G.stop(true);
}
}
private static void visit(final GridCache c)
throws GridException {
for (int i = 0; i < keyCnt; i++) {
final int key = i;
g.run(GridClosureCallMode.BALANCE,
new CA() {
@GridCacheName
private String cacheName = "partitioned";
@GridCacheAffinityMapped
public int affinityKey() {
return key;
}
@Override public void apply() {
System.out.println("Co-located [key= " + key +
", value=" + c.peek(key) + ']');
}
});
}
}
private static void populate(GridCache c)
throws GridException {
for (int i = 0; i < keyCnt; i++)
c.put(i, Integer.toString(i));
}
}
In Scala:
object Demo {
val range = 0 to 20 by 1
lazy val c = cache$[Int, Int]("partitioned").get
def main (args: Array[String]): Unit =
scalar("examples/config/spring-cache.xml") {
populate
visit
}
def populate = range foreach {
i => c.put(i, i)
}
def visit = grid$ run$ (
BALANCE,
range map (
i => new CA {
@GridCacheName
def cacheName = "partitioned"
@GridCacheAffinityMapped
def affKey = i
def apply = println("Co-located [key=" + i +
", value=" + c.peek(i) + ']')
}.scala
)
)
}
