SlideShare ist ein Scribd-Unternehmen logo
1 von 48
Infinispan
Distributed in-memory key/value data
grid and cache
@infinispan
Agenda
• Introduction
• Part 1
• Hash Tables
• Distributed Hash Tables
• Consistent Hashing
• Chord Lookup Protocol
• Part 2
• Data Grids
• Infinispan
• Architecture
• Consistent Hashing / Split Clusters
• Other features
Part I – A (very) short introduction to
distributed hash tables
Hash Tables
Source: Wikipedia
http://commons.wikimedia.org/wiki/File:Hash_table_5_0_1_1_1_1_1_LL.svg#/media/File:Hash_table_5_0_1_1_1_1_1_LL.svg
Distributed Hash Tables (DHT)
Source: Wikipedia - http://commons.wikimedia.org/wiki/File:DHT_en.svg#/media/File:DHT_en.svg
• Decentralized Hash Table functionality
• Interface
• put(K,V)
• get(K) -> V
• Nodes can fail, join and leave
• The system has to scale
Distributed Hash Tables (DHT)
• Flooding in N nodes
• put() – store in any node O(1)
• get() – send query to all nodes O(N)
• Full replication in N nodes
• put() – store in all nodes O(N)
• get() – check any node O(1)
Simple solutions
Fixed Hashing
NodeID = hash(key) % TotalNodes.
Fixed Hashing with High Availability
NodeID = hash(key) % TotalNodes.
Fixed Hashing and Scalability
NodeID = hash(key) % TotalNodes+1.
2 Nodes, Key Space={0,1,2,3,4,5}
NodeID = hash(key) % 2.
NodeID = hash(key) % 3.
N0 (key mod 2 = 0) N1 (key mod 2 = 1)
0,2,4 1,3,5
N0 (key mod 3 = 0) N1 (key mod 3 = 1) N2 (key mod 3 = 2)
0,3 1,4 2,5
Consistent Hashing
Consistent Hashing – The Hash Ring
0
N0
N1
N2
K1
K2
K3
K4
K5
K6
Consistent Hashing – Nodes Joining, Leaving
Source: http://www.griddynamics.com/distributed-algorithms-in-nosql-databases/
Chord: Peer-to-peer Lookup Protocol
• Load Balance – distributed hash function, spreading
keys evenly over nodes
• Decentralization – fully distributed no SPOF
• Scalability – logarithmic growth of lookup cost with
the number of nodes, large systems are feasible
• Availability – automatically adjusts its internal tables
to ensure the node responsible for a key is always
found
• Flexible naming – key-space is flat (flexibility in how
to map names to keys)
Chord – Lookup O(N)
Source: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications
Ion Stoica , Robert Morrisz, David Liben-Nowellz, David R. Kargerz, M. Frans Kaashoekz, Frank Dabekz, Hari Balakrishnanz
Chord – Lookup O(logN)
Source: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications
Ion Stoica , Robert Morrisz, David Liben-Nowellz, David R. Kargerz, M. Frans Kaashoekz, Frank Dabekz, Hari Balakrishnanz
• K=6 (0, 26−1)
• Finger[i] = first node that succeeds
(N+ 2𝑖−1
) mod 2K
, where 1 ≤ 𝑖 ≤ 𝐾
• Successor/Predecessor – the next/previous node on circle
Chord – Node Join
Source: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications
Ion Stoica , Robert Morrisz, David Liben-Nowellz, David R. Kargerz, M. Frans Kaashoekz, Frank Dabekz, Hari Balakrishnanz
• Node 26 joins the system between nodes 21 and 32.
• (a) Initial state: node 21 points to node 32;
• (b) node 26 finds its successor (i.e., node 32) and points to it;
• (c) node 26 copies all keys less than 26 from node 32;
• (d) the stabilize procedure updates the successor of node 21
to node 26.
• CAN (Hypercube), Chord (Ring), Pastry (Tree+Ring),
Tapestry (Tree+Ring), Viceroy, Kademlia, Skipnet,
Symphony (Ring), Koorde, Apocrypha, Land,
Bamboo, ORDI …
The world of DHTs …
Part II – A short introduction to
Infinispan
Where do we store data?
One size does not fit all...
Infinispan – History
• 2002 – JBoss App Server needed a clustered solution for
HTTP and EJB session state replication for HA clusters.
JGroups (open source group communication suite) had a
replicated map demo, expanded to a tree data structure,
added eviction and JTA transactions.
• 2003 – this was moved to JBoss AS code base
• 2005 – JBoss Cache was extracted and became a standalone
project
… JBoss Cache evolved into Infinispan, core parts redesigned
• 2009 – JBoss Cache 3.2 and Infinispan 4.0.0.ALPHA1 was
released
• 2015 - 7.2.0.Alpha1
• Check the Infinispan RoadMap for more details
Code?
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-embedded</artifactId>
<version>7.1.0.Final</version>
</dependency>
EmbeddedCacheManager cacheManager = new DefaultCacheManager();
Cache<String,String> cache = cacheManager.getCache();
cache.put("Hello", "World!");
Usage Modes
• Embedded / library mode
• clustering for apps and frameworks (e.g. JBoss
session replication)
• Local mode single cache
• JSR 107: JCACHE - Java Temporary Caching API
• Transactional local cache
• Eviction, expiration, write through, write
behind, preloading, notifications, statistics
• Cluster of caches
• Invalidation, Hibernate 2nd level cache
• Server mode – remote data store
• REST, MemCached, HotRod, WebSocket (*)
Code?
Configuration config = new ConfigurationBuilder()
.clustering()
.cacheMode(CacheMode.DIST_SYNC)
.sync()
.l1().lifespan(25000L)
.hash().numSegments(100).numOwners(3)
.build();
Configuration config = new ConfigurationBuilder()
.eviction()
.maxEntries(20000).strategy(EvictionStrategy.LRU)
.expiration()
.wakeUpInterval(5000L)
.maxIdle(120000L)
.build();
Infinispan – Core Architecture
Remote App 1 (C++) Remote App 2 (Java) Remote App 3 (.NET)
Network (TCP)
Node (JVM)
MemCached, HotRod, REST,
WebSocket (*)
Embedded App (Java)
Transport (JGroups)
Notification
Transactions / XA
Query
Map / Reduce
Monitoring
Storage Engine
(RAM +
Overflow)
Node (JVM)
MemCached, HotRod, REST,
WebSocket (*)
Embedded App (Java)
Transport (JGroups)
Notification
Transactions / XA
Query
Map / Reduce
Monitoring
Storage Engine
(RAM +
Overflow)
TCP/UDP
Infinispan Clustering and Consistent Hashing
• JGroups Views
• Each node has a unique address
• View changes when nodes join, leave
• Keys are hashed using MurmurHash3
algorithm
• Hash Space is divided into segments
• Key > Segment > Owners
• Primary and Backup Owners
Does it scale?
• 320 nodes, 3000 caches, 20 TB RAM
• Largest cluster formed: 1000 nodes
Empty Cluster
CLUSTER
Add 1 Entry
CLUSTER
K1
Primary and Backup
CLUSTER
K1
K1
Add another one
CLUSTER
K1
K1
K2
Primary And Backup
CLUSTER
K1
K1
K2K2
A cluster with more keys
CLUSTER
K1
K1
K2K2
K3
K3
K4
K4
K5
K5
A node dies…
CLUSTER
K1
K1
K2K2
K3
K3
K4
K4
K5
K5
The cluster heals
CLUSTER
K1
K1
K2K2
K3 K3
K4
K4
K5
K5
If multiple nodes fail…
• CAP Theorem to the rescue:
• Formulated by Eric Brewer in 1998
• C - Consistency
• A - High Availability
• P - Tolerance to Network Partitions
• Can only satisfy 2 at the same time:
• Consistency + Availability: The Ideal World where
network partitions do not exist
• Partitioning + Availability: Data might be different
between partitions
• Partitioning + Consistency: Do not corrupt data!
Infinispan Partition Handling Strategies
• In the presence of network partitions
• Prefer availability (partition handling DISABLED)
• Prefer consistency (partition handling ENABLED)
• Split Detection with partition handling ENABLED:
• Ensure stable topology
• LOST > numOwners OR no simple majority
• Check segment ownership
• Mark partition as Available / Degraded
• Send PartitionStatusChangedEvent to listeners
Cluster Partitioning – No data lost
K1
K1
K2K2
K3
K3
K4
K4
K5
K5
Partition1 Partition2
Cluster Partitioning – Lost data
K1
K1
K2K2
K3
K3
K4
K4
K5
K5
Partition1
Partition2
Merging Split Clusters
• Split Clusters see each other again
• Step1: Ensure stable topology
• Step2: Automatic: based on partition state
• 1 Available -> attempt merge
• All Degraded -> attempt merge
• Step3: Manual
• Data was lost
• Custom listener on Merge
• Application decides
Querying Infinispan
• Apache Lucene Index
• Native Query API (Query DSL)
• Hibernate Search and Apache Lucene to index and
search
• Native Map/Reduce
• Index-less
• Distributed Execution Framework
• Hadoop Integration (WIP)
• Run existing map/reduce jobs on Infinispan data
Map Reduce:
MapReduceTask<String, String, String, Integer> mapReduceTask
= new MapReduceTask<>(wordCache);
mapReduceTask
.mappedWith(new WordCountMapper())
.reducedWith(new WordCountReducer());
Map<String, Integer> wordCountMap = mapReduceTask.execute();
Query DSL:
QueryParser qp = new QueryParser("default", new
StandardAnalyzer());
Query luceneQ = qp
.parse("+station.name:airport +year:2014 +month:12
+(avgTemp < 0)");
CacheQuery cq = Search.getSearchManager(cache)
.getQuery(luceneQ, DaySummary.class);
List<Object> results = query.list();
Other features
• JMX Management
• RHQ (JBoss Enterprise Management Solution)
• CDI Support
• JSR 107 (JCACHE) integration
• Custom interceptors
• Runs on Amazon Web Services Platform
• Command line client
• JTA with JBoss TM, Bitronix, Atomikos
• GridFS (experimental API), CloudTM, Cross Site
Replication
DEMO
Q & A
Thank you!
Resources:
http://www.griddynamics.com/distributed-algorithms-in-nosql-databases/
http://www.infoq.com/articles/cap-twelve-years-later-how-the-rules-have-changed
http://www.allthingsdistributed.com/files/amazon-dynamo-sosp2007.pdf
http://pdos.csail.mit.edu/papers/ton:chord/paper-ton.pdf
http://www.martinbroadhurst.com/Consistent-Hash-Ring.html
http://infinispan.org/docs/7.2.x/user_guide/user_guide.html
https://github.com/infinispan/infinispan/wiki

Weitere ähnliche Inhalte

Was ist angesagt?

Terraform Introduction
Terraform IntroductionTerraform Introduction
Terraform Introductionsoniasnowfrog
 
Keeping a Secret with HashiCorp Vault
Keeping a Secret with HashiCorp VaultKeeping a Secret with HashiCorp Vault
Keeping a Secret with HashiCorp VaultMitchell Pronschinske
 
Secret Management with Hashicorp’s Vault
Secret Management with Hashicorp’s VaultSecret Management with Hashicorp’s Vault
Secret Management with Hashicorp’s VaultAWS Germany
 
How to improve ELK log pipeline performance
How to improve ELK log pipeline performanceHow to improve ELK log pipeline performance
How to improve ELK log pipeline performanceSteven Shim
 
Scaling Twitter
Scaling TwitterScaling Twitter
Scaling TwitterBlaine
 
Introduction to memcached
Introduction to memcachedIntroduction to memcached
Introduction to memcachedJurriaan Persyn
 
Leveraging Envoy Proxy and GraphQL to Lower the Risk of Monolith to Microserv...
Leveraging Envoy Proxy and GraphQL to Lower the Risk of Monolith to Microserv...Leveraging Envoy Proxy and GraphQL to Lower the Risk of Monolith to Microserv...
Leveraging Envoy Proxy and GraphQL to Lower the Risk of Monolith to Microserv...Christian Posta
 
Spring Caches with Protocol Buffers
Spring Caches with Protocol BuffersSpring Caches with Protocol Buffers
Spring Caches with Protocol BuffersVMware Tanzu
 
From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.Taras Matyashovsky
 
Introduction to Apache ZooKeeper
Introduction to Apache ZooKeeperIntroduction to Apache ZooKeeper
Introduction to Apache ZooKeeperSaurav Haloi
 
Deep Dive on PostgreSQL Databases on Amazon RDS (DAT324) - AWS re:Invent 2018
Deep Dive on PostgreSQL Databases on Amazon RDS (DAT324) - AWS re:Invent 2018Deep Dive on PostgreSQL Databases on Amazon RDS (DAT324) - AWS re:Invent 2018
Deep Dive on PostgreSQL Databases on Amazon RDS (DAT324) - AWS re:Invent 2018Amazon Web Services
 
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요Jo Hoon
 
MongoDB WiredTiger Internals: Journey To Transactions
MongoDB WiredTiger Internals: Journey To TransactionsMongoDB WiredTiger Internals: Journey To Transactions
MongoDB WiredTiger Internals: Journey To TransactionsMydbops
 
Cloudera Customer Success Story
Cloudera Customer Success StoryCloudera Customer Success Story
Cloudera Customer Success StoryXpand IT
 
AWS Tag Management for Cost Allocation
AWS Tag Management for Cost AllocationAWS Tag Management for Cost Allocation
AWS Tag Management for Cost AllocationYotascale
 
Introduction to Storm
Introduction to Storm Introduction to Storm
Introduction to Storm Chandler Huang
 

Was ist angesagt? (20)

Terraform Introduction
Terraform IntroductionTerraform Introduction
Terraform Introduction
 
Vault
VaultVault
Vault
 
Keeping a Secret with HashiCorp Vault
Keeping a Secret with HashiCorp VaultKeeping a Secret with HashiCorp Vault
Keeping a Secret with HashiCorp Vault
 
Secret Management with Hashicorp’s Vault
Secret Management with Hashicorp’s VaultSecret Management with Hashicorp’s Vault
Secret Management with Hashicorp’s Vault
 
How to improve ELK log pipeline performance
How to improve ELK log pipeline performanceHow to improve ELK log pipeline performance
How to improve ELK log pipeline performance
 
Scaling Twitter
Scaling TwitterScaling Twitter
Scaling Twitter
 
Introduction to memcached
Introduction to memcachedIntroduction to memcached
Introduction to memcached
 
Leveraging Envoy Proxy and GraphQL to Lower the Risk of Monolith to Microserv...
Leveraging Envoy Proxy and GraphQL to Lower the Risk of Monolith to Microserv...Leveraging Envoy Proxy and GraphQL to Lower the Risk of Monolith to Microserv...
Leveraging Envoy Proxy and GraphQL to Lower the Risk of Monolith to Microserv...
 
Spring Caches with Protocol Buffers
Spring Caches with Protocol BuffersSpring Caches with Protocol Buffers
Spring Caches with Protocol Buffers
 
Introducing Vault
Introducing VaultIntroducing Vault
Introducing Vault
 
From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.
 
Introduction to Apache ZooKeeper
Introduction to Apache ZooKeeperIntroduction to Apache ZooKeeper
Introduction to Apache ZooKeeper
 
Intro to AWS: Database Services
Intro to AWS: Database ServicesIntro to AWS: Database Services
Intro to AWS: Database Services
 
Deep Dive on PostgreSQL Databases on Amazon RDS (DAT324) - AWS re:Invent 2018
Deep Dive on PostgreSQL Databases on Amazon RDS (DAT324) - AWS re:Invent 2018Deep Dive on PostgreSQL Databases on Amazon RDS (DAT324) - AWS re:Invent 2018
Deep Dive on PostgreSQL Databases on Amazon RDS (DAT324) - AWS re:Invent 2018
 
Amazon EFS: Deep Dive
Amazon EFS: Deep DiveAmazon EFS: Deep Dive
Amazon EFS: Deep Dive
 
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
 
MongoDB WiredTiger Internals: Journey To Transactions
MongoDB WiredTiger Internals: Journey To TransactionsMongoDB WiredTiger Internals: Journey To Transactions
MongoDB WiredTiger Internals: Journey To Transactions
 
Cloudera Customer Success Story
Cloudera Customer Success StoryCloudera Customer Success Story
Cloudera Customer Success Story
 
AWS Tag Management for Cost Allocation
AWS Tag Management for Cost AllocationAWS Tag Management for Cost Allocation
AWS Tag Management for Cost Allocation
 
Introduction to Storm
Introduction to Storm Introduction to Storm
Introduction to Storm
 

Andere mochten auch

LMAX Disruptor - High Performance Inter-Thread Messaging Library
LMAX Disruptor - High Performance Inter-Thread Messaging LibraryLMAX Disruptor - High Performance Inter-Thread Messaging Library
LMAX Disruptor - High Performance Inter-Thread Messaging LibrarySebastian Andrasoni
 
2009 kalman.graffi emanics_aspects_ofautonomiccomputing_20090617
2009 kalman.graffi emanics_aspects_ofautonomiccomputing_200906172009 kalman.graffi emanics_aspects_ofautonomiccomputing_20090617
2009 kalman.graffi emanics_aspects_ofautonomiccomputing_20090617Kalman Graffi
 
Exercises 10
Exercises 10Exercises 10
Exercises 10AhusseinA
 
Criminals in the Cloud: Past, Present, and Future
Criminals in the Cloud: Past, Present, and FutureCriminals in the Cloud: Past, Present, and Future
Criminals in the Cloud: Past, Present, and FutureJim Lippard
 
Kademlia(日本語版)
Kademlia(日本語版)Kademlia(日本語版)
Kademlia(日本語版)Tasuku Takahashi
 
The bigger picture
The bigger pictureThe bigger picture
The bigger pictureSuresh Iyer
 
Dynamic Search Algorithm for unstructured Peer to Peer Networks
Dynamic Search Algorithm for unstructured Peer to Peer NetworksDynamic Search Algorithm for unstructured Peer to Peer Networks
Dynamic Search Algorithm for unstructured Peer to Peer NetworksVenkata Sai Manoj Illendula
 
Infinispan – the open source data grid platform by Mircea Markus
Infinispan – the open source data grid platform by Mircea MarkusInfinispan – the open source data grid platform by Mircea Markus
Infinispan – the open source data grid platform by Mircea MarkusCodemotion
 
Why RESTful Design for the Cloud is Best
Why RESTful Design for the Cloud is BestWhy RESTful Design for the Cloud is Best
Why RESTful Design for the Cloud is BestGalder Zamarreño
 
What's New in Infinispan 6.0
What's New in Infinispan 6.0What's New in Infinispan 6.0
What's New in Infinispan 6.0JBUG London
 
Infinispan,Lucene,Hibername OGM
Infinispan,Lucene,Hibername OGMInfinispan,Lucene,Hibername OGM
Infinispan,Lucene,Hibername OGMJBug Italy
 
LMAX Disruptor as real-life example
LMAX Disruptor as real-life exampleLMAX Disruptor as real-life example
LMAX Disruptor as real-life exampleGuy Nir
 
Infinispan Data Grid Platform
Infinispan Data Grid PlatformInfinispan Data Grid Platform
Infinispan Data Grid Platformjbugkorea
 
IEEE CCNC 2011: Kalman Graffi - LifeSocial.KOM: A Secure and P2P-based Soluti...
IEEE CCNC 2011: Kalman Graffi - LifeSocial.KOM: A Secure and P2P-based Soluti...IEEE CCNC 2011: Kalman Graffi - LifeSocial.KOM: A Secure and P2P-based Soluti...
IEEE CCNC 2011: Kalman Graffi - LifeSocial.KOM: A Secure and P2P-based Soluti...Kalman Graffi
 
London JBUG April 2015 - Performance Tuning Apps with WildFly Application Server
London JBUG April 2015 - Performance Tuning Apps with WildFly Application ServerLondon JBUG April 2015 - Performance Tuning Apps with WildFly Application Server
London JBUG April 2015 - Performance Tuning Apps with WildFly Application ServerJBUG London
 
Performance evaluation methods for P2P overlays
Performance evaluation methods for P2P overlaysPerformance evaluation methods for P2P overlays
Performance evaluation methods for P2P overlaysKnut-Helge Vik
 

Andere mochten auch (20)

LMAX Disruptor - High Performance Inter-Thread Messaging Library
LMAX Disruptor - High Performance Inter-Thread Messaging LibraryLMAX Disruptor - High Performance Inter-Thread Messaging Library
LMAX Disruptor - High Performance Inter-Thread Messaging Library
 
2009 kalman.graffi emanics_aspects_ofautonomiccomputing_20090617
2009 kalman.graffi emanics_aspects_ofautonomiccomputing_200906172009 kalman.graffi emanics_aspects_ofautonomiccomputing_20090617
2009 kalman.graffi emanics_aspects_ofautonomiccomputing_20090617
 
Exercises 10
Exercises 10Exercises 10
Exercises 10
 
Criminals in the Cloud: Past, Present, and Future
Criminals in the Cloud: Past, Present, and FutureCriminals in the Cloud: Past, Present, and Future
Criminals in the Cloud: Past, Present, and Future
 
Kademlia(日本語版)
Kademlia(日本語版)Kademlia(日本語版)
Kademlia(日本語版)
 
The bigger picture
The bigger pictureThe bigger picture
The bigger picture
 
Dynamic Search Algorithm for unstructured Peer to Peer Networks
Dynamic Search Algorithm for unstructured Peer to Peer NetworksDynamic Search Algorithm for unstructured Peer to Peer Networks
Dynamic Search Algorithm for unstructured Peer to Peer Networks
 
Ods chapter7
Ods chapter7Ods chapter7
Ods chapter7
 
Infinispan – the open source data grid platform by Mircea Markus
Infinispan – the open source data grid platform by Mircea MarkusInfinispan – the open source data grid platform by Mircea Markus
Infinispan – the open source data grid platform by Mircea Markus
 
Why RESTful Design for the Cloud is Best
Why RESTful Design for the Cloud is BestWhy RESTful Design for the Cloud is Best
Why RESTful Design for the Cloud is Best
 
What's New in Infinispan 6.0
What's New in Infinispan 6.0What's New in Infinispan 6.0
What's New in Infinispan 6.0
 
Infinispan,Lucene,Hibername OGM
Infinispan,Lucene,Hibername OGMInfinispan,Lucene,Hibername OGM
Infinispan,Lucene,Hibername OGM
 
Infinispan
InfinispanInfinispan
Infinispan
 
LMAX Disruptor as real-life example
LMAX Disruptor as real-life exampleLMAX Disruptor as real-life example
LMAX Disruptor as real-life example
 
Infinispan Data Grid Platform
Infinispan Data Grid PlatformInfinispan Data Grid Platform
Infinispan Data Grid Platform
 
IEEE CCNC 2011: Kalman Graffi - LifeSocial.KOM: A Secure and P2P-based Soluti...
IEEE CCNC 2011: Kalman Graffi - LifeSocial.KOM: A Secure and P2P-based Soluti...IEEE CCNC 2011: Kalman Graffi - LifeSocial.KOM: A Secure and P2P-based Soluti...
IEEE CCNC 2011: Kalman Graffi - LifeSocial.KOM: A Secure and P2P-based Soluti...
 
LMAX Architecture
LMAX ArchitectureLMAX Architecture
LMAX Architecture
 
London JBUG April 2015 - Performance Tuning Apps with WildFly Application Server
London JBUG April 2015 - Performance Tuning Apps with WildFly Application ServerLondon JBUG April 2015 - Performance Tuning Apps with WildFly Application Server
London JBUG April 2015 - Performance Tuning Apps with WildFly Application Server
 
Introduction P2p
Introduction P2pIntroduction P2p
Introduction P2p
 
Performance evaluation methods for P2P overlays
Performance evaluation methods for P2P overlaysPerformance evaluation methods for P2P overlays
Performance evaluation methods for P2P overlays
 

Ähnlich wie Infinispan, a distributed in-memory key/value data grid and cache

An introduction to Pincaster
An introduction to PincasterAn introduction to Pincaster
An introduction to PincasterFrank Denis
 
Hops - Distributed metadata for Hadoop
Hops - Distributed metadata for HadoopHops - Distributed metadata for Hadoop
Hops - Distributed metadata for HadoopJim Dowling
 
Keynote Yonik Seeley & Steve Rowe lucene solr roadmap
Keynote   Yonik Seeley & Steve Rowe lucene solr roadmapKeynote   Yonik Seeley & Steve Rowe lucene solr roadmap
Keynote Yonik Seeley & Steve Rowe lucene solr roadmaplucenerevolution
 
KEYNOTE: Lucene / Solr road map
KEYNOTE: Lucene / Solr road mapKEYNOTE: Lucene / Solr road map
KEYNOTE: Lucene / Solr road maplucenerevolution
 
Storing and distributing data
Storing and distributing dataStoring and distributing data
Storing and distributing dataPhil Cryer
 
What's new in hadoop 3.0
What's new in hadoop 3.0What's new in hadoop 3.0
What's new in hadoop 3.0Heiko Loewe
 
MyHeritage backend group - build to scale
MyHeritage backend group - build to scaleMyHeritage backend group - build to scale
MyHeritage backend group - build to scaleRan Levy
 
Using Containers and HPC to Solve the Mysteries of the Universe by Deborah Bard
Using Containers and HPC to Solve the Mysteries of the Universe by Deborah BardUsing Containers and HPC to Solve the Mysteries of the Universe by Deborah Bard
Using Containers and HPC to Solve the Mysteries of the Universe by Deborah BardDocker, Inc.
 
Deploying Grid Services Using Hadoop
Deploying Grid Services Using HadoopDeploying Grid Services Using Hadoop
Deploying Grid Services Using HadoopGeorge Ang
 
SDEC2011 NoSQL concepts and models
SDEC2011 NoSQL concepts and modelsSDEC2011 NoSQL concepts and models
SDEC2011 NoSQL concepts and modelsKorea Sdec
 
MySQL Options in OpenStack
MySQL Options in OpenStackMySQL Options in OpenStack
MySQL Options in OpenStackTesora
 
OpenStack Days East -- MySQL Options in OpenStack
OpenStack Days East -- MySQL Options in OpenStackOpenStack Days East -- MySQL Options in OpenStack
OpenStack Days East -- MySQL Options in OpenStackMatt Lord
 
Securing Your Apache Spark Applications
Securing Your Apache Spark ApplicationsSecuring Your Apache Spark Applications
Securing Your Apache Spark ApplicationsCloudera, Inc.
 
Securing Spark Applications by Kostas Sakellis and Marcelo Vanzin
Securing Spark Applications by Kostas Sakellis and Marcelo VanzinSecuring Spark Applications by Kostas Sakellis and Marcelo Vanzin
Securing Spark Applications by Kostas Sakellis and Marcelo VanzinSpark Summit
 
Introduction to libre « fulltext » technology
Introduction to libre « fulltext » technologyIntroduction to libre « fulltext » technology
Introduction to libre « fulltext » technologyRobert Viseur
 
Apache Cassandra training. Overview and Basics
Apache Cassandra training. Overview and BasicsApache Cassandra training. Overview and Basics
Apache Cassandra training. Overview and BasicsOleg Magazov
 

Ähnlich wie Infinispan, a distributed in-memory key/value data grid and cache (20)

An introduction to Pincaster
An introduction to PincasterAn introduction to Pincaster
An introduction to Pincaster
 
Hops - Distributed metadata for Hadoop
Hops - Distributed metadata for HadoopHops - Distributed metadata for Hadoop
Hops - Distributed metadata for Hadoop
 
Keynote Yonik Seeley & Steve Rowe lucene solr roadmap
Keynote   Yonik Seeley & Steve Rowe lucene solr roadmapKeynote   Yonik Seeley & Steve Rowe lucene solr roadmap
Keynote Yonik Seeley & Steve Rowe lucene solr roadmap
 
KEYNOTE: Lucene / Solr road map
KEYNOTE: Lucene / Solr road mapKEYNOTE: Lucene / Solr road map
KEYNOTE: Lucene / Solr road map
 
Storing and distributing data
Storing and distributing dataStoring and distributing data
Storing and distributing data
 
What's new in hadoop 3.0
What's new in hadoop 3.0What's new in hadoop 3.0
What's new in hadoop 3.0
 
From 0 to syncing
From 0 to syncingFrom 0 to syncing
From 0 to syncing
 
MyHeritage backend group - build to scale
MyHeritage backend group - build to scaleMyHeritage backend group - build to scale
MyHeritage backend group - build to scale
 
Using Containers and HPC to Solve the Mysteries of the Universe by Deborah Bard
Using Containers and HPC to Solve the Mysteries of the Universe by Deborah BardUsing Containers and HPC to Solve the Mysteries of the Universe by Deborah Bard
Using Containers and HPC to Solve the Mysteries of the Universe by Deborah Bard
 
Deploying Grid Services Using Hadoop
Deploying Grid Services Using HadoopDeploying Grid Services Using Hadoop
Deploying Grid Services Using Hadoop
 
Data Science
Data ScienceData Science
Data Science
 
SDEC2011 NoSQL concepts and models
SDEC2011 NoSQL concepts and modelsSDEC2011 NoSQL concepts and models
SDEC2011 NoSQL concepts and models
 
MySQL Options in OpenStack
MySQL Options in OpenStackMySQL Options in OpenStack
MySQL Options in OpenStack
 
OpenStack Days East -- MySQL Options in OpenStack
OpenStack Days East -- MySQL Options in OpenStackOpenStack Days East -- MySQL Options in OpenStack
OpenStack Days East -- MySQL Options in OpenStack
 
Securing Your Apache Spark Applications
Securing Your Apache Spark ApplicationsSecuring Your Apache Spark Applications
Securing Your Apache Spark Applications
 
Securing Spark Applications by Kostas Sakellis and Marcelo Vanzin
Securing Spark Applications by Kostas Sakellis and Marcelo VanzinSecuring Spark Applications by Kostas Sakellis and Marcelo Vanzin
Securing Spark Applications by Kostas Sakellis and Marcelo Vanzin
 
L6.sp17.pptx
L6.sp17.pptxL6.sp17.pptx
L6.sp17.pptx
 
Oracle OpenWo2014 review part 03 three_paa_s_database
Oracle OpenWo2014 review part 03 three_paa_s_databaseOracle OpenWo2014 review part 03 three_paa_s_database
Oracle OpenWo2014 review part 03 three_paa_s_database
 
Introduction to libre « fulltext » technology
Introduction to libre « fulltext » technologyIntroduction to libre « fulltext » technology
Introduction to libre « fulltext » technology
 
Apache Cassandra training. Overview and Basics
Apache Cassandra training. Overview and BasicsApache Cassandra training. Overview and Basics
Apache Cassandra training. Overview and Basics
 

Kürzlich hochgeladen

Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 

Kürzlich hochgeladen (20)

Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 

Infinispan, a distributed in-memory key/value data grid and cache

  • 1. Infinispan Distributed in-memory key/value data grid and cache @infinispan
  • 2. Agenda • Introduction • Part 1 • Hash Tables • Distributed Hash Tables • Consistent Hashing • Chord Lookup Protocol • Part 2 • Data Grids • Infinispan • Architecture • Consistent Hashing / Split Clusters • Other features
  • 3. Part I – A (very) short introduction to distributed hash tables
  • 5. Distributed Hash Tables (DHT) Source: Wikipedia - http://commons.wikimedia.org/wiki/File:DHT_en.svg#/media/File:DHT_en.svg
  • 6. • Decentralized Hash Table functionality • Interface • put(K,V) • get(K) -> V • Nodes can fail, join and leave • The system has to scale Distributed Hash Tables (DHT)
  • 7. • Flooding in N nodes • put() – store in any node O(1) • get() – send query to all nodes O(N) • Full replication in N nodes • put() – store in all nodes O(N) • get() – check any node O(1) Simple solutions
  • 8. Fixed Hashing NodeID = hash(key) % TotalNodes.
  • 9. Fixed Hashing with High Availability NodeID = hash(key) % TotalNodes.
  • 10. Fixed Hashing and Scalability NodeID = hash(key) % TotalNodes+1.
  • 11. 2 Nodes, Key Space={0,1,2,3,4,5} NodeID = hash(key) % 2. NodeID = hash(key) % 3. N0 (key mod 2 = 0) N1 (key mod 2 = 1) 0,2,4 1,3,5 N0 (key mod 3 = 0) N1 (key mod 3 = 1) N2 (key mod 3 = 2) 0,3 1,4 2,5
  • 13. Consistent Hashing – The Hash Ring 0 N0 N1 N2 K1 K2 K3 K4 K5 K6
  • 14. Consistent Hashing – Nodes Joining, Leaving Source: http://www.griddynamics.com/distributed-algorithms-in-nosql-databases/
  • 15. Chord: Peer-to-peer Lookup Protocol • Load Balance – distributed hash function, spreading keys evenly over nodes • Decentralization – fully distributed no SPOF • Scalability – logarithmic growth of lookup cost with the number of nodes, large systems are feasible • Availability – automatically adjusts its internal tables to ensure the node responsible for a key is always found • Flexible naming – key-space is flat (flexibility in how to map names to keys)
  • 16. Chord – Lookup O(N) Source: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Ion Stoica , Robert Morrisz, David Liben-Nowellz, David R. Kargerz, M. Frans Kaashoekz, Frank Dabekz, Hari Balakrishnanz
  • 17. Chord – Lookup O(logN) Source: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Ion Stoica , Robert Morrisz, David Liben-Nowellz, David R. Kargerz, M. Frans Kaashoekz, Frank Dabekz, Hari Balakrishnanz • K=6 (0, 26−1) • Finger[i] = first node that succeeds (N+ 2𝑖−1 ) mod 2K , where 1 ≤ 𝑖 ≤ 𝐾 • Successor/Predecessor – the next/previous node on circle
  • 18. Chord – Node Join Source: Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications Ion Stoica , Robert Morrisz, David Liben-Nowellz, David R. Kargerz, M. Frans Kaashoekz, Frank Dabekz, Hari Balakrishnanz • Node 26 joins the system between nodes 21 and 32. • (a) Initial state: node 21 points to node 32; • (b) node 26 finds its successor (i.e., node 32) and points to it; • (c) node 26 copies all keys less than 26 from node 32; • (d) the stabilize procedure updates the successor of node 21 to node 26.
  • 19. • CAN (Hypercube), Chord (Ring), Pastry (Tree+Ring), Tapestry (Tree+Ring), Viceroy, Kademlia, Skipnet, Symphony (Ring), Koorde, Apocrypha, Land, Bamboo, ORDI … The world of DHTs …
  • 20. Part II – A short introduction to Infinispan
  • 21. Where do we store data? One size does not fit all...
  • 22.
  • 23. Infinispan – History • 2002 – JBoss App Server needed a clustered solution for HTTP and EJB session state replication for HA clusters. JGroups (open source group communication suite) had a replicated map demo, expanded to a tree data structure, added eviction and JTA transactions. • 2003 – this was moved to JBoss AS code base • 2005 – JBoss Cache was extracted and became a standalone project … JBoss Cache evolved into Infinispan, core parts redesigned • 2009 – JBoss Cache 3.2 and Infinispan 4.0.0.ALPHA1 was released • 2015 - 7.2.0.Alpha1 • Check the Infinispan RoadMap for more details
  • 25. Usage Modes • Embedded / library mode • clustering for apps and frameworks (e.g. JBoss session replication) • Local mode single cache • JSR 107: JCACHE - Java Temporary Caching API • Transactional local cache • Eviction, expiration, write through, write behind, preloading, notifications, statistics • Cluster of caches • Invalidation, Hibernate 2nd level cache • Server mode – remote data store • REST, MemCached, HotRod, WebSocket (*)
  • 26. Code? Configuration config = new ConfigurationBuilder() .clustering() .cacheMode(CacheMode.DIST_SYNC) .sync() .l1().lifespan(25000L) .hash().numSegments(100).numOwners(3) .build(); Configuration config = new ConfigurationBuilder() .eviction() .maxEntries(20000).strategy(EvictionStrategy.LRU) .expiration() .wakeUpInterval(5000L) .maxIdle(120000L) .build();
  • 27. Infinispan – Core Architecture Remote App 1 (C++) Remote App 2 (Java) Remote App 3 (.NET) Network (TCP) Node (JVM) MemCached, HotRod, REST, WebSocket (*) Embedded App (Java) Transport (JGroups) Notification Transactions / XA Query Map / Reduce Monitoring Storage Engine (RAM + Overflow) Node (JVM) MemCached, HotRod, REST, WebSocket (*) Embedded App (Java) Transport (JGroups) Notification Transactions / XA Query Map / Reduce Monitoring Storage Engine (RAM + Overflow) TCP/UDP
  • 28. Infinispan Clustering and Consistent Hashing • JGroups Views • Each node has a unique address • View changes when nodes join, leave • Keys are hashed using MurmurHash3 algorithm • Hash Space is divided into segments • Key > Segment > Owners • Primary and Backup Owners
  • 29. Does it scale? • 320 nodes, 3000 caches, 20 TB RAM • Largest cluster formed: 1000 nodes
  • 35. A cluster with more keys CLUSTER K1 K1 K2K2 K3 K3 K4 K4 K5 K5
  • 38. If multiple nodes fail… • CAP Theorem to the rescue: • Formulated by Eric Brewer in 1998 • C - Consistency • A - High Availability • P - Tolerance to Network Partitions • Can only satisfy 2 at the same time: • Consistency + Availability: The Ideal World where network partitions do not exist • Partitioning + Availability: Data might be different between partitions • Partitioning + Consistency: Do not corrupt data!
  • 39. Infinispan Partition Handling Strategies • In the presence of network partitions • Prefer availability (partition handling DISABLED) • Prefer consistency (partition handling ENABLED) • Split Detection with partition handling ENABLED: • Ensure stable topology • LOST > numOwners OR no simple majority • Check segment ownership • Mark partition as Available / Degraded • Send PartitionStatusChangedEvent to listeners
  • 40. Cluster Partitioning – No data lost K1 K1 K2K2 K3 K3 K4 K4 K5 K5 Partition1 Partition2
  • 41. Cluster Partitioning – Lost data K1 K1 K2K2 K3 K3 K4 K4 K5 K5 Partition1 Partition2
  • 42. Merging Split Clusters • Split Clusters see each other again • Step1: Ensure stable topology • Step2: Automatic: based on partition state • 1 Available -> attempt merge • All Degraded -> attempt merge • Step3: Manual • Data was lost • Custom listener on Merge • Application decides
  • 43. Querying Infinispan • Apache Lucene Index • Native Query API (Query DSL) • Hibernate Search and Apache Lucene to index and search • Native Map/Reduce • Index-less • Distributed Execution Framework • Hadoop Integration (WIP) • Run existing map/reduce jobs on Infinispan data
  • 44. Map Reduce: MapReduceTask<String, String, String, Integer> mapReduceTask = new MapReduceTask<>(wordCache); mapReduceTask .mappedWith(new WordCountMapper()) .reducedWith(new WordCountReducer()); Map<String, Integer> wordCountMap = mapReduceTask.execute();
  • 45. Query DSL: QueryParser qp = new QueryParser("default", new StandardAnalyzer()); Query luceneQ = qp .parse("+station.name:airport +year:2014 +month:12 +(avgTemp < 0)"); CacheQuery cq = Search.getSearchManager(cache) .getQuery(luceneQ, DaySummary.class); List<Object> results = query.list();
  • 46. Other features • JMX Management • RHQ (JBoss Enterprise Management Solution) • CDI Support • JSR 107 (JCACHE) integration • Custom interceptors • Runs on Amazon Web Services Platform • Command line client • JTA with JBoss TM, Bitronix, Atomikos • GridFS (experimental API), CloudTM, Cross Site Replication