SlideShare a Scribd company logo
JBoss Users & Developers Conference

                         Boston:2010

Tuesday, June 22, 2010
Infinispan’s Hot Rod Protocol
                                      Galder Zamarreño
                              Senior Software Engineer, Red Hat
                                        21st June 2010




Tuesday, June 22, 2010
Who is Galder?


                         • Core R&D engineer on Infinispan and JBoss Cache
                         • Contributor and committer on JBoss AS, Hibernate,
                           JGroups, JBoss Portal,...etc




                                                             Galder Zamarreño | galder@jboss.org   3
Tuesday, June 22, 2010
Agenda

                         • Infinispan peer-to-peer vs Infinispan client-server mode
                         • What is Hot Rod
                         • The motivations behind Hot Rod
                         • Hot Rod implementations and sample code
                         • Infinispan server comparison
                         • The path ahead for Hot Rod
                         • Demo



                                                                Galder Zamarreño | galder@jboss.org   4
Tuesday, June 22, 2010
Infinispan Peer-To-Peer


                         •   Infinispan is an in-memory
                             distributed data grid
                         •   Traditionally, deployed in
                             peer-to-peer (p2p) mode




                                                          Galder Zamarreño | galder@jboss.org   5
Tuesday, June 22, 2010
Infinispan Client-Server


                         •   Sometimes client-server
                             makes more sense
                         •   E.g., access from non-JVM
                             environment
                         •   No Infinispan running on
                             client




                                                         Galder Zamarreño | galder@jboss.org   6
Tuesday, June 22, 2010
Infinispan Client-Server



                         •   P2P data grids do not get
                             along with elastic application
                             tiers




                                                              Galder Zamarreño | galder@jboss.org   7
Tuesday, June 22, 2010
Infinispan Client-Server



                         •   Elastic application tiers work
                             better with client-server




                                                              Galder Zamarreño | galder@jboss.org   8
Tuesday, June 22, 2010
Infinispan Client-Server


                         •   Multiple applications with data
                             storage needs
                             •   Starting a data grid per app
                                 is wasteful




                                                                Galder Zamarreño | galder@jboss.org   9
Tuesday, June 22, 2010
Infinispan Client-Server


                         •   Data service tier
                             •   Keep a pool of data grid
                                 nodes as shared storage tier




                                                                Galder Zamarreño | galder@jboss.org   10
Tuesday, June 22, 2010
Infinispan Client-Server

                         •   More examples:
                             •   Independent tier
                                 management
                                 •   E.g., upgrading AS without
                                     bringing down DB
                             •   Contrasting JVM tuning
                                 needs - CPU vs Memory
                             •   Security



                                                                  Galder Zamarreño | galder@jboss.org   11
Tuesday, June 22, 2010
Client-Server with Memcached




                                          Galder Zamarreño | galder@jboss.org   12
Tuesday, June 22, 2010
Client-Server with Infinispan
                                 Memcached




                                           Galder Zamarreño | galder@jboss.org   13
Tuesday, June 22, 2010
Client-Server with Infinispan
                                 Memcached




                                           Galder Zamarreño | galder@jboss.org   14
Tuesday, June 22, 2010
What is Hot Rod?


                         • Hot Rod is Infinispan’s binary client-server protocol
                         • Protocol designed for smart clients, which have the ability to:
                           • Load balance and failover dynamically
                           • Smartly route requests




                                                                 Galder Zamarreño | galder@jboss.org   15
Tuesday, June 22, 2010
Client Server with Hot Rod




                                         Galder Zamarreño | galder@jboss.org   16
Tuesday, June 22, 2010
Client Server with Hot Rod




                                         Galder Zamarreño | galder@jboss.org   17
Tuesday, June 22, 2010
The Hot Rod Protocol


                         • Transmitted keys and values treated as byte[]
                           • To ensure platform neutral behaviour
                         • Each operation prepended with cache name
                         • Basic operations:
                          • put, get, remove, containsKey, putIfAbsent, replace, clear
                          • stats, ping




                                                               Galder Zamarreño | galder@jboss.org   18
Tuesday, June 22, 2010
Data Consistency


                         • Concurrently accessed structures can suffer data
                           consistency issue
                         • Normally solved with JTA
                         • No JTA in Hot Rod (yet)
                         • Versioned API as solution




                                                              Galder Zamarreño | galder@jboss.org   19
Tuesday, June 22, 2010
Data Consistency Problem




                                        Galder Zamarreño | galder@jboss.org   20
Tuesday, June 22, 2010
Data Consistency Problem




                                        Galder Zamarreño | galder@jboss.org   21
Tuesday, June 22, 2010
Data Consistency in P2P




                                        Galder Zamarreño | galder@jboss.org   22
Tuesday, June 22, 2010
Hot Rod Versioned API




                                       Galder Zamarreño | galder@jboss.org   23
Tuesday, June 22, 2010
Hot Rod Versioned API




                                       Galder Zamarreño | galder@jboss.org   24
Tuesday, June 22, 2010
Hot Rod Client Intelligence


                         • Different client intelligence levels supported:
                           • Basic clients
                           • Topology-aware clients
                           • Hash-distribution-aware clients




                                                                  Galder Zamarreño | galder@jboss.org   25
Tuesday, June 22, 2010
Infinispan Hash Functions


                         • Infinispan uses language independent hash functions
                           • Used for smart routing
                         • Enables smart client implementations in any language
                         • So far, MurmurHash 2.0 implemented




                                                              Galder Zamarreño | galder@jboss.org   26
Tuesday, June 22, 2010
Topology Information Delivery




                                           Galder Zamarreño | galder@jboss.org   27
Tuesday, June 22, 2010
Topology Information Delivery




                                           Galder Zamarreño | galder@jboss.org   28
Tuesday, June 22, 2010
Hot Rod Implementations

                         • Server implementation included in 4.1.0.Beta2
                           • Uses high performance Netty socket framework
                           • Start via script: startServer.sh -r hotrod
                         • Java client reference implementation also available
                           • Supports all client intelligence levels
                         • Volunteers for writing clients in other languages welcomed :)
                           • If interested, join us at the Cloud Hackfest!



                                                                Galder Zamarreño | galder@jboss.org   29
Tuesday, June 22, 2010
Hot Rod Client Basic API

                         //API entry point, by default it connects to localhost:11311
                         CacheContainer cacheContainer = new RemoteCacheManager();

                         //obtain a handle to the remote default cache
                         Cache<String, String> cache = cacheContainer.getCache();

                         //now add something to the cache and make sure it is there
                         cache.put("car", "ferrari");
                         assert cache.get("car").equals("ferrari");

                         //remove the data
                         cache.remove("car");
                         assert !cache.containsKey("car") : "Value must have been removed!";




                                                                   Galder Zamarreño | galder@jboss.org   30
Tuesday, June 22, 2010
Hot Rod Client Versioned API
                         //API entry point, by default it connects to localhost:11311
                         CacheContainer cacheContainer = new RemoteCacheManager();

                         //obtain a handle to the remote default cache
                         RemoteCache<String, String> remoteCache = cacheContainer.getCache();

                         //put something in the cache
                         remoteCache.put("car", "ferrari");

                         //retrieve the value and the version
                         RemoteCache.VersionedValue value = remoteCache.getVersioned("car");

                         //replace it with a new value passing the version read
                         assert remoteCache.replace("car", "mclaren", value.getVersion());




                                                                   Galder Zamarreño | galder@jboss.org   31
Tuesday, June 22, 2010
Infinispan Servers Comparison

                                                   Client                Smart Load Balancing /
                                        Protocol              Clustered
                                                 Availability           Routing   Failover


                                                  Right now,                       Yes, dynamic via
                           Hot Rod       Binary                Yes       Yes
                                                  only Java                         Hot Rod client

                                                                                      Only with
                           Infinispan
                                          Text      Tons       Yes       No        predefined list of
                          Memcached
                                                                                       servers

                          Infinispan                                                 Any Http Load
                                          Text      Tons       Yes       No
                            REST                                                       Balancer


                                                                      Galder Zamarreño | galder@jboss.org   32
Tuesday, June 22, 2010
The path ahead for Hot Rod


                         • Within Hot Rod:
                           • Clients in other languages
                           • Querying
                           • Event handling...
                         • Submit protocol to a standards body (maybe)




                                                              Galder Zamarreño | galder@jboss.org   33
Tuesday, June 22, 2010
Hot Rod as base for new
                               functionality




                                        Galder Zamarreño | galder@jboss.org   34
Tuesday, June 22, 2010
Demo




                                Galder Zamarreño | galder@jboss.org   35
Tuesday, June 22, 2010
Summary

                         • Infinispan client-server architectures are needed
                         • Hot Rod is Infinispan’s binary client-server protocol
                         • Designed for load balancing, failover and smart routing
                         • Server and java client available now
                         • We need your help to build more clients!
                         • Hot Rod as foundation for interesting new functionality




                                                               Galder Zamarreño | galder@jboss.org   36
Tuesday, June 22, 2010
Questions?

                         • Project: www.infinispan.org
                         • Blog: blog.infinispan.org
                         • Twitter:
                           • @infinispan, @galderz
                           • #infinispan #judcon
                         • Join us at the Cloud Hackfest!!!
                         • JBoss Asylum Podcast recording - panel discussion
                           • Tonight, 8.30pm community room


                                                             Galder Zamarreño | galder@jboss.org   37
Tuesday, June 22, 2010
Learn more about Infinispan!

              •Storing Data on Cloud Infrastructure in a Scalable,
              Durable Manner - Wed 23rd

              •Using Infinispan for High Availability, Load Balancing, &
              Extreme Performance - Thu, 24th

              •How to Stop Worrying & Start Caching in Java - Thu 24th
              •Why RESTful Design for Cloud is Best - Fri 25th


Tuesday, June 22, 2010

More Related Content

PDF
Infinispan for Dummies
Galder Zamarreño
 
PPTX
Infinispan, a distributed in-memory key/value data grid and cache
Sebastian Andrasoni
 
PPTX
Middleware Technologies ppt
OECLIB Odisha Electronics Control Library
 
PDF
Spring Caches with Protocol Buffers
VMware Tanzu
 
PDF
Apache Pulsar @Splunk
Karthik Ramasamy
 
PPT
Middleware
Dr. Uday Saikia
 
PPT
Ch4 Threads
mayacendana
 
PPTX
Real time operating system
Bharti Goyal
 
Infinispan for Dummies
Galder Zamarreño
 
Infinispan, a distributed in-memory key/value data grid and cache
Sebastian Andrasoni
 
Middleware Technologies ppt
OECLIB Odisha Electronics Control Library
 
Spring Caches with Protocol Buffers
VMware Tanzu
 
Apache Pulsar @Splunk
Karthik Ramasamy
 
Middleware
Dr. Uday Saikia
 
Ch4 Threads
mayacendana
 
Real time operating system
Bharti Goyal
 

What's hot (20)

PPTX
Aws storage
Chandan Ganguly
 
PPTX
Application of cloud computing to agriculture
Swathi Rampur
 
PPTX
Node level simulators
SyedAhamed44
 
PDF
6.Distributed Operating Systems
Dr Sandeep Kumar Poonia
 
PDF
Federated Cloud Computing - The OpenNebula Experience v1.0s
Ignacio M. Llorente
 
PDF
[OpenStack 스터디] OpenStack With Contrail
OpenStack Korea Community
 
PPTX
Wireless Sensor Networks
Karthik
 
PPTX
Multiprocessor
Kamal Acharya
 
PPTX
WSN network architecture -Sensor Network Scenarios & Transceiver Design Consi...
ArunChokkalingam
 
PPT
Building a Scalable Architecture for web apps
Directi Group
 
PPTX
Sdn ppt
Pallavi Chhikara
 
PDF
Week2 cloud computing week2
Ankit Gupta
 
PDF
Automating Network Infrastructure : Ansible
Bangladesh Network Operators Group
 
PDF
Cloud computing system models for distributed and cloud computing
hrmalik20
 
PDF
Real Time Operating Systems
Rohit Joshi
 
PPTX
Cloud Deployment
Tushar Choudhary
 
PPTX
What is Serverless Computing?
AIMDek Technologies
 
PDF
Edge computing
Biddut Hossain
 
PPTX
Introduction of Iot and Logical and Physical design of iot
MayankKumar380505
 
PPTX
WSN presentation
Braj Raj Singh
 
Aws storage
Chandan Ganguly
 
Application of cloud computing to agriculture
Swathi Rampur
 
Node level simulators
SyedAhamed44
 
6.Distributed Operating Systems
Dr Sandeep Kumar Poonia
 
Federated Cloud Computing - The OpenNebula Experience v1.0s
Ignacio M. Llorente
 
[OpenStack 스터디] OpenStack With Contrail
OpenStack Korea Community
 
Wireless Sensor Networks
Karthik
 
Multiprocessor
Kamal Acharya
 
WSN network architecture -Sensor Network Scenarios & Transceiver Design Consi...
ArunChokkalingam
 
Building a Scalable Architecture for web apps
Directi Group
 
Week2 cloud computing week2
Ankit Gupta
 
Automating Network Infrastructure : Ansible
Bangladesh Network Operators Group
 
Cloud computing system models for distributed and cloud computing
hrmalik20
 
Real Time Operating Systems
Rohit Joshi
 
Cloud Deployment
Tushar Choudhary
 
What is Serverless Computing?
AIMDek Technologies
 
Edge computing
Biddut Hossain
 
Introduction of Iot and Logical and Physical design of iot
MayankKumar380505
 
WSN presentation
Braj Raj Singh
 
Ad

Viewers also liked (20)

PDF
Comparing the TCO of HP NonStop with Oracle RAC
Thomas Burg
 
PDF
Zero-Copy Event-Driven Servers with Netty
Daniel Bimschas
 
PDF
Open Stack Cheat Sheet V1
Anuchit Chalothorn
 
PDF
The Little Warehouse That Couldn't Or: How We Learned to Stop Worrying and Mo...
Spark Summit
 
PDF
Tachyon-2014-11-21-amp-camp5
Haoyuan Li
 
PDF
Linux Filesystems, RAID, and more
Mark Wong
 
PDF
Lessons Learned with Spark at the US Patent & Trademark Office-(Christopher B...
Spark Summit
 
PDF
Accelerating Cassandra Workloads on Ceph with All-Flash PCIE SSDS
Ceph Community
 
PDF
Advanced Data Retrieval and Analytics with Apache Spark and Openstack Swift
Daniel Krook
 
PDF
Scaling up genomic analysis with ADAM
fnothaft
 
PPTX
ELC-E 2010: The Right Approach to Minimal Boot Times
andrewmurraympc
 
PDF
Velox: Models in Action
Dan Crankshaw
 
ODP
Naïveté vs. Experience
Mike Fogus
 
PDF
SparkR: Enabling Interactive Data Science at Scale
jeykottalam
 
PDF
SampleClean: Bringing Data Cleaning into the BDAS Stack
jeykottalam
 
PDF
A Curious Course on Coroutines and Concurrency
David Beazley (Dabeaz LLC)
 
PDF
OpenStack Cheat Sheet V2
Anuchit Chalothorn
 
PDF
Lab 5: Interconnecting a Datacenter using Mininet
Zubair Nabi
 
PDF
Spark on Mesos-A Deep Dive-(Dean Wampler and Tim Chen, Typesafe and Mesosphere)
Spark Summit
 
PDF
Best Practices for Virtualizing Apache Hadoop
Hortonworks
 
Comparing the TCO of HP NonStop with Oracle RAC
Thomas Burg
 
Zero-Copy Event-Driven Servers with Netty
Daniel Bimschas
 
Open Stack Cheat Sheet V1
Anuchit Chalothorn
 
The Little Warehouse That Couldn't Or: How We Learned to Stop Worrying and Mo...
Spark Summit
 
Tachyon-2014-11-21-amp-camp5
Haoyuan Li
 
Linux Filesystems, RAID, and more
Mark Wong
 
Lessons Learned with Spark at the US Patent & Trademark Office-(Christopher B...
Spark Summit
 
Accelerating Cassandra Workloads on Ceph with All-Flash PCIE SSDS
Ceph Community
 
Advanced Data Retrieval and Analytics with Apache Spark and Openstack Swift
Daniel Krook
 
Scaling up genomic analysis with ADAM
fnothaft
 
ELC-E 2010: The Right Approach to Minimal Boot Times
andrewmurraympc
 
Velox: Models in Action
Dan Crankshaw
 
Naïveté vs. Experience
Mike Fogus
 
SparkR: Enabling Interactive Data Science at Scale
jeykottalam
 
SampleClean: Bringing Data Cleaning into the BDAS Stack
jeykottalam
 
A Curious Course on Coroutines and Concurrency
David Beazley (Dabeaz LLC)
 
OpenStack Cheat Sheet V2
Anuchit Chalothorn
 
Lab 5: Interconnecting a Datacenter using Mininet
Zubair Nabi
 
Spark on Mesos-A Deep Dive-(Dean Wampler and Tim Chen, Typesafe and Mesosphere)
Spark Summit
 
Best Practices for Virtualizing Apache Hadoop
Hortonworks
 
Ad

More from Galder Zamarreño (6)

PDF
Data Grids vs Databases
Galder Zamarreño
 
PDF
Data Grids and Data Caching
Galder Zamarreño
 
PDF
Ruby-on-Infinispan
Galder Zamarreño
 
PDF
Why RESTful Design for the Cloud is Best
Galder Zamarreño
 
PDF
Keeping Infinispan In Shape: Highly-Precise, Scalable Data Eviction
Galder Zamarreño
 
PDF
Infinispan Servers: Beyond peer-to-peer data grids
Galder Zamarreño
 
Data Grids vs Databases
Galder Zamarreño
 
Data Grids and Data Caching
Galder Zamarreño
 
Ruby-on-Infinispan
Galder Zamarreño
 
Why RESTful Design for the Cloud is Best
Galder Zamarreño
 
Keeping Infinispan In Shape: Highly-Precise, Scalable Data Eviction
Galder Zamarreño
 
Infinispan Servers: Beyond peer-to-peer data grids
Galder Zamarreño
 

Recently uploaded (20)

PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
The Future of Artificial Intelligence (AI)
Mukul
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Doc9.....................................
SofiaCollazos
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 

The Hot Rod Protocol in Infinispan

  • 1. JBoss Users & Developers Conference Boston:2010 Tuesday, June 22, 2010
  • 2. Infinispan’s Hot Rod Protocol Galder Zamarreño Senior Software Engineer, Red Hat 21st June 2010 Tuesday, June 22, 2010
  • 3. Who is Galder? • Core R&D engineer on Infinispan and JBoss Cache • Contributor and committer on JBoss AS, Hibernate, JGroups, JBoss Portal,...etc Galder Zamarreño | [email protected] 3 Tuesday, June 22, 2010
  • 4. Agenda • Infinispan peer-to-peer vs Infinispan client-server mode • What is Hot Rod • The motivations behind Hot Rod • Hot Rod implementations and sample code • Infinispan server comparison • The path ahead for Hot Rod • Demo Galder Zamarreño | [email protected] 4 Tuesday, June 22, 2010
  • 5. Infinispan Peer-To-Peer • Infinispan is an in-memory distributed data grid • Traditionally, deployed in peer-to-peer (p2p) mode Galder Zamarreño | [email protected] 5 Tuesday, June 22, 2010
  • 6. Infinispan Client-Server • Sometimes client-server makes more sense • E.g., access from non-JVM environment • No Infinispan running on client Galder Zamarreño | [email protected] 6 Tuesday, June 22, 2010
  • 7. Infinispan Client-Server • P2P data grids do not get along with elastic application tiers Galder Zamarreño | [email protected] 7 Tuesday, June 22, 2010
  • 8. Infinispan Client-Server • Elastic application tiers work better with client-server Galder Zamarreño | [email protected] 8 Tuesday, June 22, 2010
  • 9. Infinispan Client-Server • Multiple applications with data storage needs • Starting a data grid per app is wasteful Galder Zamarreño | [email protected] 9 Tuesday, June 22, 2010
  • 10. Infinispan Client-Server • Data service tier • Keep a pool of data grid nodes as shared storage tier Galder Zamarreño | [email protected] 10 Tuesday, June 22, 2010
  • 11. Infinispan Client-Server • More examples: • Independent tier management • E.g., upgrading AS without bringing down DB • Contrasting JVM tuning needs - CPU vs Memory • Security Galder Zamarreño | [email protected] 11 Tuesday, June 22, 2010
  • 12. Client-Server with Memcached Galder Zamarreño | [email protected] 12 Tuesday, June 22, 2010
  • 13. Client-Server with Infinispan Memcached Galder Zamarreño | [email protected] 13 Tuesday, June 22, 2010
  • 14. Client-Server with Infinispan Memcached Galder Zamarreño | [email protected] 14 Tuesday, June 22, 2010
  • 15. What is Hot Rod? • Hot Rod is Infinispan’s binary client-server protocol • Protocol designed for smart clients, which have the ability to: • Load balance and failover dynamically • Smartly route requests Galder Zamarreño | [email protected] 15 Tuesday, June 22, 2010
  • 16. Client Server with Hot Rod Galder Zamarreño | [email protected] 16 Tuesday, June 22, 2010
  • 17. Client Server with Hot Rod Galder Zamarreño | [email protected] 17 Tuesday, June 22, 2010
  • 18. The Hot Rod Protocol • Transmitted keys and values treated as byte[] • To ensure platform neutral behaviour • Each operation prepended with cache name • Basic operations: • put, get, remove, containsKey, putIfAbsent, replace, clear • stats, ping Galder Zamarreño | [email protected] 18 Tuesday, June 22, 2010
  • 19. Data Consistency • Concurrently accessed structures can suffer data consistency issue • Normally solved with JTA • No JTA in Hot Rod (yet) • Versioned API as solution Galder Zamarreño | [email protected] 19 Tuesday, June 22, 2010
  • 20. Data Consistency Problem Galder Zamarreño | [email protected] 20 Tuesday, June 22, 2010
  • 21. Data Consistency Problem Galder Zamarreño | [email protected] 21 Tuesday, June 22, 2010
  • 22. Data Consistency in P2P Galder Zamarreño | [email protected] 22 Tuesday, June 22, 2010
  • 23. Hot Rod Versioned API Galder Zamarreño | [email protected] 23 Tuesday, June 22, 2010
  • 24. Hot Rod Versioned API Galder Zamarreño | [email protected] 24 Tuesday, June 22, 2010
  • 25. Hot Rod Client Intelligence • Different client intelligence levels supported: • Basic clients • Topology-aware clients • Hash-distribution-aware clients Galder Zamarreño | [email protected] 25 Tuesday, June 22, 2010
  • 26. Infinispan Hash Functions • Infinispan uses language independent hash functions • Used for smart routing • Enables smart client implementations in any language • So far, MurmurHash 2.0 implemented Galder Zamarreño | [email protected] 26 Tuesday, June 22, 2010
  • 27. Topology Information Delivery Galder Zamarreño | [email protected] 27 Tuesday, June 22, 2010
  • 28. Topology Information Delivery Galder Zamarreño | [email protected] 28 Tuesday, June 22, 2010
  • 29. Hot Rod Implementations • Server implementation included in 4.1.0.Beta2 • Uses high performance Netty socket framework • Start via script: startServer.sh -r hotrod • Java client reference implementation also available • Supports all client intelligence levels • Volunteers for writing clients in other languages welcomed :) • If interested, join us at the Cloud Hackfest! Galder Zamarreño | [email protected] 29 Tuesday, June 22, 2010
  • 30. Hot Rod Client Basic API //API entry point, by default it connects to localhost:11311 CacheContainer cacheContainer = new RemoteCacheManager(); //obtain a handle to the remote default cache Cache<String, String> cache = cacheContainer.getCache(); //now add something to the cache and make sure it is there cache.put("car", "ferrari"); assert cache.get("car").equals("ferrari"); //remove the data cache.remove("car"); assert !cache.containsKey("car") : "Value must have been removed!"; Galder Zamarreño | [email protected] 30 Tuesday, June 22, 2010
  • 31. Hot Rod Client Versioned API //API entry point, by default it connects to localhost:11311 CacheContainer cacheContainer = new RemoteCacheManager(); //obtain a handle to the remote default cache RemoteCache<String, String> remoteCache = cacheContainer.getCache(); //put something in the cache remoteCache.put("car", "ferrari"); //retrieve the value and the version RemoteCache.VersionedValue value = remoteCache.getVersioned("car"); //replace it with a new value passing the version read assert remoteCache.replace("car", "mclaren", value.getVersion()); Galder Zamarreño | [email protected] 31 Tuesday, June 22, 2010
  • 32. Infinispan Servers Comparison Client Smart Load Balancing / Protocol Clustered Availability Routing Failover Right now, Yes, dynamic via Hot Rod Binary Yes Yes only Java Hot Rod client Only with Infinispan Text Tons Yes No predefined list of Memcached servers Infinispan Any Http Load Text Tons Yes No REST Balancer Galder Zamarreño | [email protected] 32 Tuesday, June 22, 2010
  • 33. The path ahead for Hot Rod • Within Hot Rod: • Clients in other languages • Querying • Event handling... • Submit protocol to a standards body (maybe) Galder Zamarreño | [email protected] 33 Tuesday, June 22, 2010
  • 34. Hot Rod as base for new functionality Galder Zamarreño | [email protected] 34 Tuesday, June 22, 2010
  • 35. Demo Galder Zamarreño | [email protected] 35 Tuesday, June 22, 2010
  • 36. Summary • Infinispan client-server architectures are needed • Hot Rod is Infinispan’s binary client-server protocol • Designed for load balancing, failover and smart routing • Server and java client available now • We need your help to build more clients! • Hot Rod as foundation for interesting new functionality Galder Zamarreño | [email protected] 36 Tuesday, June 22, 2010
  • 37. Questions? • Project: www.infinispan.org • Blog: blog.infinispan.org • Twitter: • @infinispan, @galderz • #infinispan #judcon • Join us at the Cloud Hackfest!!! • JBoss Asylum Podcast recording - panel discussion • Tonight, 8.30pm community room Galder Zamarreño | [email protected] 37 Tuesday, June 22, 2010
  • 38. Learn more about Infinispan! •Storing Data on Cloud Infrastructure in a Scalable, Durable Manner - Wed 23rd •Using Infinispan for High Availability, Load Balancing, & Extreme Performance - Thu, 24th •How to Stop Worrying & Start Caching in Java - Thu 24th •Why RESTful Design for Cloud is Best - Fri 25th Tuesday, June 22, 2010