SlideShare une entreprise Scribd logo
1  sur  27
Fast, Scalable
Front/Back-end Services
  using Ruby, Rails and
         XMPP
    Pradeep Elankumaran
      pradeep@intridea.com
       twitter: @pradeep24
What is XMPP?
•   eXtensible Messaging and Presence Protocol

•   Message-oriented middleware

•   XML-based

•   Various XMPP servers (eJabberd, Openfire, Tigase)

•   Most known for being the backend for IM systems

•   xmpp.org
The GOOD
• Open
• Standardized by the IETF
• Decentralized
• Mature
• Customizable
• FAST!
The BAD
• XML is very verbose
• Documentation is not outlined properly
    •   though there are efforts to make this better

•   Lots of presence data overhead on larger
    networks
•   No unmodified binary data transfers
A Simple XMPP Stanza
                      JID         resource


 <message from=’pradeep@xmpp.org/adium’
     to=’zana@xmpp.org’>
  <body>This is a message</body>
 </message>
Some XMPP Features
• Presence
• Instant Messaging
• Publish/Subscribe
• Multi-User Chat
• Federation
• Personal Eventing, and many more...
The Future
Publish/Subscribe
         <iq type=’set’ to=’pubsub.xmpp.org’
         from=’me@xmpp.org’>
            <pubsub xmlns=’http://jabber.org/protocol/pubsub’>
             <publish node=’apples’>
              <item>Fuji Apples</item>
node name                                                the pubsub namespace
             </publish>
            </pubsub>
         </iq>




   subscriber                                            subscriber

                               subscriber
Publish / Subscribe
• Federated Microblogging using the Personal
  Eventing Protocol (PEP)
• Real-time search
• Real-time topic-tracking via multiple
  communication channels (RSS, IM etc.)
• Real-time collaborative editing
Real-time User Interfaces
• BOSH
• Robust, lively interfaces for daily use
• Javascript-based XMPP clients
• Handlers attached to various XMPP stanzas
• Present.ly, drop.io
The Backend
XMPP4R
•gem install ln-xmpp4r
• very full-featured
• threaded, event-based
• BAD: a lack of documentation, steep
  learning curve
• Interfacing with Rails app requires an
  external daemon
strophe-ruby
• gem install yong-stropheruby
• based off libstrophe, a C library
• event-based
• can be run within a Rails app with proper
  timeouts and exception handling
• new release soon
• LOOKING FOR CONTRIBUTORS!
The Front-End
BOSH
•   Bi-directional streams Over Synchronous HTTP

•   This is not COMET, which requires a single
    persistent connection

•   Session persists over multiple connections

•   Full-formed HTTP requests, so works with
    most proxies
BOSH
client   <body/>, session


                      BOSH
                    connection   no <body/>
                     manager
                                         XMPP
                                         server
Strophe
• Excellent Javascript BOSH client
• written by Jack Moffit (metajack.im)
• written for Chesspark
• used in production at Present.ly
• very, very awesome.
Strophe
connection = new Strophe.Connection(“/http-bind”);
connection.connect(“pradeep@xmpp.org”, “password”,
           onConnect);

// this calls onMessage for each <message/> stanza
connection.addHandler(onMessage, null, ‘message’,
                      null, null, null);

// this calls onPubsubEvent every time there’s a message
// from a PubSub node
connection.addHandler(onPubsubEvent,
 'http://jabber.org/protocol/pubsub#event', 'message',
  null, null, null);
An Example
Present.ly (before)
    Client

             jQuery, polling



     Rails                      Custom Index




                           DB


   Supporting
    Daemons
we needed
something better
Present.ly (now)
                                  BOS
                                       H, st
             Client                          rophe-
                                                   js



                                                    BOSH
                                              connection manager
 Rails
                      str
                         op
                           he
                              -ru
                                  by




                                                        eJabberd

                DB
Supporting
 Daemons
scales beautifully
demo time
XMPP Servers
• eJabberd
   • written in Erlang, highly scalable, actively maintained
   • runs in production on Present.ly, Chesspark
• Jabberd2
   • written in C, actively maintained
• Tigase
   • written in Java, actively maintained
   • runs in production on Seesmic
• Openfire
   • written in Java, actively maintained
   • large community, lots of plugins. good for basic XMPP apps
• Prosody
   • written in Lua, very new, claims to be lightweight
Questions?
 pradeep@intridea.com
  twitter: @pradeep24
  http://www.skyfallsin.com

Contenu connexe

Tendances

Ruby Meets Cocoa
Ruby Meets CocoaRuby Meets Cocoa
Ruby Meets CocoaRobbert
 
J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Touroscon2007
 
Jabber is more than instant messaging
Jabber is more than instant messagingJabber is more than instant messaging
Jabber is more than instant messagingFlorian Holzhauer
 
Camel and JBoss
Camel and JBossCamel and JBoss
Camel and JBossJBug Italy
 
When Ruby Meets Java - The Power of Torquebox
When Ruby Meets Java - The Power of TorqueboxWhen Ruby Meets Java - The Power of Torquebox
When Ruby Meets Java - The Power of Torqueboxrockyjaiswal
 
Crash course to the Apache Camel
Crash course to the Apache CamelCrash course to the Apache Camel
Crash course to the Apache CamelHenryk Konsek
 
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...bobmcwhirter
 
The Future of Dependency Management for Ruby
The Future of Dependency Management for RubyThe Future of Dependency Management for Ruby
The Future of Dependency Management for RubyHiroshi SHIBATA
 
UltraESB - an introduction
UltraESB - an introductionUltraESB - an introduction
UltraESB - an introductionAdroitLogic
 
Roadmap for RubyGems 4 and Bundler 3
Roadmap for RubyGems 4 and Bundler 3Roadmap for RubyGems 4 and Bundler 3
Roadmap for RubyGems 4 and Bundler 3Hiroshi SHIBATA
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011bobmcwhirter
 
Symfony e grandi numeri: si può fare!
Symfony e grandi numeri: si può fare!Symfony e grandi numeri: si può fare!
Symfony e grandi numeri: si può fare!Daniel Londero
 
Consuming RESTful services in PHP
Consuming RESTful services in PHPConsuming RESTful services in PHP
Consuming RESTful services in PHPZoran Jeremic
 
Introduction to AtomPub Web Services
Introduction to AtomPub Web ServicesIntroduction to AtomPub Web Services
Introduction to AtomPub Web ServicesBen Ramsey
 
The Future of library dependency management of Ruby
 The Future of library dependency management of Ruby The Future of library dependency management of Ruby
The Future of library dependency management of RubyHiroshi SHIBATA
 
TorqueBox for Rubyists
TorqueBox for RubyistsTorqueBox for Rubyists
TorqueBox for Rubyistsbobmcwhirter
 
DataMapper on Infinispan
DataMapper on InfinispanDataMapper on Infinispan
DataMapper on InfinispanLance Ball
 

Tendances (20)

Ruby Meets Cocoa
Ruby Meets CocoaRuby Meets Cocoa
Ruby Meets Cocoa
 
J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Tour
 
Jabber is more than instant messaging
Jabber is more than instant messagingJabber is more than instant messaging
Jabber is more than instant messaging
 
Camel and JBoss
Camel and JBossCamel and JBoss
Camel and JBoss
 
When Ruby Meets Java - The Power of Torquebox
When Ruby Meets Java - The Power of TorqueboxWhen Ruby Meets Java - The Power of Torquebox
When Ruby Meets Java - The Power of Torquebox
 
Crash course to the Apache Camel
Crash course to the Apache CamelCrash course to the Apache Camel
Crash course to the Apache Camel
 
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
The Future of Dependency Management for Ruby
The Future of Dependency Management for RubyThe Future of Dependency Management for Ruby
The Future of Dependency Management for Ruby
 
RabbitMQ Operations
RabbitMQ OperationsRabbitMQ Operations
RabbitMQ Operations
 
RubyGems 3 & 4
RubyGems 3 & 4RubyGems 3 & 4
RubyGems 3 & 4
 
UltraESB - an introduction
UltraESB - an introductionUltraESB - an introduction
UltraESB - an introduction
 
Roadmap for RubyGems 4 and Bundler 3
Roadmap for RubyGems 4 and Bundler 3Roadmap for RubyGems 4 and Bundler 3
Roadmap for RubyGems 4 and Bundler 3
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011
 
Symfony e grandi numeri: si può fare!
Symfony e grandi numeri: si può fare!Symfony e grandi numeri: si può fare!
Symfony e grandi numeri: si può fare!
 
Consuming RESTful services in PHP
Consuming RESTful services in PHPConsuming RESTful services in PHP
Consuming RESTful services in PHP
 
Introduction to AtomPub Web Services
Introduction to AtomPub Web ServicesIntroduction to AtomPub Web Services
Introduction to AtomPub Web Services
 
The Future of library dependency management of Ruby
 The Future of library dependency management of Ruby The Future of library dependency management of Ruby
The Future of library dependency management of Ruby
 
TorqueBox for Rubyists
TorqueBox for RubyistsTorqueBox for Rubyists
TorqueBox for Rubyists
 
DataMapper on Infinispan
DataMapper on InfinispanDataMapper on Infinispan
DataMapper on Infinispan
 

En vedette

En vedette (10)

Encuesta al Bar Spartan
Encuesta al Bar SpartanEncuesta al Bar Spartan
Encuesta al Bar Spartan
 
Portfolio_JIYONG_YOO
Portfolio_JIYONG_YOOPortfolio_JIYONG_YOO
Portfolio_JIYONG_YOO
 
Ungdom Og Media
Ungdom Og MediaUngdom Og Media
Ungdom Og Media
 
Presentacion Tecnociencia
Presentacion TecnocienciaPresentacion Tecnociencia
Presentacion Tecnociencia
 
Información familias
Información familiasInformación familias
Información familias
 
Pastor
PastorPastor
Pastor
 
Act5 unidad-2
Act5 unidad-2Act5 unidad-2
Act5 unidad-2
 
Camilo Herrera - Un litro de luz
Camilo Herrera - Un litro de luzCamilo Herrera - Un litro de luz
Camilo Herrera - Un litro de luz
 
Soñamos los robots del futuro
Soñamos los robots del futuroSoñamos los robots del futuro
Soñamos los robots del futuro
 
Felipe games
Felipe gamesFelipe games
Felipe games
 

Similaire à Fast & Scalable Front/Back-ends using Ruby, Rails & XMPP

Microblogging via XMPP
Microblogging via XMPPMicroblogging via XMPP
Microblogging via XMPPStoyan Zhekov
 
JSON-RPC Proxy Generation with PHP 5
JSON-RPC Proxy Generation with PHP 5JSON-RPC Proxy Generation with PHP 5
JSON-RPC Proxy Generation with PHP 5Stephan Schmidt
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Railsdosire
 
ReST Vs SOA(P) ... Yawn
ReST Vs SOA(P) ... YawnReST Vs SOA(P) ... Yawn
ReST Vs SOA(P) ... Yawnozten
 
Rapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devicesRapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devicesciklum_ods
 
Web Development: The Next Five Years
Web Development: The Next Five YearsWeb Development: The Next Five Years
Web Development: The Next Five Yearssneeu
 
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRubyAmit Solanki
 
WordPress Performance & Scalability
WordPress Performance & ScalabilityWordPress Performance & Scalability
WordPress Performance & ScalabilityJoseph Scott
 
Node.js: CAMTA Presentation
Node.js: CAMTA PresentationNode.js: CAMTA Presentation
Node.js: CAMTA PresentationRob Tweed
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorialoscon2007
 
Flickr Architecture Presentation
Flickr Architecture PresentationFlickr Architecture Presentation
Flickr Architecture Presentationweb25
 
Samza portable runner for beam
Samza portable runner for beamSamza portable runner for beam
Samza portable runner for beamHai Lu
 
Messaging With Erlang And Jabber
Messaging With  Erlang And  JabberMessaging With  Erlang And  Jabber
Messaging With Erlang And Jabberl xf
 
Rails Conf Europe 2007 Notes
Rails Conf  Europe 2007  NotesRails Conf  Europe 2007  Notes
Rails Conf Europe 2007 NotesRoss Lawley
 
ruote stockholm 2008
ruote stockholm 2008ruote stockholm 2008
ruote stockholm 2008John Mettraux
 
Mashups with Drupal and QueryPath
Mashups with Drupal and QueryPathMashups with Drupal and QueryPath
Mashups with Drupal and QueryPathMatt Butcher
 

Similaire à Fast & Scalable Front/Back-ends using Ruby, Rails & XMPP (20)

Rest Vs Soap Yawn2289
Rest Vs Soap Yawn2289Rest Vs Soap Yawn2289
Rest Vs Soap Yawn2289
 
Microblogging via XMPP
Microblogging via XMPPMicroblogging via XMPP
Microblogging via XMPP
 
Qcon
QconQcon
Qcon
 
JSON-RPC Proxy Generation with PHP 5
JSON-RPC Proxy Generation with PHP 5JSON-RPC Proxy Generation with PHP 5
JSON-RPC Proxy Generation with PHP 5
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Rails
 
I35s
I35sI35s
I35s
 
ReST Vs SOA(P) ... Yawn
ReST Vs SOA(P) ... YawnReST Vs SOA(P) ... Yawn
ReST Vs SOA(P) ... Yawn
 
Rapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devicesRapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devices
 
Web Development: The Next Five Years
Web Development: The Next Five YearsWeb Development: The Next Five Years
Web Development: The Next Five Years
 
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRuby
 
WordPress Performance & Scalability
WordPress Performance & ScalabilityWordPress Performance & Scalability
WordPress Performance & Scalability
 
Node.js: CAMTA Presentation
Node.js: CAMTA PresentationNode.js: CAMTA Presentation
Node.js: CAMTA Presentation
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
 
Flickr Architecture Presentation
Flickr Architecture PresentationFlickr Architecture Presentation
Flickr Architecture Presentation
 
Samza portable runner for beam
Samza portable runner for beamSamza portable runner for beam
Samza portable runner for beam
 
Messaging With Erlang And Jabber
Messaging With  Erlang And  JabberMessaging With  Erlang And  Jabber
Messaging With Erlang And Jabber
 
Vidoop CouchDB Talk
Vidoop CouchDB TalkVidoop CouchDB Talk
Vidoop CouchDB Talk
 
Rails Conf Europe 2007 Notes
Rails Conf  Europe 2007  NotesRails Conf  Europe 2007  Notes
Rails Conf Europe 2007 Notes
 
ruote stockholm 2008
ruote stockholm 2008ruote stockholm 2008
ruote stockholm 2008
 
Mashups with Drupal and QueryPath
Mashups with Drupal and QueryPathMashups with Drupal and QueryPath
Mashups with Drupal and QueryPath
 

Dernier

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 

Dernier (20)

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 

Fast & Scalable Front/Back-ends using Ruby, Rails & XMPP

  • 1. Fast, Scalable Front/Back-end Services using Ruby, Rails and XMPP Pradeep Elankumaran pradeep@intridea.com twitter: @pradeep24
  • 2.
  • 3. What is XMPP? • eXtensible Messaging and Presence Protocol • Message-oriented middleware • XML-based • Various XMPP servers (eJabberd, Openfire, Tigase) • Most known for being the backend for IM systems • xmpp.org
  • 4. The GOOD • Open • Standardized by the IETF • Decentralized • Mature • Customizable • FAST!
  • 5. The BAD • XML is very verbose • Documentation is not outlined properly • though there are efforts to make this better • Lots of presence data overhead on larger networks • No unmodified binary data transfers
  • 6. A Simple XMPP Stanza JID resource <message from=’pradeep@xmpp.org/adium’ to=’zana@xmpp.org’> <body>This is a message</body> </message>
  • 7. Some XMPP Features • Presence • Instant Messaging • Publish/Subscribe • Multi-User Chat • Federation • Personal Eventing, and many more...
  • 9. Publish/Subscribe <iq type=’set’ to=’pubsub.xmpp.org’ from=’me@xmpp.org’> <pubsub xmlns=’http://jabber.org/protocol/pubsub’> <publish node=’apples’> <item>Fuji Apples</item> node name the pubsub namespace </publish> </pubsub> </iq> subscriber subscriber subscriber
  • 10. Publish / Subscribe • Federated Microblogging using the Personal Eventing Protocol (PEP) • Real-time search • Real-time topic-tracking via multiple communication channels (RSS, IM etc.) • Real-time collaborative editing
  • 11. Real-time User Interfaces • BOSH • Robust, lively interfaces for daily use • Javascript-based XMPP clients • Handlers attached to various XMPP stanzas • Present.ly, drop.io
  • 13. XMPP4R •gem install ln-xmpp4r • very full-featured • threaded, event-based • BAD: a lack of documentation, steep learning curve • Interfacing with Rails app requires an external daemon
  • 14. strophe-ruby • gem install yong-stropheruby • based off libstrophe, a C library • event-based • can be run within a Rails app with proper timeouts and exception handling • new release soon • LOOKING FOR CONTRIBUTORS!
  • 16. BOSH • Bi-directional streams Over Synchronous HTTP • This is not COMET, which requires a single persistent connection • Session persists over multiple connections • Full-formed HTTP requests, so works with most proxies
  • 17. BOSH client <body/>, session BOSH connection no <body/> manager XMPP server
  • 18. Strophe • Excellent Javascript BOSH client • written by Jack Moffit (metajack.im) • written for Chesspark • used in production at Present.ly • very, very awesome.
  • 19. Strophe connection = new Strophe.Connection(“/http-bind”); connection.connect(“pradeep@xmpp.org”, “password”, onConnect); // this calls onMessage for each <message/> stanza connection.addHandler(onMessage, null, ‘message’, null, null, null); // this calls onPubsubEvent every time there’s a message // from a PubSub node connection.addHandler(onPubsubEvent, 'http://jabber.org/protocol/pubsub#event', 'message', null, null, null);
  • 21. Present.ly (before) Client jQuery, polling Rails Custom Index DB Supporting Daemons
  • 23. Present.ly (now) BOS H, st Client rophe- js BOSH connection manager Rails str op he -ru by eJabberd DB Supporting Daemons
  • 26. XMPP Servers • eJabberd • written in Erlang, highly scalable, actively maintained • runs in production on Present.ly, Chesspark • Jabberd2 • written in C, actively maintained • Tigase • written in Java, actively maintained • runs in production on Seesmic • Openfire • written in Java, actively maintained • large community, lots of plugins. good for basic XMPP apps • Prosody • written in Lua, very new, claims to be lightweight
  • 27. Questions? pradeep@intridea.com twitter: @pradeep24 http://www.skyfallsin.com

Notes de l'éditeur