The GridGain In-Memory Database Supports ACID Transactions and ANSI-99 SQL

The GridGain® in-memory computing platform includes an in-memory database which supports data processing APIs including SQL, key-value, compute, machine learning and more. It can power modern, highly available, high performance applications on a solution which provides in-memory speeds and can be scaled out to hold petabytes of in-memory data.

The GridGain in-memory database can be used to power OLTP, OLAP or hybrid transactional/analytical processing (HTAP) use cases. GridGain distributes your dataset across a cluster of servers while the distributed SQL capabilities allows you to read and write to the database using standard database commands through the ODBC/JDBC interface. The system offers ACID transaction support and supports ANSI-99 SQL including DDL and DML.

The memory-centric GridGain architecture allows you to execute distributed SQL, key-value and other operations across different memory layers. If your organization deploys a variety of memory technologies such as DRAM, non-volatile memory, and 3D XPoint, you can tune the configuration of your system to use a combination of memory options which provides the best trade off between price and performance for your organization.

In-Memory Database
The GridGain in-memory database provides strong ACID transaction guarantees and ANSI-99 SQL compliance

The GridGain in-memory database delivers 1,000 times faster performance for applications than disk-based databases because your data is stored and processed in RAM with an in-memory database. GridGain is deployed on a distributed cluster of servers which provide massive database scalability to the GridGain in-memory database. GridGain can be easily scaled by adding nodes to the cluster, with the system rebalancing your data automatically.

You can learn more about the in-memory database capabilities in GridGain and how they fit within the in-memory computing platform architecture by reading our white paper titled Introducing the GridGain In-Memory Computing Platform. To learn more about the difference between an in-memory database and an in-memory data grid, please read our blog post "In-Memory Database vs In-Memory Data Grid Revisited".

In-Memory Database with a Memory-Centric Architecture

You can use the integrated Persistent Store feature to achieve the performance and scale of in-memory computing, the durability of disk, and strong consistency, all in one system. Persistent Store is a distributed ACID and ANSI-99 SQL-compliant disk store that can be deployed on spinning disks, solid state drives (SSDs), 3D XPoint, and other storage-class memory technologies. Persistent store keeps the full data set on disk, which is fully operational, while putting only a subset of user-defined, time-sensitive data in memory. Organizations can adjust the amount of data kept in-memory to achieve an optimal trade-off between infrastructure costs and application performance. And because the data on disk is fully operational, there is no need to wait for all the data to be loaded into RAM before beginning processing in the event of a cluster restart. Persistent Store also enables organizations to take advantage of HTAP without the need to keep all of their data in-memory.

Examples


Ignite ignite = Ignition.ignite();
// Get an instance of named cache.
final IgniteCache<integer, string=""> cache = ignite.jcache("cacheName");</integer,>
// Store keys in cache.
for (int i = 0; i &lt; 10; i++)
cache.put(i, Integer.toString(i));
// Retrieve values from cache.
for (int i = 0; i &lt; 10; i++)
System.out.println("Got [key=" + i + ", val=" + cache.get(i) + ']');
// Remove objects from cache.
for (int i = 0; i &lt; 10; i++)
cache.remove(i);
// Atomic put-if-absent.
cache.putIfAbsent(1, "1");
// Atomic replace.
cache.replace(1, "1", "2");

Ignite ignite = Ignition.ignite();
// Clone every object we get from cache, so we can freely update it.
IgniteCache<integer, account=""> cache = ignite.jcache("cacheName");</integer,>
try (IgniteTx tx = Ignition.ignite().transactions().txStart()) {
Account acct = cache.get(acctId);
assert acct != null;
// Deposit $20 into account.
acct.setBalance(acct.getBalance() + 20);
// Store updated account in cache.
cache.put(acctId, acct);
tx.commit();
}

Ignite ignite = Ignition.ignite();
// Get an instance of named cache.
final GridCache<string, integer=""> cache = ignite.jcache("cacheName");</string,>
// Lock cache key "Hello".
Lock lock = cache.lock("Hello");
lock.lock();
try {
cache.put("Hello", 11);
cache.put("World", 22);
}
finally {
lock.unlock();
}

Ignite ignite = Ignition.ignite();
// Get an instance of named cache.
GridCache<long, person=""> cache = ignite.jcache("cacheName");</long,>
// Create query which selects salaries based on range.
CacheQuery<map.entry<long, person="">&gt; qry =
cache.queries().createSqlQuery(Person.class, "salary &gt; ? and salary &lt;= ?");</map.entry<long,>
// Execute queries for salary ranges.
print("People with salaries between 0 and 1000: ", qry.execute(0, 1000).get());
print("People with salaries between 1000 and 2000: ", qry.execute(1000, 2000).get());
 

Ignite ignite = Ignition.ignite();
// Get an instance of named cache.
GridCache<long, person=""> cache = ignite.jcache("cacheName");</long,>
// Create query which joins on 2 types to select people for a specific organization.
CacheQuery<map.entry<long, person="">&gt; qry =
cache.queries().createSqlQuery(Person.class, "from Person, Organization " +
"where Person.orgId = Organization.id " +
"and Organization.name = ?");</map.entry<long,>
// Execute queries for find employees for different organizations.
print("Following people are 'Ignite' employees: ", qry.execute("Ignite").get());
print("Following people are 'Other' employees: ", qry.execute("Other").get());

Learn More