使用GridGain比基于磁盘的数据库有上千倍的性能提升

GridGain®内存计算平台包含一个内存数据网格,通过消除访问基于磁盘的数据所固有的延迟,可将在基于磁盘的数据库上构建的应用的性能提高上千倍。GridGain可以嵌入应用和数据层之间,在内存中创建基于磁盘的RDBMS、NoSQL或Hadoop的数据库的数据副本。除了高性能的GridGain内存数据网格,GridGain内存计算平台还包括强大的功能,如内存数据库流式分析以及机器和深度学习的持续学习框架

GridGain内存数据网格可以水平扩展,支持实时添加节点。它可以线性扩展到上千个节点,具有强大的语义,通过数据定位和类同数据路由,以减少冗余数据噪声。

GridGain内存数据网格支持本地、复制和分区数据集。可以使用标准SQL语法在这些数据集之间自由关联查询。它支持用于查询内存数据的标准SQL,包括对分布式SQL关联的支持。GridGain内存计算平台提供了极为丰富的数据网格功能,包括堆外内存支持、负载平衡、容错、远程连接、支持完整的ACID事务和高级安全性。

GridGain内存数据网格

In Memory Data Grid

分布式键值存储,部署在应用和数据层之间,可以无缝读取和写入底层数据库

GridGain内存数据网格功能:
  • 分布式内存缓存
  • 高性能
  • 弹性可伸缩性
  • 分布式内存中事务
  • 分布式内存中队列和其他数据结构
  • Web会话集群化
  • Hibernate L2缓存集成
  • 分层堆外存储
  • 支持分布式关联的分布式SQL查询

示例


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());

进一步了解