2. for Dummies
Galder Zamarreño
Senior Software Engineer
Red Hat, Inc
Thursday, November 3, 11
3. Who is Galder?
• R&D engineer (Red Hat Inc):
• Infinispan developer
• Contributor and committer:
• JBoss AS, Hibernate, JGroups...etc
• More about me?
• Blog: zamarreno.com
• Twitter: @galderz
Thursday, November 3, 11
4. Agenda
• What is Infinispan?
• Infinispan as in-memory cache
• Infinispan as in-memory data grid
• Data-as-a-Service with Infinispan
• Clustering and migration challenges
• Who uses Infinispan?
Thursday, November 3, 11
5. What is Infinispan?
• Data grid platform:
• Open source (LGPL)
• In-memory
• Highly available
• Elastic
Thursday, November 3, 11
6. Local in-memory cache
• Performance booster
• Good for data that is:
• Hard to calculate
• Expensive to retrieve...etc
• Why not ConcurrentHashMap? Infinispan offers:
• Greater concurrency with MVCC
• Built-in eviction...etc
Thursday, November 3, 11
8. Clustered in-memory cache
• Same as local but cluster-aware
• More shared-cache space!
• Can help you cluster your framework too!
• Invalidation cache mode commonly used
Thursday, November 3, 11
12. Cache.putForExternalRead()
put() putForExternalRead()
Use for updating state Use to cache state read from
external source
Regular lock acquisition timeout Fail-fast
Could throw an exception Fails quietly
Could cause existing transaction to Will never affect existing
fail transactions
Thursday, November 3, 11
15. In-memory data grid
• It’s a data store, not just a cache
• An authoritative data sink
• FADE
• Fast
• Available
• Distributed
• Elastic
Thursday, November 3, 11
28. Virtualize data
• Some public services exist
• Amazon RDS and SimpleDB
• FathomDB, Cloudant...etc
• But not all cloud deployments are public!
• Private cloud very important
• How can you build a DaaS yourself?
Thursday, November 3, 11
29. Characteristics of DaaS
• Elastic data
• Need to scale with other tiers
• Response times should be linear
• Needs to be highly available!
• Nodes with die! The service shouldn’t
Thursday, November 3, 11
31. Clustering challenges
• JGroups taking care of clustering
• Default config file good for 4-16 nodes
• Bigger clusters require tweaking...
• Adjust transport and discovery to environment limitations
• Especially where UDP multicast not allowed
• These adjustments do not require altering code
Thursday, November 3, 11
32. Migration best practices
• ‘RadarGun’ project benchmarks different data grid products
• Benchmark your use case!
• Helps with mapping between different provider APIs
• XSLTs distributed to transform configuration
Thursday, November 3, 11
33. Who uses Infinispan?
• Examples:
• As a cache:
• Hibernate for the second level cache
• HTTP session cache in JBoss AS 6 and AS 7
• As a data grid:
• Real-time trading app of a well known stock exchange
Thursday, November 3, 11
34. What’s next?
• Distributed Executors and Map/Reduce
• Hibernate OGM (Object-Grid-Mapping)
• JPA-like interface backed by Infinispan
• ...etc
Thursday, November 3, 11
35. Summary
• Infinispan is a fast powerful local cache
• More space and scales up when cache is clustered
• Infinispan is also a distributed elastic data grid
• Accessible in embedded and client/server mode
• Build your own Data-as-a-Service with Infinispan
Thursday, November 3, 11
36. Questions?
• infinispan.org
• blog.infinispan.org
• @infinispan on twitter
• #infinispan for comments
• IRC: #infinispan on FreeNode
• speakerrate.com/galder
Thursday, November 3, 11