SlideShare a Scribd company logo
websocket on ruby
oneplaylist.fm beta use case
The Stack
• ruby on rails
• redis
• ruby-eventmachine
• HA-Proxy
Other on Stack
• Resque: background processing in rails
• mongodb
• coffeescript js heavy
• elasticsearch (tire ruby gem)
HA-Proxy
• tcp level load balancer
• handle http level too
• super fast, and so on.....
• high availaibility made easy
HA-Proxy stack
• HA-Proxy -> 3 ruby on rails front
• HA-Proxy -> 3 elasticsearch instance
(direct from coffee)
• HA-Proxy -> event-machine tcp level
websocket
HA-Proxy websocket
• http://oneplaylist.fm -> app
• http://oneplaylist.fm/websocket -> tcp event
machine !!
• same ip, same domain, sub path !!!!
Redis and websocket ?
• handle stateless auth -> pass a token each
request pass from front
• redis is a central point of communication:
super fast and performant
• PUB SUB ! -> push to websocket
Redis and websocket
• each token -> a user id
• after authenticate, the eventmachine tcp
session register to redis pub pipe with key
user id
• all message to user from rails -> pub redis
key -> eventmachine redis -> websocket /
browser in real time of course
Rails -> redis
• Rails app write data in redis key before
pushing
• when user reconnect -> eventmachine
make a get on key and push back to
browser
• some part of app are render only with
webscoket data -> better consistency
more infos
• http://oneplaylist.fm
• https://twitter.com/mathieuel
• http://www.mathieu-elie.net

More Related Content

What's hot (17)

PDF
faastRuby - Building a FaaS platform with Redis (RedisConf19)
Paulo Arruda
 
PPTX
Evented Ruby VS Node.js
Nitin Gupta
 
PDF
The art of concurrent programming
Iskren Chernev
 
PDF
Windows IOCP vs Linux EPOLL Performance Comparison
Seungmo Koo
 
PDF
Fluentd v0.14 Overview
N Masahiro
 
PDF
Fluentd Meetup 2016 - ServerEngine Integration & Windows support
Ritta Narita
 
PPTX
HTTP::Parser::XS - writing a fast & secure XS module
Kazuho Oku
 
PPTX
fsharp goodness for everyday work
Uladzimir Shchur
 
PPT
Epoll - from the kernel side
llj098
 
PPTX
gen_udp and gen_tcp in Elixir
Tomáš Koutský
 
ODP
JRuby - Everything in a single process
ocher
 
PPTX
Basics of Node.js
Alper Unal
 
PDF
Rust with-kafka-07-02-2019
Gerard Klijs
 
PPTX
MongoDB backup service overview Boston MUG
MongoDB
 
PPT
Ruby On Google App Engine 2nd Athens Ruby Me
Panagiotis Papadopoulos
 
PDF
美团点评技术沙龙08 - 分布式监控系统实践
美团点评技术团队
 
PDF
Rails hosting
wonko
 
faastRuby - Building a FaaS platform with Redis (RedisConf19)
Paulo Arruda
 
Evented Ruby VS Node.js
Nitin Gupta
 
The art of concurrent programming
Iskren Chernev
 
Windows IOCP vs Linux EPOLL Performance Comparison
Seungmo Koo
 
Fluentd v0.14 Overview
N Masahiro
 
Fluentd Meetup 2016 - ServerEngine Integration & Windows support
Ritta Narita
 
HTTP::Parser::XS - writing a fast & secure XS module
Kazuho Oku
 
fsharp goodness for everyday work
Uladzimir Shchur
 
Epoll - from the kernel side
llj098
 
gen_udp and gen_tcp in Elixir
Tomáš Koutský
 
JRuby - Everything in a single process
ocher
 
Basics of Node.js
Alper Unal
 
Rust with-kafka-07-02-2019
Gerard Klijs
 
MongoDB backup service overview Boston MUG
MongoDB
 
Ruby On Google App Engine 2nd Athens Ruby Me
Panagiotis Papadopoulos
 
美团点评技术沙龙08 - 分布式监控系统实践
美团点评技术团队
 
Rails hosting
wonko
 

Similar to ruby + websocket + haproxy (20)

PPTX
Pune Ruby Meetup - November 2015
Amura Marketing Technologies Pvt. Ltd.
 
PDF
Timeless - Websocket on Rails
Framgia Vietnam
 
PDF
Let's Get Real (time): Server-Sent Events, WebSockets and WebRTC for the soul
Swanand Pagnis
 
PDF
Asynchronous Ruby
Anton Mishchuk
 
PDF
Websocket on Rails
Jeroen Rosenberg
 
PDF
WebSocket For Web Rubyists
Mu-Fan Teng
 
PPTX
Training Webinar: Enterprise application performance with server push technol...
OutSystems
 
PPTX
Realtime web experience with signal r
Ran Wahle
 
PDF
Real time web apps
Sepehr Rasouli
 
PPTX
Real time websites and mobile apps with SignalR
Roy Cornelissen
 
PDF
Real-Time with Flowdock
Flowdock
 
PDF
Websockets, Ruby y Pusher Webprendedor 2010
Ismael Celis
 
PPTX
Azure signalR & Real time web application
Microsoft
 
PDF
Ruby HTTP clients comparison
Hiroshi Nakamura
 
PDF
SignalR: Add real-time to your applications
Eugene Zharkov
 
PPTX
Real-time Communication using SignalR and cloud
Radu Vunvulea
 
PPTX
Messaging for Real-time WebApps
Tiju John
 
PDF
Dev con kolkata 2012 websockets
SANKARSAN BOSE
 
PDF
Sockets and rails
Shrikanth Rajarajan
 
PPTX
Brushing skills on SignalR for ASP.NET developers
ONE BCG
 
Pune Ruby Meetup - November 2015
Amura Marketing Technologies Pvt. Ltd.
 
Timeless - Websocket on Rails
Framgia Vietnam
 
Let's Get Real (time): Server-Sent Events, WebSockets and WebRTC for the soul
Swanand Pagnis
 
Asynchronous Ruby
Anton Mishchuk
 
Websocket on Rails
Jeroen Rosenberg
 
WebSocket For Web Rubyists
Mu-Fan Teng
 
Training Webinar: Enterprise application performance with server push technol...
OutSystems
 
Realtime web experience with signal r
Ran Wahle
 
Real time web apps
Sepehr Rasouli
 
Real time websites and mobile apps with SignalR
Roy Cornelissen
 
Real-Time with Flowdock
Flowdock
 
Websockets, Ruby y Pusher Webprendedor 2010
Ismael Celis
 
Azure signalR & Real time web application
Microsoft
 
Ruby HTTP clients comparison
Hiroshi Nakamura
 
SignalR: Add real-time to your applications
Eugene Zharkov
 
Real-time Communication using SignalR and cloud
Radu Vunvulea
 
Messaging for Real-time WebApps
Tiju John
 
Dev con kolkata 2012 websockets
SANKARSAN BOSE
 
Sockets and rails
Shrikanth Rajarajan
 
Brushing skills on SignalR for ASP.NET developers
ONE BCG
 
Ad

More from Mathieu Elie (6)

PPTX
Elasticsearch 5.0 les nouveautés
Mathieu Elie
 
PDF
Data Visualization on the Tech Side
Mathieu Elie
 
PDF
elasticsearch basics workshop
Mathieu Elie
 
PDF
dataviz on d3.js + elasticsearch
Mathieu Elie
 
PDF
Html6 forgotten in html5
Mathieu Elie
 
PPT
Data vizualisation: d3.js + sinatra + elasticsearch
Mathieu Elie
 
Elasticsearch 5.0 les nouveautés
Mathieu Elie
 
Data Visualization on the Tech Side
Mathieu Elie
 
elasticsearch basics workshop
Mathieu Elie
 
dataviz on d3.js + elasticsearch
Mathieu Elie
 
Html6 forgotten in html5
Mathieu Elie
 
Data vizualisation: d3.js + sinatra + elasticsearch
Mathieu Elie
 
Ad

Recently uploaded (20)

PDF
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
PPTX
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Meetup Kickoff & Welcome - Rohit Yadav, CSIUG Chairman
ShapeBlue
 
PPTX
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
PDF
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
PDF
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Women in Automation Presents: Reinventing Yourself — Bold Career Pivots That ...
DianaGray10
 
PDF
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
PDF
CloudStack GPU Integration - Rohit Yadav
ShapeBlue
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
PDF
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Meetup Kickoff & Welcome - Rohit Yadav, CSIUG Chairman
ShapeBlue
 
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Women in Automation Presents: Reinventing Yourself — Bold Career Pivots That ...
DianaGray10
 
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
CloudStack GPU Integration - Rohit Yadav
ShapeBlue
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 

ruby + websocket + haproxy