2 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
Sorry for...
● Those of you who expected a talk on “Hairy Security”– François Le Droff could not join
– A shame, it was an excellent talk
● Frenchness– Accent (and general rudeness)
● Jet lagged, tired and over caffeinated– Fly back from the US on Sunday, arrived in Berlin (home) yesterday, train to Köln last
night.
– No idea what time it is right now...
● Way too may things written on the slides– But will allow you to use them as notes later on
Real life innovative way to use Infinispan within your application
Romain PelisseSoftware [email protected] Mars 2016 – Javaland
With some content borrowed from works of Jeremy Brown and Thomas Qvarnström
4 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
Naming Madness
● Red Hat Business Model– Why ?
● Clear separation from the community project● Distinguish (and allow)
– “all you can eat buffet” on the community side– from the “what we support” on the product one
● JBoss Data Grid (JDG) / Infinispan (ISPN)– Same stuff !
– JDG generally a (little) behind ISPN
– Not all in ISPN is supported in JDG
– But all you need probably is ;)
5 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
Agenda
● JBoss Data Grid – a brief overview● Use Cases – not the most common !
– UC 1 : JCache – JEE Way to NoSQL goodness.. – UC 2 : Scalable and Resilient NoSQL Storage– UC 3 : Scalable Cache Infrastructure – UC 4 : Compute Grid – UC 5 : Manageable datastore (with Data Virtualisation)
What is JBoss Data Grid ?
(in 5 minutes)
7 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
Introducing JBoss Data Grid
● Open Source based on Infinispan● Based on some ideas from
– JBoss Cache
– and Amazon Dynamo
● Map-like API● Linear scalability● High transactional throughput● Very low latency, fault tolerance
Features
9 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
Key Features / Functionality (1/2)
● Schema-less key/value store ● Querying to easily search and find objects
● Security to store and restrict access
● Memory management
● Eviction and expiration
● Warms starts and pre load
● Multiple access protocols with data compatibility
● For applications written in any language
10 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
Key Features / Functionality (2/2)
● Distributed execution and map/reduce API
– to perform large scale, in-memory computations in parallel across the cluster
● Cross-data center replication (X Site)
– for high availability, load balancing and data partitioning
● Persistent Storage
– for long time storage or to move data off memory
● Events & Notifications
● Transactions (XA & JTA) for data consistency
11 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
Standards
● JSR-107 (Temporary Caching API)– Part of EE8
● JSR-347 (Data Grids)– Led by Red Hat
● JSR-346 (CDI 1.1)– Programming model for data grids
● JSR-317 (JPA2)– Data grids form caching API for database via
JPA2
Deployment modes
13 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
Deployment Library mode
14 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
Deployment Client / server stand-alone mode
15 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
Unlock the power of JGroups
● What is JGroups ?– toolkit for reliable group communication
– low-level API● allow many tweaks on network layer
● along with inner mechanism
– Group Membership (GMS), Failure Detection (FD), ...
● JDG allows access to all of that, while providing a more higher (arguably easier) high level API
Use Case 1 – JCache
JEE Way to NoSQL !
17 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
JCache – Old standard paving the way to innovation
● What is JCache ? (JSR-107)
– An old (ancient even) JEE related specs● resurrected (and now led) by the
Infinispan community
– API close to Map
– Allow to introduce Infinispan (with all its features set) into a fully JEE compliant app !
Use Case 2 – Scalable and Resilient NoSQL Storage
19 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
● Storage for authentication information– Fast, all in memory
– Easy lookup (by key)
– Scale up (if needed), no downtime
– Resilient with async repl, or even fault tolerant with sync repl● Even more with X Site replication
Scalable and Resilient NoSQL Storage
Photo Credits: Rob Pongsajapan
20 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
21 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
Leading online newspapers company
● Over one million of concurrent users– Only with one node !
● Handles authentication across several websites– Users navigates from one newspaper to an other transparently
● High response time required● Replicates synchronously to ensure resilience● Side note :
– Got even better performance when moved to JDG ;) !
Use Case 3 – Scalable Cache Infrastructure
23 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
Scalable Cache Infrastructure
● Provide a centralized, shared cache infrastructure– All apps (web, mobile) using the same (fast) data source
– Persist on file or SGDB● Or even use as a “source of truth”
– (see use case 5)
– Scale up provided by infrastructure● Add or removes nodes as needed● Transparent for app
– X Site replication ● provides fault tolerance
24 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
Leading Japanese telecommunications conglomerate
• Business challenges and needs:– System for processing billing information couldn’t scale as their
subscriber base increased
• JDG Use-case– Use JBoss Data Grid as a primary data store (inline cache) to store
latest mobile usage information. – JDG provided superior throughput (20,000 TPS) using cost-effective
hardware.
Use Case 4 – Compute Grid
26 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
In-memory compute grid
• Process TBs of data and result fast – via in-memory distributed computing
• Compute at each node on which data resides– Distributed execution– Map/Reduce framework
• Leverage parallel computing power:– Multiple nodes of the cluster + Multiple
cores on a machine
• Automated – no control on the workload
27 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
A Large American multinational banking and financial services holding company]
• Business challenges and needs:– Liquidity Risk Management
• Use JBoss Data Grid as a a compute grid to run simulation– Data stored in heap (1TB)
– A simulation take about 10 sec
Use Case 5 – Manageable data store with JDV
29 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
Managing NoSQL data
• Limitations with NoSQL – Few (if any) management tools
● Can't edit, update, remove content
– Use with other data source information is difficult● No SQL to bind all the date
• Solution ?
– Data Virtualization !
30 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
What is JBoss Data Virt (Teiid) ?
• Data virtualization technologies– Does the same for data that virtualization is doing for hardware
● Allow to query data across data source– abstracting types and so on...
● Allow to execute a join operation on several data source !
• Works (and supported) with JDG !– Give a (sort of) SQL access to the data stored in the grid !
– Reporting ● Compute on a grid ;) !
31 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
A Word of Warning
• SGDBs does a lot for you !– Transactions
– Management
– Indexing and join
• Thus, be careful with your– Data schema
– Transactions needs (or not)
– And your (lack of) relationships
32 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
What is JBoss Data Virt (Teiid) ?
• Data virtualization technologies– Does the same for data that virtualization is doing for hardware
● Allow to query data across data source– abstracting types and so on...
● Allow to execute a join operation on several data source !
• Works (and supported) with JDG !– Give a (sort of) SQL access to the data stored in the grid !
– Reporting ● Compute on a grid ;) !
33 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
Conclusion
• JDG is a very flexible NoSQL storage, offering many use case, above the simple cache scenario– But still rocks at being a cache ;)
THANK YOU
35 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
References (1/3)
• Websites: – JBoss Data Grid product page:
http://www.redhat.com/en/technologies/jboss-middleware/data-grid
– Download at JBoss.org's : https://www.jboss.org/products/datagrid/overview/
• Red Hat JBoss Data Grid documentation & Datasheets : – Red Hat JBoss Data Grid datasheet:
http://www.redhat.com/en/resources/red-hat-jboss-data-grid-datasheet
– Documentation: https://access.redhat.com/knowledge/docs/JBoss_Data_Grid
36 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
References (2/3)
• Customer case studies: – True Breaks from Vendor Lock-In without Compromising on
Performance with Red Hat : http://www.redhat.com/en/resources/true-breaks-vendor-lock-without-compromising-performance-red-hat
37 / 37 Real life innovative way to use Infinispan within your application Javaland 2016
References (3/3)
• Whitepapers:
– Supercharge applications and achieve business agility with in-memory data grids: http://www.redhat.com/en/resources/supercharge-applications-and-achieve-business-agility-memory-data-grids
– Red Hat JBoss Data Grid, The perfect solution for big data and application performance : http://www.redhat.com/en/resources/red-hat-jboss-data-grid-perfect-solution-big-data-and-application-performance