SlideShare a Scribd company logo
1 of 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

More Related Content

What's hot

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
 

What's hot (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
 

Viewers also liked

Viewers also liked (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
 

Similar to 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
 

Similar to 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
 

Recently uploaded

"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
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
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
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
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
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 

Recently uploaded (20)

"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 ...
 
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...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
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
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

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

Editor's Notes