Hazelcast 101
-
Upload
emrah-kocaman -
Category
Software
-
view
215 -
download
2
description
Transcript of Hazelcast 101
![Page 1: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/1.jpg)
H A Z E L C A S T 1 0 1T H E L E A D I N G I M D G S O L U T I O N E X P L A I N E D
![Page 2: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/2.jpg)
E M R A H K O C A M A N @emrahkocaman
https://github.com/emrahkocaman [email protected]
About Me
!
• Oracle Certified Professional Java Programmer • 6+ years of Professional Java development • Was working on enterprise Java technologies • Software Developer at Hazelcast (since July 2014)
![Page 3: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/3.jpg)
Before we begin
![Page 4: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/4.jpg)
Agenda
• What is IMDG? • What is Hazelcast? • Configuring Hazelcast • Distributed World of Hazelcast • Hazelcast - Spring Framework Integration • Management Center
![Page 5: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/5.jpg)
I N - M E M O R Y D ATA G R I D S
What’s IMDG?
Provide virtually unlimited processing power and memory as additional cluster members are added
Expand in real time and dynamically to meet increasing requirements
Increase capacity in a linear and predictable manner
Leverage commodity or integrated systems that are easily added without complexity
![Page 6: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/6.jpg)
What is Hazelcast?
• The leading In Memory Data Grid • Highly Available Elastic Cache • 4.2 MBytes JAR • Distributed Execution Platform • Embedded or Client Server • Cloud Ready • Open Source - Apache License 2.0
![Page 7: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/7.jpg)
Distributed Data-structures
• IAtomicLong • IdGenerator • Lock • CountDownLatch • Semaphore • Queue • Map • MultiMap
• Set • List • Topic • Executor • Write your own!
![Page 8: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/8.jpg)
Who uses Hazelcast?
![Page 9: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/9.jpg)
Use Cases
![Page 10: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/10.jpg)
Raspberry Pi Cluster
![Page 11: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/11.jpg)
Use Cases
• Scale your application • Data sharing • Distributed Caching • HTTP Session Replication • Hibernate 2nd Level Cache • Parallel Execution • Map-Reduce • Spring Cache Provider
![Page 12: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/12.jpg)
Features
• Java Collection API • MultiMap • Topic • Java Concurrency API
• Lock, Semaphore, CountDownLatch, ExecutorService • Transactions • Custom Serialization • Off-Heap Support • Native Clients: C#, C++, Java, REST, memcached
![Page 13: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/13.jpg)
C O N F I G U R I N G & F O R M I N G A C L U S T E R
![Page 14: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/14.jpg)
Forming A Cluster
• Hazelcast Clusters run on JVM
• Hazelcast discovers other instances via Multicast (Default)
• Use TCP/IP lists when Multicast not possible
• Segregate Clusters on same network via configuration
• Hazelcast can form clusters on Amazon EC2.
![Page 15: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/15.jpg)
Configuration
• Hazelcast searches for hazelcast.xml on class path
• Will use hazelcast-default.xml for everything else.
• Hazelcast can be configured via XML,API or Spring
• Configure Networks, Data Structures, Indexes, EC2
• Config is locked at start-up, cannot dynamically change (feature coming soon)
![Page 16: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/16.jpg)
Start Your First Nodes
![Page 17: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/17.jpg)
1 / 2
How Hazelcast Works
• Multiple Partitions Per Node • Consistent Hashing: hash(key) % partition count • Option to control partitioning • Possibility to find key owner for every key • Support for Near-Caching and executions on key
owner • Automatic Fault-Tolerance • Sync / Async Backups • Configurable Backup Counts
![Page 18: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/18.jpg)
2 / 3
How Hazelcast Works
New Node
Re-balance
![Page 19: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/19.jpg)
3 / 3
How Hazelcast Works
A node crashes Backups restored
Recover from backupBackup for recovered data
![Page 20: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/20.jpg)
Distributed Map
![Page 21: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/21.jpg)
Distributed Queue
![Page 22: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/22.jpg)
Distributed Topic
![Page 23: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/23.jpg)
Distributed Events
![Page 24: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/24.jpg)
Distributed Lock
![Page 25: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/25.jpg)
1 / 2
Executor Service
![Page 26: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/26.jpg)
2 / 2
Executor Service
![Page 27: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/27.jpg)
Spring Integration
• Supports Spring 2.5+ • Hazelcast Namespace • Spring Cache Provider • Spring Data Integration (on the way)
![Page 28: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/28.jpg)
B A S I C B E A N D E C L A R AT I O N
Spring Integration
![Page 29: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/29.jpg)
H A Z E L C A S T N A M E S PA C E
Spring Integration
![Page 30: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/30.jpg)
H A Z E L C A S T N A M E S PA C E
Spring Integration
![Page 31: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/31.jpg)
D E C L A R AT I V E C O N F I G U R AT I O N
Spring Cache
![Page 32: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/32.jpg)
A N N O TAT I O N B A S E D C O N F I G U R AT I O N
Spring Cache
![Page 33: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/33.jpg)
– H E N R Y M I N T Z B E R G
“Management is, above all, a practice where art, science, and craft meet”
![Page 34: Hazelcast 101](https://reader033.fdocuments.in/reader033/viewer/2022042521/547e806c5806b5f45e8b46be/html5/thumbnails/34.jpg)
T H A N K Y O U
Q & A
@emrahkocaman, @hazelcast [email protected] [email protected] http://www.hazelcast.com http://github.com/hazelcast/hazelcast