SlideShare a Scribd company logo
1 of 30
Download to read offline
HAZELCAST
OU
LE CLUSTERING FACILE !

BBL – février 2014
A propos…
! 

Sylvain Wallez
Architecte et dev expert freelance
Web/Java/Scala
!  2014 - Fondateur de Actoboard
!  2011 - Backend architect de Sigfox
!  2008 - CTO de Goojet/Scoop.it
!  2006 - Backend architect Joost
!  2003 - Premier VP Apache français
!  2000 - Cofondateur & CTO Anyware Technologies
sylvain@bluxte.net
http://bluxte.net
Twitter: @bluxte
! 
Mise en bouche
Une appli distribuée en 5 lignes !
Mise en bouche
! 

La Map classique
public static void main(String[] args) {	
	
	
Map<String, String> map = new HashMap<>();	
	
map.put("hello", "world");	
String value = map.get("hello");	
	
	
}
Mise en bouche
! 

La ConcurrentMap
public static void main(String[] args) {	
	
	
ConcurrentMap<String, String> map = new ConcurrentHashMap<>();	
	
map.put("hello", "world");	
String value = map.get("hello");	
	
String previous = map.putIfAbsent("goodbye", "marylou");	
}
Mise en bouche
! 

La ConcurrentMap distribuée
public static void main(String[] args) {	
HazelcastInstance hz = Hazelcast.newHazelcastInstance();	
	
ConcurrentMap<String, String> map = hz.getMap("mymap");	
	
map.put("hello", "world");	
String value = map.get("hello");	
	
String previous = map.putIfAbsent("goodbye", "marylou");	
}
Mise en bouche

Démo
Hazelcast features
Mais que vient-on de voir ?
Buzzword bingo !
In-memory data grid
!  Open source, Apache Licence
!  P2P elastic cache
!  Distributed event bus
!  NoSQL datastore
!  Cluster coordination
!  Distributed computing
! 
La concurrence
Oracle Coherence
!  IBM Extreme Scale
!  VMware Gemfire
!  Gigaspaces
!  JBoss Infinispan
!  Gridgain
!  Terracotta
! 
In-memory data grid
! 

La Map classique, plus des bonus
	
	
	

Asynchrone

	
	
	

HazelcastInstance hz = Hazelcast.newHazelcastInstance();	
IMap<String, String> map = hz.getMap("mymap");	
map.put("hello", "world");	
String value = map.get("hello");	
Future<String> future = map.getAsync("hello");	

Expiration

map.put("goodbye", "marylou", 10, TimeUnit.MINUTES);	
Set<Entry<String, String>> set = map.entrySet(new Predicate<String, String>() {	
public boolean apply(Entry<String, String> entry) {	
return entry.getKey().contains("z");	
}	
});	

Filtrage « in grid »
P2P elastic cache
! 

Partitionnement et réplication automatiques
P2P elastic cache
! 

Ajout dynamique de nouveaux noeuds

New!

Multicast
P2P elastic cache
! 

Redistribution des données
P2P elastic cache
! 

Redistribution des données
P2P elastic cache
! 

Redistribution des données
P2P event bus
! 

Les topics : broadcast à tous les listeners
	
	
	

ITopic<String> topic = hz.getTopic("alerts");	
topic.addMessageListener(new MessageListener<String>() {	
public void onMessage(Message<String> message) {	

	

}	

	

println("Received " + message.getMessageObject() +	
" from " + message.getPublishingMember());	

});	

Nœud d’origine
du message
P2P event bus
! 

Les queues
	

	

	
BlockingQueue<String> queue = hz.getQueue("jobs");	
	
queue.offer("Make me a sandwich");	
	

	
BlockingQueue<String> queue = hz.getQueue("jobs");

	

while(true) {	
String job = queue.take();	
println("Now working on " + job);	
}	

(Aussi en asynchrone avec poll() et les listeners)
NoSQL datastore
! 

Stockage persistant
NoSQL datastore
! 

La Map « interrogeable »

Indexation des
propriétés

	
	
	

IMap<Long, Employee> map = hz.getMap("employee");	
map.addIndex("active", true);	
map.addIndex("age", true);	
Collection<Employee> employees =	
map.values(new SqlPredicate("active AND age < 30"));	

Sous ensemble de SQL sur
les propriétés JavaBean
Cluster coordination
! 

Compteurs distribués
	
	
	

	

IAtomicLong reqCount = hz.getAtomicLong("users");	
// Start request	
long count = reqCount.incrementAndGet();	
try {	
// Do some stuff	
println("There are " + count + " request in progress");	
} finally {	
// End request	
reqCount.decrementAndGet();	
}
Cluster coordination
! 

Locks distribués (à utiliser avec parcimonie)
	

	
	

Lock lock = hz.getLock("maintenance_mode");	
lock.lock();	
try {	
// There can be only one in the cluster	
} finally {	
lock.unlock();	
}	

ILock lock = hz.getLock("maintenance_mode");	
lock.lock(10, TimeUnit.SECONDS);	
try {	
// There can be only one in the cluster	
} finally {	
lock.unlock();	
}	

Protection :
durée limitée
Distributed computing
! 

Un ExecutorService distribué
	

ExecutorService executor = hz.getExecutorService("compute");	
	
Runnable job = null;	
Callable<String> jobWithResult = null;	
	
executor.execute(job);	
Future<String> future = executor.submit(jobWithResult);
Distributed computing
! 

Un ExecutorService distribué
!  Fonctions

Data
locality

avancées de IExecutorService

IExecutorService executor = hz.getExecutorService("compute");	
	
Runnable job = null;	
Callable<String> jobWithResult = null;	
Choix explicite
	
du noeud
executor.executeOnKeyOwner(job, 42);	
	
Member member = hz.getPartitionService().getPartition(42).getOwner();	
println("Submitting to IP address " + member.getInetSocketAddress());	
	
executor.submitToMember(jobWithResult, member, new ExecutionCallback<String>() {	
public void onResponse(String response) {	
println("Result is " + response);	
}	
	
Callback
public void onFailure(Throwable t) {	
println("Job failed");	
asynchrone
}	
});	
	
	
}
Administration
Administration
JMX
!  API de statistiques sur Cluster et Member
!  Webapp Management Center
! 
Management Center
Management Center
Management Center
Merci !

Questions ?
Réponses !

More Related Content

What's hot

Gevent what's the point
Gevent what's the pointGevent what's the point
Gevent what's the pointseanmcq
 
iPhone and Rails integration
iPhone and Rails integrationiPhone and Rails integration
iPhone and Rails integrationPaul Ardeleanu
 
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonByterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonakaptur
 
Meetup Javascript for beginner
Meetup Javascript for beginner Meetup Javascript for beginner
Meetup Javascript for beginner AndryRajohnson
 
Internal Project: Under the Hood
Internal Project: Under the HoodInternal Project: Under the Hood
Internal Project: Under the HoodVladik Khononov
 
The Ring programming language version 1.6 book - Part 70 of 189
The Ring programming language version 1.6 book - Part 70 of 189The Ring programming language version 1.6 book - Part 70 of 189
The Ring programming language version 1.6 book - Part 70 of 189Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 80 of 212
The Ring programming language version 1.10 book - Part 80 of 212The Ring programming language version 1.10 book - Part 80 of 212
The Ring programming language version 1.10 book - Part 80 of 212Mahmoud Samir Fayed
 
Playing With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.jsPlaying With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.jsMike Hagedorn
 
Python for Scientists
Python for ScientistsPython for Scientists
Python for ScientistsAndreas Dewes
 
Parallel Computing in R
Parallel Computing in RParallel Computing in R
Parallel Computing in Rmickey24
 
Goの時刻に関するテスト
Goの時刻に関するテストGoの時刻に関するテスト
Goの時刻に関するテストKentaro Kawano
 
Debugging JavaScript with Chrome
Debugging JavaScript with ChromeDebugging JavaScript with Chrome
Debugging JavaScript with ChromeIgor Zalutsky
 
The Ring programming language version 1.5.1 book - Part 64 of 180
The Ring programming language version 1.5.1 book - Part 64 of 180The Ring programming language version 1.5.1 book - Part 64 of 180
The Ring programming language version 1.5.1 book - Part 64 of 180Mahmoud Samir Fayed
 
Distributed Data Structures
Distributed Data StructuresDistributed Data Structures
Distributed Data StructuresPDX Web & Design
 
PyParis2017 / Function-as-a-service - a pythonic perspective on severless com...
PyParis2017 / Function-as-a-service - a pythonic perspective on severless com...PyParis2017 / Function-as-a-service - a pythonic perspective on severless com...
PyParis2017 / Function-as-a-service - a pythonic perspective on severless com...Pôle Systematic Paris-Region
 
Useful javascript
Useful javascriptUseful javascript
Useful javascriptLei Kang
 
Joblib for cloud computing
Joblib for cloud computingJoblib for cloud computing
Joblib for cloud computingAlexandre Abadie
 
Influx/Days 2017 San Francisco | Paul Dix
Influx/Days 2017 San Francisco | Paul DixInflux/Days 2017 San Francisco | Paul Dix
Influx/Days 2017 San Francisco | Paul DixInfluxData
 
Python in the database
Python in the databasePython in the database
Python in the databasepybcn
 

What's hot (20)

Gevent what's the point
Gevent what's the pointGevent what's the point
Gevent what's the point
 
iPhone and Rails integration
iPhone and Rails integrationiPhone and Rails integration
iPhone and Rails integration
 
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonByterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
 
Meetup Javascript for beginner
Meetup Javascript for beginner Meetup Javascript for beginner
Meetup Javascript for beginner
 
Internal Project: Under the Hood
Internal Project: Under the HoodInternal Project: Under the Hood
Internal Project: Under the Hood
 
The Ring programming language version 1.6 book - Part 70 of 189
The Ring programming language version 1.6 book - Part 70 of 189The Ring programming language version 1.6 book - Part 70 of 189
The Ring programming language version 1.6 book - Part 70 of 189
 
The Ring programming language version 1.10 book - Part 80 of 212
The Ring programming language version 1.10 book - Part 80 of 212The Ring programming language version 1.10 book - Part 80 of 212
The Ring programming language version 1.10 book - Part 80 of 212
 
Playing With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.jsPlaying With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.js
 
Python for Scientists
Python for ScientistsPython for Scientists
Python for Scientists
 
Parallel Computing in R
Parallel Computing in RParallel Computing in R
Parallel Computing in R
 
Goの時刻に関するテスト
Goの時刻に関するテストGoの時刻に関するテスト
Goの時刻に関するテスト
 
Event loop
Event loopEvent loop
Event loop
 
Debugging JavaScript with Chrome
Debugging JavaScript with ChromeDebugging JavaScript with Chrome
Debugging JavaScript with Chrome
 
The Ring programming language version 1.5.1 book - Part 64 of 180
The Ring programming language version 1.5.1 book - Part 64 of 180The Ring programming language version 1.5.1 book - Part 64 of 180
The Ring programming language version 1.5.1 book - Part 64 of 180
 
Distributed Data Structures
Distributed Data StructuresDistributed Data Structures
Distributed Data Structures
 
PyParis2017 / Function-as-a-service - a pythonic perspective on severless com...
PyParis2017 / Function-as-a-service - a pythonic perspective on severless com...PyParis2017 / Function-as-a-service - a pythonic perspective on severless com...
PyParis2017 / Function-as-a-service - a pythonic perspective on severless com...
 
Useful javascript
Useful javascriptUseful javascript
Useful javascript
 
Joblib for cloud computing
Joblib for cloud computingJoblib for cloud computing
Joblib for cloud computing
 
Influx/Days 2017 San Francisco | Paul Dix
Influx/Days 2017 San Francisco | Paul DixInflux/Days 2017 San Francisco | Paul Dix
Influx/Days 2017 San Francisco | Paul Dix
 
Python in the database
Python in the databasePython in the database
Python in the database
 

Viewers also liked

Fontys eric van tol
Fontys eric van tolFontys eric van tol
Fontys eric van tolBigDataExpo
 
Stephenson big data utrecht 2017
Stephenson   big data utrecht 2017Stephenson   big data utrecht 2017
Stephenson big data utrecht 2017BigDataExpo
 
E learning: kansen en risico's
E learning: kansen en risico'sE learning: kansen en risico's
E learning: kansen en risico'sJurgen Gaeremyn
 
Red Hat Storage Server Roadmap & Integration With Open Stack
Red Hat Storage Server Roadmap & Integration With Open StackRed Hat Storage Server Roadmap & Integration With Open Stack
Red Hat Storage Server Roadmap & Integration With Open StackRed_Hat_Storage
 
Revue de presse Telecom Valley - Juin 2016
Revue de presse Telecom Valley - Juin 2016Revue de presse Telecom Valley - Juin 2016
Revue de presse Telecom Valley - Juin 2016TelecomValley
 
Drive faster & better software delivery with performance monitoring & DevOps
Drive faster & better software delivery with performance monitoring & DevOpsDrive faster & better software delivery with performance monitoring & DevOps
Drive faster & better software delivery with performance monitoring & DevOpsVolker Linz
 
Oracle OpenWorld - A quick take on all 22 press releases of Day #1 - #3
Oracle OpenWorld - A quick take on all 22 press releases of Day #1 - #3Oracle OpenWorld - A quick take on all 22 press releases of Day #1 - #3
Oracle OpenWorld - A quick take on all 22 press releases of Day #1 - #3Holger Mueller
 
(BDT306) Mission-Critical Stream Processing with Amazon EMR and Amazon Kinesi...
(BDT306) Mission-Critical Stream Processing with Amazon EMR and Amazon Kinesi...(BDT306) Mission-Critical Stream Processing with Amazon EMR and Amazon Kinesi...
(BDT306) Mission-Critical Stream Processing with Amazon EMR and Amazon Kinesi...Amazon Web Services
 
First day of school for sixth grade
First day of school for sixth gradeFirst day of school for sixth grade
First day of school for sixth gradeEmily Kissner
 
Developers Summit 2012 16-E-1
Developers Summit 2012 16-E-1Developers Summit 2012 16-E-1
Developers Summit 2012 16-E-1Kohei Kumazawa
 
Big data for cio 2015
Big data for cio 2015Big data for cio 2015
Big data for cio 2015Zohar Elkayam
 
Science ABC Book
Science ABC BookScience ABC Book
Science ABC Booktjelk1
 
D5 crazy speed web development
D5 crazy speed web developmentD5 crazy speed web development
D5 crazy speed web developmentNAVER D2
 
1st step LogicFlow
1st step LogicFlow1st step LogicFlow
1st step LogicFlowTomoyuki Obi
 
Vasilis Bankov & Calin Iliescu AEGON
Vasilis Bankov & Calin Iliescu AEGONVasilis Bankov & Calin Iliescu AEGON
Vasilis Bankov & Calin Iliescu AEGONBigDataExpo
 

Viewers also liked (20)

Fontys eric van tol
Fontys eric van tolFontys eric van tol
Fontys eric van tol
 
Stephenson big data utrecht 2017
Stephenson   big data utrecht 2017Stephenson   big data utrecht 2017
Stephenson big data utrecht 2017
 
E learning: kansen en risico's
E learning: kansen en risico'sE learning: kansen en risico's
E learning: kansen en risico's
 
GDPR. Et alors?
GDPR. Et alors?GDPR. Et alors?
GDPR. Et alors?
 
Red Hat Storage Server Roadmap & Integration With Open Stack
Red Hat Storage Server Roadmap & Integration With Open StackRed Hat Storage Server Roadmap & Integration With Open Stack
Red Hat Storage Server Roadmap & Integration With Open Stack
 
Revue de presse Telecom Valley - Juin 2016
Revue de presse Telecom Valley - Juin 2016Revue de presse Telecom Valley - Juin 2016
Revue de presse Telecom Valley - Juin 2016
 
Waarom ontwikkelt elk kind zich anders - prof. dr. Frank Verhulst
Waarom ontwikkelt elk kind zich anders - prof. dr. Frank VerhulstWaarom ontwikkelt elk kind zich anders - prof. dr. Frank Verhulst
Waarom ontwikkelt elk kind zich anders - prof. dr. Frank Verhulst
 
Introduction to QC
Introduction to QCIntroduction to QC
Introduction to QC
 
Drive faster & better software delivery with performance monitoring & DevOps
Drive faster & better software delivery with performance monitoring & DevOpsDrive faster & better software delivery with performance monitoring & DevOps
Drive faster & better software delivery with performance monitoring & DevOps
 
Oracle OpenWorld - A quick take on all 22 press releases of Day #1 - #3
Oracle OpenWorld - A quick take on all 22 press releases of Day #1 - #3Oracle OpenWorld - A quick take on all 22 press releases of Day #1 - #3
Oracle OpenWorld - A quick take on all 22 press releases of Day #1 - #3
 
(BDT306) Mission-Critical Stream Processing with Amazon EMR and Amazon Kinesi...
(BDT306) Mission-Critical Stream Processing with Amazon EMR and Amazon Kinesi...(BDT306) Mission-Critical Stream Processing with Amazon EMR and Amazon Kinesi...
(BDT306) Mission-Critical Stream Processing with Amazon EMR and Amazon Kinesi...
 
First day of school for sixth grade
First day of school for sixth gradeFirst day of school for sixth grade
First day of school for sixth grade
 
Developers Summit 2012 16-E-1
Developers Summit 2012 16-E-1Developers Summit 2012 16-E-1
Developers Summit 2012 16-E-1
 
Big data for cio 2015
Big data for cio 2015Big data for cio 2015
Big data for cio 2015
 
Science ABC Book
Science ABC BookScience ABC Book
Science ABC Book
 
D5 crazy speed web development
D5 crazy speed web developmentD5 crazy speed web development
D5 crazy speed web development
 
Andreas weigend
Andreas weigendAndreas weigend
Andreas weigend
 
1st step LogicFlow
1st step LogicFlow1st step LogicFlow
1st step LogicFlow
 
Rb wilmer peres
Rb wilmer peresRb wilmer peres
Rb wilmer peres
 
Vasilis Bankov & Calin Iliescu AEGON
Vasilis Bankov & Calin Iliescu AEGONVasilis Bankov & Calin Iliescu AEGON
Vasilis Bankov & Calin Iliescu AEGON
 

Similar to Brown Bag Lunch sur Hazelcast

CouchDB on Android
CouchDB on AndroidCouchDB on Android
CouchDB on AndroidSven Haiges
 
Real time and reliable processing with Apache Storm
Real time and reliable processing with Apache StormReal time and reliable processing with Apache Storm
Real time and reliable processing with Apache StormAndrea Iacono
 
InterConnect: Server Side Swift for Java Developers
InterConnect:  Server Side Swift for Java DevelopersInterConnect:  Server Side Swift for Java Developers
InterConnect: Server Side Swift for Java DevelopersChris Bailey
 
Hazelcast
HazelcastHazelcast
Hazelcastoztalip
 
Open XKE - Big Data, Big Mess par Bertrand Dechoux
Open XKE - Big Data, Big Mess par Bertrand DechouxOpen XKE - Big Data, Big Mess par Bertrand Dechoux
Open XKE - Big Data, Big Mess par Bertrand DechouxPublicis Sapient Engineering
 
От Java Threads к лямбдам, Андрей Родионов
От Java Threads к лямбдам, Андрей РодионовОт Java Threads к лямбдам, Андрей Родионов
От Java Threads к лямбдам, Андрей РодионовYandex
 
OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?
OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?
OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?Henri Tremblay
 
Paris js extensions
Paris js extensionsParis js extensions
Paris js extensionserwanl
 
Reactive programming on Android
Reactive programming on AndroidReactive programming on Android
Reactive programming on AndroidTomáš Kypta
 
mobl - model-driven engineering lecture
mobl - model-driven engineering lecturemobl - model-driven engineering lecture
mobl - model-driven engineering lecturezefhemel
 
Java 8 Puzzlers [as presented at OSCON 2016]
Java 8 Puzzlers [as presented at  OSCON 2016]Java 8 Puzzlers [as presented at  OSCON 2016]
Java 8 Puzzlers [as presented at OSCON 2016]Baruch Sadogursky
 
Getting the most out of Java [Nordic Coding-2010]
Getting the most out of Java [Nordic Coding-2010]Getting the most out of Java [Nordic Coding-2010]
Getting the most out of Java [Nordic Coding-2010]Sven Efftinge
 
Non Blocking I/O for Everyone with RxJava
Non Blocking I/O for Everyone with RxJavaNon Blocking I/O for Everyone with RxJava
Non Blocking I/O for Everyone with RxJavaFrank Lyaruu
 
Presto anatomy
Presto anatomyPresto anatomy
Presto anatomyDongmin Yu
 
От Java Threads к лямбдам, Андрей Родионов
От Java Threads к лямбдам, Андрей РодионовОт Java Threads к лямбдам, Андрей Родионов
От Java Threads к лямбдам, Андрей РодионовYandex
 
Bringing order to the chaos! - Paulo Lopes - Codemotion Amsterdam 2018
Bringing order to the chaos! - Paulo Lopes - Codemotion Amsterdam 2018Bringing order to the chaos! - Paulo Lopes - Codemotion Amsterdam 2018
Bringing order to the chaos! - Paulo Lopes - Codemotion Amsterdam 2018Codemotion
 
Remote Notifications
Remote NotificationsRemote Notifications
Remote NotificationsJosef Cacek
 
Vavr Java User Group Rheinland
Vavr Java User Group RheinlandVavr Java User Group Rheinland
Vavr Java User Group RheinlandDavid Schmitz
 

Similar to Brown Bag Lunch sur Hazelcast (20)

CouchDB on Android
CouchDB on AndroidCouchDB on Android
CouchDB on Android
 
mobl
moblmobl
mobl
 
Real time and reliable processing with Apache Storm
Real time and reliable processing with Apache StormReal time and reliable processing with Apache Storm
Real time and reliable processing with Apache Storm
 
InterConnect: Server Side Swift for Java Developers
InterConnect:  Server Side Swift for Java DevelopersInterConnect:  Server Side Swift for Java Developers
InterConnect: Server Side Swift for Java Developers
 
Hazelcast
HazelcastHazelcast
Hazelcast
 
Open XKE - Big Data, Big Mess par Bertrand Dechoux
Open XKE - Big Data, Big Mess par Bertrand DechouxOpen XKE - Big Data, Big Mess par Bertrand Dechoux
Open XKE - Big Data, Big Mess par Bertrand Dechoux
 
От Java Threads к лямбдам, Андрей Родионов
От Java Threads к лямбдам, Андрей РодионовОт Java Threads к лямбдам, Андрей Родионов
От Java Threads к лямбдам, Андрей Родионов
 
OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?
OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?
OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?
 
Paris js extensions
Paris js extensionsParis js extensions
Paris js extensions
 
Reactive programming on Android
Reactive programming on AndroidReactive programming on Android
Reactive programming on Android
 
mobl - model-driven engineering lecture
mobl - model-driven engineering lecturemobl - model-driven engineering lecture
mobl - model-driven engineering lecture
 
Java 8 Puzzlers [as presented at OSCON 2016]
Java 8 Puzzlers [as presented at  OSCON 2016]Java 8 Puzzlers [as presented at  OSCON 2016]
Java 8 Puzzlers [as presented at OSCON 2016]
 
V8
V8V8
V8
 
Getting the most out of Java [Nordic Coding-2010]
Getting the most out of Java [Nordic Coding-2010]Getting the most out of Java [Nordic Coding-2010]
Getting the most out of Java [Nordic Coding-2010]
 
Non Blocking I/O for Everyone with RxJava
Non Blocking I/O for Everyone with RxJavaNon Blocking I/O for Everyone with RxJava
Non Blocking I/O for Everyone with RxJava
 
Presto anatomy
Presto anatomyPresto anatomy
Presto anatomy
 
От Java Threads к лямбдам, Андрей Родионов
От Java Threads к лямбдам, Андрей РодионовОт Java Threads к лямбдам, Андрей Родионов
От Java Threads к лямбдам, Андрей Родионов
 
Bringing order to the chaos! - Paulo Lopes - Codemotion Amsterdam 2018
Bringing order to the chaos! - Paulo Lopes - Codemotion Amsterdam 2018Bringing order to the chaos! - Paulo Lopes - Codemotion Amsterdam 2018
Bringing order to the chaos! - Paulo Lopes - Codemotion Amsterdam 2018
 
Remote Notifications
Remote NotificationsRemote Notifications
Remote Notifications
 
Vavr Java User Group Rheinland
Vavr Java User Group RheinlandVavr Java User Group Rheinland
Vavr Java User Group Rheinland
 

More from Sylvain Wallez

Native Java with GraalVM
Native Java with GraalVMNative Java with GraalVM
Native Java with GraalVMSylvain Wallez
 
Inside the JVM - Follow the white rabbit! / Breizh JUG
Inside the JVM - Follow the white rabbit! / Breizh JUGInside the JVM - Follow the white rabbit! / Breizh JUG
Inside the JVM - Follow the white rabbit! / Breizh JUGSylvain Wallez
 
Developing web applications in Rust
Developing web applications in RustDeveloping web applications in Rust
Developing web applications in RustSylvain Wallez
 
Black friday logs - Scaling Elasticsearch
Black friday logs - Scaling ElasticsearchBlack friday logs - Scaling Elasticsearch
Black friday logs - Scaling ElasticsearchSylvain Wallez
 
Elastic - From 50 to 270, how to scale a distributed engineering team
Elastic - From 50 to 270, how to scale a distributed engineering teamElastic - From 50 to 270, how to scale a distributed engineering team
Elastic - From 50 to 270, how to scale a distributed engineering teamSylvain Wallez
 
Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!Sylvain Wallez
 
Introduction au langage Go
Introduction au langage GoIntroduction au langage Go
Introduction au langage GoSylvain Wallez
 
Kibana + timelion: time series with the elastic stack
Kibana + timelion: time series with the elastic stackKibana + timelion: time series with the elastic stack
Kibana + timelion: time series with the elastic stackSylvain Wallez
 
2016 05 iot - apero web
2016 05 iot - apero web2016 05 iot - apero web
2016 05 iot - apero webSylvain Wallez
 
Lucene - 10 ans d'usages plus ou moins classiques
Lucene - 10 ans d'usages plus ou moins classiquesLucene - 10 ans d'usages plus ou moins classiques
Lucene - 10 ans d'usages plus ou moins classiquesSylvain Wallez
 
2012 11 Toulibre - Open Hardware
2012 11 Toulibre - Open Hardware2012 11 Toulibre - Open Hardware
2012 11 Toulibre - Open HardwareSylvain Wallez
 
Play Framework - Toulouse JUG - nov 2011
Play Framework - Toulouse JUG - nov 2011Play Framework - Toulouse JUG - nov 2011
Play Framework - Toulouse JUG - nov 2011Sylvain Wallez
 
Développement avec Java Micro Edition
Développement avec Java Micro EditionDéveloppement avec Java Micro Edition
Développement avec Java Micro EditionSylvain Wallez
 

More from Sylvain Wallez (13)

Native Java with GraalVM
Native Java with GraalVMNative Java with GraalVM
Native Java with GraalVM
 
Inside the JVM - Follow the white rabbit! / Breizh JUG
Inside the JVM - Follow the white rabbit! / Breizh JUGInside the JVM - Follow the white rabbit! / Breizh JUG
Inside the JVM - Follow the white rabbit! / Breizh JUG
 
Developing web applications in Rust
Developing web applications in RustDeveloping web applications in Rust
Developing web applications in Rust
 
Black friday logs - Scaling Elasticsearch
Black friday logs - Scaling ElasticsearchBlack friday logs - Scaling Elasticsearch
Black friday logs - Scaling Elasticsearch
 
Elastic - From 50 to 270, how to scale a distributed engineering team
Elastic - From 50 to 270, how to scale a distributed engineering teamElastic - From 50 to 270, how to scale a distributed engineering team
Elastic - From 50 to 270, how to scale a distributed engineering team
 
Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!
 
Introduction au langage Go
Introduction au langage GoIntroduction au langage Go
Introduction au langage Go
 
Kibana + timelion: time series with the elastic stack
Kibana + timelion: time series with the elastic stackKibana + timelion: time series with the elastic stack
Kibana + timelion: time series with the elastic stack
 
2016 05 iot - apero web
2016 05 iot - apero web2016 05 iot - apero web
2016 05 iot - apero web
 
Lucene - 10 ans d'usages plus ou moins classiques
Lucene - 10 ans d'usages plus ou moins classiquesLucene - 10 ans d'usages plus ou moins classiques
Lucene - 10 ans d'usages plus ou moins classiques
 
2012 11 Toulibre - Open Hardware
2012 11 Toulibre - Open Hardware2012 11 Toulibre - Open Hardware
2012 11 Toulibre - Open Hardware
 
Play Framework - Toulouse JUG - nov 2011
Play Framework - Toulouse JUG - nov 2011Play Framework - Toulouse JUG - nov 2011
Play Framework - Toulouse JUG - nov 2011
 
Développement avec Java Micro Edition
Développement avec Java Micro EditionDéveloppement avec Java Micro Edition
Développement avec Java Micro Edition
 

Recently uploaded

SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 

Recently uploaded (20)

SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 

Brown Bag Lunch sur Hazelcast

  • 1. HAZELCAST OU LE CLUSTERING FACILE ! BBL – février 2014
  • 2. A propos… !  Sylvain Wallez Architecte et dev expert freelance Web/Java/Scala !  2014 - Fondateur de Actoboard !  2011 - Backend architect de Sigfox !  2008 - CTO de Goojet/Scoop.it !  2006 - Backend architect Joost !  2003 - Premier VP Apache français !  2000 - Cofondateur & CTO Anyware Technologies sylvain@bluxte.net http://bluxte.net Twitter: @bluxte ! 
  • 3. Mise en bouche Une appli distribuée en 5 lignes !
  • 4. Mise en bouche !  La Map classique public static void main(String[] args) { Map<String, String> map = new HashMap<>(); map.put("hello", "world"); String value = map.get("hello"); }
  • 5. Mise en bouche !  La ConcurrentMap public static void main(String[] args) { ConcurrentMap<String, String> map = new ConcurrentHashMap<>(); map.put("hello", "world"); String value = map.get("hello"); String previous = map.putIfAbsent("goodbye", "marylou"); }
  • 6. Mise en bouche !  La ConcurrentMap distribuée public static void main(String[] args) { HazelcastInstance hz = Hazelcast.newHazelcastInstance(); ConcurrentMap<String, String> map = hz.getMap("mymap"); map.put("hello", "world"); String value = map.get("hello"); String previous = map.putIfAbsent("goodbye", "marylou"); }
  • 8. Hazelcast features Mais que vient-on de voir ?
  • 9. Buzzword bingo ! In-memory data grid !  Open source, Apache Licence !  P2P elastic cache !  Distributed event bus !  NoSQL datastore !  Cluster coordination !  Distributed computing ! 
  • 10. La concurrence Oracle Coherence !  IBM Extreme Scale !  VMware Gemfire !  Gigaspaces !  JBoss Infinispan !  Gridgain !  Terracotta ! 
  • 11. In-memory data grid !  La Map classique, plus des bonus Asynchrone HazelcastInstance hz = Hazelcast.newHazelcastInstance(); IMap<String, String> map = hz.getMap("mymap"); map.put("hello", "world"); String value = map.get("hello"); Future<String> future = map.getAsync("hello"); Expiration map.put("goodbye", "marylou", 10, TimeUnit.MINUTES); Set<Entry<String, String>> set = map.entrySet(new Predicate<String, String>() { public boolean apply(Entry<String, String> entry) { return entry.getKey().contains("z"); } }); Filtrage « in grid »
  • 12. P2P elastic cache !  Partitionnement et réplication automatiques
  • 13. P2P elastic cache !  Ajout dynamique de nouveaux noeuds New! Multicast
  • 17. P2P event bus !  Les topics : broadcast à tous les listeners ITopic<String> topic = hz.getTopic("alerts"); topic.addMessageListener(new MessageListener<String>() { public void onMessage(Message<String> message) { } println("Received " + message.getMessageObject() + " from " + message.getPublishingMember()); }); Nœud d’origine du message
  • 18. P2P event bus !  Les queues BlockingQueue<String> queue = hz.getQueue("jobs"); queue.offer("Make me a sandwich"); BlockingQueue<String> queue = hz.getQueue("jobs"); while(true) { String job = queue.take(); println("Now working on " + job); } (Aussi en asynchrone avec poll() et les listeners)
  • 20. NoSQL datastore !  La Map « interrogeable » Indexation des propriétés IMap<Long, Employee> map = hz.getMap("employee"); map.addIndex("active", true); map.addIndex("age", true); Collection<Employee> employees = map.values(new SqlPredicate("active AND age < 30")); Sous ensemble de SQL sur les propriétés JavaBean
  • 21. Cluster coordination !  Compteurs distribués IAtomicLong reqCount = hz.getAtomicLong("users"); // Start request long count = reqCount.incrementAndGet(); try { // Do some stuff println("There are " + count + " request in progress"); } finally { // End request reqCount.decrementAndGet(); }
  • 22. Cluster coordination !  Locks distribués (à utiliser avec parcimonie) Lock lock = hz.getLock("maintenance_mode"); lock.lock(); try { // There can be only one in the cluster } finally { lock.unlock(); } ILock lock = hz.getLock("maintenance_mode"); lock.lock(10, TimeUnit.SECONDS); try { // There can be only one in the cluster } finally { lock.unlock(); } Protection : durée limitée
  • 23. Distributed computing !  Un ExecutorService distribué ExecutorService executor = hz.getExecutorService("compute"); Runnable job = null; Callable<String> jobWithResult = null; executor.execute(job); Future<String> future = executor.submit(jobWithResult);
  • 24. Distributed computing !  Un ExecutorService distribué !  Fonctions Data locality avancées de IExecutorService IExecutorService executor = hz.getExecutorService("compute"); Runnable job = null; Callable<String> jobWithResult = null; Choix explicite du noeud executor.executeOnKeyOwner(job, 42); Member member = hz.getPartitionService().getPartition(42).getOwner(); println("Submitting to IP address " + member.getInetSocketAddress()); executor.submitToMember(jobWithResult, member, new ExecutionCallback<String>() { public void onResponse(String response) { println("Result is " + response); } Callback public void onFailure(Throwable t) { println("Job failed"); asynchrone } }); }
  • 26. Administration JMX !  API de statistiques sur Cluster et Member !  Webapp Management Center !