elcast.com/
cast.org/
o is this guy?
enior Solutions Architect for Hazelcast.
7 Years Java Development.
arted out as a Cobol Programmer in 1988.
earnt to code Basic on a Vic-20 and BBC Mo
racle Coherence and Pivotal Gemfire.
Memory Java
High Performance In Memory Java? It’s an
Getting to grips with Hazelcast, a tour of f
Some IMDG Tips!
Memory Java
It’s 2 things really, the 2 C.
Cache
Compute
The Magic is the D you stick in front…Distr
olution of IMDG
CACHE IN ONE PROCESS - A MAP, AGGHH OOM!
olution of IMDG
CACHE IN ONE PROCESS - WITH EVICTION
olution of IMDG
DISTRIBUTED CACHE
olution of IMDG
DISTRIBUTED CACHE
olution of IMDG
BIG DATA IMDG
ualities of an IMDG
It should be easy to scale, vertically and
horizontally.
It should be fault tolerant.
It should be performant.
It should have a easy to understand API.
ter Hazelcast!
ava Collections & Queues - Distributed!
ava Concurrency - Distributed!
ersist to and Read from from Anything!
DBMS,File,Hadoop,Cassandra,MongoDB)
edicate and SQL like queries!
opics(Pub/Sub)
ch Event Callbacks
dency>
roupId>com.hazelcast</groupId>
rtifactId>hazelcast</artifactId>
ersion>3.2.2</version>
ndency>
tarting a Hazelcast Cluster
astInstance hz = Hazelcast.newHazelcastInstance
tarting a Hazelcast Cluster
stributed Compute
Executors
EntryProcessor
MapReduce
ecutor can run anywhere
ExecutorService
Runnable or Callable
Targeted execution in the grid (keys,memb
astInstance hz = Hazelcast.newHazelcastInstance
torService executor = hz.getExecutorService(“my
or.execute(new EchoTask("foo"));
ava Executor, but Distribute
tryProcessor
Execute your code on an entry in an atomic
You do not need any explicit lock on entry.
Runs via IMap.
lies the user defined EntryProcessor to the ent
key.
urns the the object which is result of the proc
of EntryProcessor.
executeOnKey(K key, EntryProcessor entryProces
ryProcessor via IMap
apReduce
New in 3.2
Hadoop like API.
Aggregators in 3.3
Scheduled Tasks in 3.4
tring,String> map = hazelcastInstance.getMap("a
ueSource<String,String> source =
ueSource.fromMap(map);
ring, String> job = jobTracker.newJob( source )
etableFuture<Map<String, Long>> future = job
.mapper( new TokenizerMapper() )
.combiner( new WordCountCombinerFactory() )
.reducer( new WordCountReducerFactory() )
.submit();
pReduce
rsist and Read from anywhe
mplement a MapStore interface.
Configure your Map.
Cache misses will read through to the store
Cache updates can persist to store (sync/as
p name="aDistributedMap">
<map-store enabled="true">
<class-name>com.company.YourMapStore</cla
<write-delay-seconds>30</write-delay-seco
</map-store>
<indexes>
<index ordered="true">aValueProperty</ind
</indexes>
ap>
Configure (in XML,Spring or A
class UserMapStore implements MapStore<Integer
blic void store(Integer userKey, User user) {
userDao.insertUser(user);
blic User load(Integer userKey) {
return userDao.getUser(userKey);
ore methods like delete, loadAll)
mplement MapStore
e like standards.
Greg Luck, Hazelcast CTO is JSR107 co-spe
Hazelcast will be JSR107 compliant this sum
https://github.com/hazelcast/hazelcast/tr
jcache-preview
me IMDG Advice
Don’t force in your RDBMS schema.
Do you really need that transaction?
Execute near the data.
Use the right Serialisation interface.
Tune your JVM.
werful tool for many Use Ca
Unscalable NoSQL or RDBMS fix.
Compute Intensive Tasks
Web Session Replication
HA Services
WAN Replication
et Coding!
hazelcast.org - for open source and downlo
hazelcast.com - for pro support,papers & w
github.com/hazelcast for sources
github.com/hazelcast/hazelcast-code-samp
follow me on twitter @dbrimley
anks / Creative Commons
esentation Template — Guillaume LaForge
he Queen — A prestigious heritage with som
spiration from The Sex Pistols and funny D
rl with a Balloon — Banksy
ube — Michael Keen

Devoxx UK 2014 High Performance In-Memory Java with Open Source