Using JDG on JBoss EAP

Kylin Soong

Agenda

  • Background
  • Key Feature
  • Comparison Example

Background

  • Infinispan - the Community Version of JBoss Data Grid
  • Long History - The 2nd generation JBossCache, Start From first version of JBoss AS
  • Academic - Distribute Computing
  • Cache - in-memory, key/value
  • Data Store - NoSQL database, Grid-based datastorage

Key Feature

Two usage modes

  • Remote Client-Server mode
  • Library mode

JBoss Data Grid Cache Architecture

Cache Architecture

Library mode


CacheManager manager = new DefaultCacheManager("infinispan.xml", true);
Cache cache = manager.getCache(cacheName);
cache.put(key, value);
Object entity = cache.get(key);

Remote Client-Server mode


$ unzip jboss-datagrid-6.5.0-server.zip
$ cd jboss-datagrid-6.5.0-server
$ ./bin/standalone.sh

Key Feature

Cache Store and Loading

  • File
  • JDBC
  • Level DB
  • JPA
  • ...

Key Feature

Clustering Mode

  • Local
  • Replication
  • Distribution
  • Invalidation

Replication

Infinispan Replication

Distribution

Infinispan Distribution

Invalidation

Infinispan Invalidation

Examples


$ ./bin/dataGrid.sh -c infinispan-replication.xml
$ ./bin/dataGrid.sh -c infinispan-distribution.xml
$ ./bin/dataGrid.sh -c infinispan-invalidation.xml

Key Feature

Cross Data Center Replication and StateTransfer

  • Base on jGroups's Feature
  • Cluster Configuration Using TCP

Key Feature

JSR-107 Support

  • JCache

Dependencies


groupId: org.infinispan
artifactId: infinispan-jcache

Create a cache


import javax.cache.Cache;
import javax.cache.CacheManager;
import javax.cache.Caching;
import javax.cache.configuration.MutableConfiguration;

CacheManager manager = Caching.getCachingProvider().getCacheManager();
Cache cache = manager.configureCache("namedCache", new MutableConfiguration());

Key Feature

Client Interface

  • Rest
  • Memcached
  • HotRod Java
  • HotRod C++
  • HotRod .NET

Key Feature

Others

  • Eviction Strategy, Expiration
  • Write-behind, Write-through
  • Querying
  • Transation and Batching(Libary)
  • Spring Integration, CDI Integration(Libary), Camel Component
  • ...

Comparison Example

Agenda

  • Overview
  • Run
  • Conclusion

Comparison Example

Overview

Comparison Example

Comparison Example

Run

  • Prepare Data(100MB)
  • Run without cache(SELECT * FROM PERFTEST)
  • Run with cache(/*+ cache */ SELECT * FROM PERFTESTVIEW)
  • Source Code, Detailed doc(http://ksoong.org/teiid-rs-cache/)

Comparison Example

Conclusion

Comparison Example

References

Question & Answer