SlideShare a Scribd company logo
The State of WebSockets in Django
Rami Sayar - @ramisayar
Technical Evangelist
Microsoft Canada
Agenda
•  Where is WebSockets right now?
•  Where is Socket.IO?
•  Where does Django fit in?
•  Using Django SwampDragon.
•  Using Gevent.
CONFOO - @RAMISAYAR
Assumptions
•  Working knowledge of Django, JavaScript & Python.
Note: Slides will be made available.
CONFOO - @RAMISAYAR
What is a production web app?
•  Django is surrounded by tons
of applications, services and
code in production.
•  Advanced Django architecture
is needed to support Django
in production without failing
hard.
•  WebSockets falls apart from
the rest.
CONFOO - @RAMISAYAR
WebSockets
•  “WebSocket is a protocol for
full-duplex communication
channels over a single TCP
connection.” Wikipedia
•  Image Reference
CONFOO - @RAMISAYAR
WebSockets
CONFOO - @RAMISAYAR
Socket.IO
•  “Socket.IO enables real-time
bidirectional event-based
communication. It works on
every platform, browser or
device, focusing equally on
reliability and speed.”
Reference
•  Use by everyone: Microsoft
Office, Yammer, Zendesk,
Trello, etc…
CONFOO - @RAMISAYAR
Socket.IO Version 1.0 is here!
Technically, now at v1.3.4
CONFOO - @RAMISAYAR
Python, Django & WebSockets.
CONFOO - @RAMISAYAR
Python and WebSockets
•  Python and WebSockets has notoriously been very difficult.
•  Two reasons:
•  WSGI protocol does not support WebSockets. Most popular form of
web request handling in the Python web apps. Most frameworks are
designed for use with FastCGI or mod_wsgi, etc.
•  Default Python networked apps not exactly designed for event-based
communication, you have to use things like gevent and twisted/tornado.
CONFOO - @RAMISAYAR
Django & WebSockets
•  Django applications complete HttpResponses.
•  Django not well suited for WebSocket event handling structure
nor the channel approach in Socket.IO.
CONFOO - @RAMISAYAR
Presenting 3 Methods for WebSockets in Django
CONFOO - @RAMISAYAR
gevent
•  “gevent is a coroutine-based Python networking library that
uses greenlets to provide a synchronous API on top of the libev
event loop.”
•  Event loop based on libev (same as Node.js)
•  Lightweight execution units, a.k.a. “lightweight threads”.
•  Cooperative sockets with SSL support.
•  Similar programming model to Node.js.
CONFOO - @RAMISAYAR
gevent-socketio
•  gevent-socketio is a pure Python implementation of the
Socket.IO protocol. Basically, it is a port of Socket.IO and
typically behind in major releases.
•  Designed to work with multiple different WSGI-based web
frameworks.
•  Handles the “WSGI” problem by providing a custom gevent
WSGI server for use with gevent-socketio.
•  Only dependencies are gevent.
•  Imperfect solution: Django is still blocking (monkey
patching is not perfect).
CONFOO - @RAMISAYAR
Demo 1: Django chat engine with gevent-socketio
https://github.com/abourget/gevent-socketio/tree/master/examples/
django_chat
CONFOO - @RAMISAYAR
“Native” Django Implementation
•  Previous approach requires significant modifications to your
current Django app serving stack. Native as in you don’t need to
know anything besides Django.
•  Building an implementation of WebSockets on top of Django.
•  Identified two problems for WebSockets in Django:
•  Problems with WSGI still present EXCEPT in uWSGI.
•  Networked event handling model is problematic.
•  Solution:
•  Use Nginx which follows – event-driven async architecture.
•  uWSGI & Gevent for event handling.
CONFOO - @RAMISAYAR
Django-WebSocket-Redis
•  Module implements websockets on top of Django.
•  Use Redis as a data store for messaging behind uWSGI and Nginx.
•  Runs a separate Django main loop in a cooperative concurrency
model using gevent -> 1 thread for all open websockets.
•  Django can be started as usual with ‘./manage.py runserver’.
•  Normal requests communication with separate main (websocket)
loop through Redis.
•  Read:
Offloading Websockets and Server-Sent Events AKA “Combine
them with Django safely”
CONFOO - @RAMISAYAR
Demo 2: Django-WebSockets-Redis
https://github.com/jrief/django-websocket-redis
CONFOO - @RAMISAYAR
SwampDragon
•  New project that adds websocket support
•  Self-publishing models
•  Django ORM Style Data Filter for Subscription Channels –
Similar to WebSockets + Data Filter
•  Relies on Redis for messaging + Tornado
•  Angular JS Support
CONFOO - @RAMISAYAR
Demo 3: Django Swampdragon
https://github.com/jonashagstedt/swampdragon
CONFOO - @RAMISAYAR
On Redis
•  Redis is extremely popular as an easy and simple publish-
subscribe.
•  Redis is very particular about memory. Running out of memory
in Redis -> CRASH AND BURN!
•  If you don’t have enough memory in your VM to run Redis
Cache -> Change your approach, use Apache Kafka.
CONFOO - @RAMISAYAR
What did we learn?
•  The State of WebSockets in Django.
•  Django and WebSockets is not impossible.
CONFOO - @RAMISAYAR
Thank You! Questions?
Follow @ramisayar
CONFOO - @RAMISAYAR
Resources
•  http://swampdragon.net/
•  http://django-websocket-redis.readthedocs.org/en/latest/
•  https://github.com/jrief/django-websocket-redis
•  https://github.com/abourget/gevent-socketio/tree/master/
examples/django_chat
•  http://jpadilla.com/post/74391616727/the-easiest-way-to-add-
websockets-to-django
•  http://ferretfarmer.net/2013/09/05/tutorial-real-time-chat-with-
django-twisted-and-websockets-part-1/
CONFOO - @RAMISAYAR
©2013	
  Microso-	
  Corpora1on.	
  All	
  rights	
  reserved.	
  Microso-,	
  Windows,	
  Office,	
  Azure,	
  System	
  Center,	
  Dynamics	
  and	
  other	
  product	
  names	
  are	
  or	
  may	
  be	
  registered	
  trademarks	
  and/or	
  trademarks	
  in	
  the	
  
U.S.	
  and/or	
  other	
  countries.	
  The	
  informa1on	
  herein	
  is	
  for	
  informa1onal	
  purposes	
  only	
  and	
  represents	
  the	
  current	
  view	
  of	
  Microso-	
  Corpora1on	
  as	
  of	
  the	
  date	
  of	
  this	
  presenta1on.	
  Because	
  Microso-	
  
must	
  respond	
  to	
  changing	
  market	
  condi1ons,	
  it	
  should	
  not	
  be	
  interpreted	
  to	
  be	
  a	
  commitment	
  on	
  the	
  part	
  of	
  Microso-,	
  and	
  Microso-	
  cannot	
  guarantee	
  the	
  accuracy	
  of	
  any	
  informa1on	
  provided	
  a-er	
  
the	
  date	
  of	
  this	
  presenta1on.	
  MICROSOFT	
  MAKES	
  NO	
  WARRANTIES,	
  EXPRESS,	
  IMPLIED	
  OR	
  STATUTORY,	
  AS	
  TO	
  THE	
  INFORMATION	
  IN	
  THIS	
  PRESENTATION.	
  
Ad

More Related Content

What's hot (20)

Webinar - Matteo Manchi: Dal web al nativo: Introduzione a React Native
Webinar - Matteo Manchi: Dal web al nativo: Introduzione a React Native Webinar - Matteo Manchi: Dal web al nativo: Introduzione a React Native
Webinar - Matteo Manchi: Dal web al nativo: Introduzione a React Native
Codemotion
 
Mini-Training: Redis
Mini-Training: RedisMini-Training: Redis
Mini-Training: Redis
Betclic Everest Group Tech Team
 
Mobile Library Development - stuck between a pod and a jar file - Zan Markan ...
Mobile Library Development - stuck between a pod and a jar file - Zan Markan ...Mobile Library Development - stuck between a pod and a jar file - Zan Markan ...
Mobile Library Development - stuck between a pod and a jar file - Zan Markan ...
Codemotion
 
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Demi Ben-Ari
 
Масштабируя TLS / Артём Гавриченков (Qrator Labs)
Масштабируя TLS / Артём Гавриченков (Qrator Labs)Масштабируя TLS / Артём Гавриченков (Qrator Labs)
Масштабируя TLS / Артём Гавриченков (Qrator Labs)
Ontico
 
Web frameworks don't matter
Web frameworks don't matterWeb frameworks don't matter
Web frameworks don't matter
Tomas Doran
 
Cloudstack China User Group Report
Cloudstack China User Group ReportCloudstack China User Group Report
Cloudstack China User Group Report
gavin_lee
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
Matthew Groves
 
Dcjq node.js presentation
Dcjq node.js presentationDcjq node.js presentation
Dcjq node.js presentation
async_io
 
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
Chris Gates
 
Gabriele Provinciali/Gabriele Folchi/Luca Postacchini - Sviluppo con piattafo...
Gabriele Provinciali/Gabriele Folchi/Luca Postacchini - Sviluppo con piattafo...Gabriele Provinciali/Gabriele Folchi/Luca Postacchini - Sviluppo con piattafo...
Gabriele Provinciali/Gabriele Folchi/Luca Postacchini - Sviluppo con piattafo...
Codemotion
 
JavaOne 2014 Security Testing for Developers using OWASP ZAP
JavaOne 2014 Security Testing for Developers using OWASP ZAPJavaOne 2014 Security Testing for Developers using OWASP ZAP
JavaOne 2014 Security Testing for Developers using OWASP ZAP
Simon Bennetts
 
OWASP 2014 AppSec EU ZAP Advanced Features
OWASP 2014 AppSec EU ZAP Advanced FeaturesOWASP 2014 AppSec EU ZAP Advanced Features
OWASP 2014 AppSec EU ZAP Advanced Features
Simon Bennetts
 
OWASP 2013 APPSEC USA Talk - OWASP ZAP
OWASP 2013 APPSEC USA Talk - OWASP ZAPOWASP 2013 APPSEC USA Talk - OWASP ZAP
OWASP 2013 APPSEC USA Talk - OWASP ZAP
Simon Bennetts
 
RSYSLOG v8 improvements and how to write plugins in any language.
RSYSLOG v8 improvements and how to write plugins in any language.RSYSLOG v8 improvements and how to write plugins in any language.
RSYSLOG v8 improvements and how to write plugins in any language.
Rainer Gerhards
 
Dimitri Bellini and Pietro Antonacci - Manage Zabbix Proxies in Remote Networ...
Dimitri Bellini and Pietro Antonacci - Manage Zabbix Proxies in Remote Networ...Dimitri Bellini and Pietro Antonacci - Manage Zabbix Proxies in Remote Networ...
Dimitri Bellini and Pietro Antonacci - Manage Zabbix Proxies in Remote Networ...
Zabbix
 
OWASP 2013 AppSec EU Hamburg - ZAP Innovations
OWASP 2013 AppSec EU Hamburg - ZAP InnovationsOWASP 2013 AppSec EU Hamburg - ZAP Innovations
OWASP 2013 AppSec EU Hamburg - ZAP Innovations
Simon Bennetts
 
Dev objective2015 lets git together
Dev objective2015 lets git togetherDev objective2015 lets git together
Dev objective2015 lets git together
ColdFusionConference
 
Automating OWASP ZAP - DevCSecCon talk
Automating OWASP ZAP - DevCSecCon talk Automating OWASP ZAP - DevCSecCon talk
Automating OWASP ZAP - DevCSecCon talk
Simon Bennetts
 
OWASP 2012 AppSec Dublin ZAP Intro
OWASP 2012 AppSec Dublin ZAP IntroOWASP 2012 AppSec Dublin ZAP Intro
OWASP 2012 AppSec Dublin ZAP Intro
Simon Bennetts
 
Webinar - Matteo Manchi: Dal web al nativo: Introduzione a React Native
Webinar - Matteo Manchi: Dal web al nativo: Introduzione a React Native Webinar - Matteo Manchi: Dal web al nativo: Introduzione a React Native
Webinar - Matteo Manchi: Dal web al nativo: Introduzione a React Native
Codemotion
 
Mobile Library Development - stuck between a pod and a jar file - Zan Markan ...
Mobile Library Development - stuck between a pod and a jar file - Zan Markan ...Mobile Library Development - stuck between a pod and a jar file - Zan Markan ...
Mobile Library Development - stuck between a pod and a jar file - Zan Markan ...
Codemotion
 
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Demi Ben-Ari
 
Масштабируя TLS / Артём Гавриченков (Qrator Labs)
Масштабируя TLS / Артём Гавриченков (Qrator Labs)Масштабируя TLS / Артём Гавриченков (Qrator Labs)
Масштабируя TLS / Артём Гавриченков (Qrator Labs)
Ontico
 
Web frameworks don't matter
Web frameworks don't matterWeb frameworks don't matter
Web frameworks don't matter
Tomas Doran
 
Cloudstack China User Group Report
Cloudstack China User Group ReportCloudstack China User Group Report
Cloudstack China User Group Report
gavin_lee
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
Matthew Groves
 
Dcjq node.js presentation
Dcjq node.js presentationDcjq node.js presentation
Dcjq node.js presentation
async_io
 
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016DevOops Redux Ken Johnson Chris Gates  - AppSec USA 2016
DevOops Redux Ken Johnson Chris Gates - AppSec USA 2016
Chris Gates
 
Gabriele Provinciali/Gabriele Folchi/Luca Postacchini - Sviluppo con piattafo...
Gabriele Provinciali/Gabriele Folchi/Luca Postacchini - Sviluppo con piattafo...Gabriele Provinciali/Gabriele Folchi/Luca Postacchini - Sviluppo con piattafo...
Gabriele Provinciali/Gabriele Folchi/Luca Postacchini - Sviluppo con piattafo...
Codemotion
 
JavaOne 2014 Security Testing for Developers using OWASP ZAP
JavaOne 2014 Security Testing for Developers using OWASP ZAPJavaOne 2014 Security Testing for Developers using OWASP ZAP
JavaOne 2014 Security Testing for Developers using OWASP ZAP
Simon Bennetts
 
OWASP 2014 AppSec EU ZAP Advanced Features
OWASP 2014 AppSec EU ZAP Advanced FeaturesOWASP 2014 AppSec EU ZAP Advanced Features
OWASP 2014 AppSec EU ZAP Advanced Features
Simon Bennetts
 
OWASP 2013 APPSEC USA Talk - OWASP ZAP
OWASP 2013 APPSEC USA Talk - OWASP ZAPOWASP 2013 APPSEC USA Talk - OWASP ZAP
OWASP 2013 APPSEC USA Talk - OWASP ZAP
Simon Bennetts
 
RSYSLOG v8 improvements and how to write plugins in any language.
RSYSLOG v8 improvements and how to write plugins in any language.RSYSLOG v8 improvements and how to write plugins in any language.
RSYSLOG v8 improvements and how to write plugins in any language.
Rainer Gerhards
 
Dimitri Bellini and Pietro Antonacci - Manage Zabbix Proxies in Remote Networ...
Dimitri Bellini and Pietro Antonacci - Manage Zabbix Proxies in Remote Networ...Dimitri Bellini and Pietro Antonacci - Manage Zabbix Proxies in Remote Networ...
Dimitri Bellini and Pietro Antonacci - Manage Zabbix Proxies in Remote Networ...
Zabbix
 
OWASP 2013 AppSec EU Hamburg - ZAP Innovations
OWASP 2013 AppSec EU Hamburg - ZAP InnovationsOWASP 2013 AppSec EU Hamburg - ZAP Innovations
OWASP 2013 AppSec EU Hamburg - ZAP Innovations
Simon Bennetts
 
Dev objective2015 lets git together
Dev objective2015 lets git togetherDev objective2015 lets git together
Dev objective2015 lets git together
ColdFusionConference
 
Automating OWASP ZAP - DevCSecCon talk
Automating OWASP ZAP - DevCSecCon talk Automating OWASP ZAP - DevCSecCon talk
Automating OWASP ZAP - DevCSecCon talk
Simon Bennetts
 
OWASP 2012 AppSec Dublin ZAP Intro
OWASP 2012 AppSec Dublin ZAP IntroOWASP 2012 AppSec Dublin ZAP Intro
OWASP 2012 AppSec Dublin ZAP Intro
Simon Bennetts
 

Viewers also liked (20)

JVM Garbage Collection Tuning
JVM Garbage Collection TuningJVM Garbage Collection Tuning
JVM Garbage Collection Tuning
ihji
 
Websockets: Pushing the web forward
Websockets: Pushing the web forwardWebsockets: Pushing the web forward
Websockets: Pushing the web forward
Mark Roden
 
Reducing load with RabbitMQ
Reducing load with RabbitMQReducing load with RabbitMQ
Reducing load with RabbitMQ
Povilas Balzaravičius
 
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
Frank Munz
 
Maximize information exchange in your enterprise with AMQP
Maximize information exchange in your enterprise with AMQPMaximize information exchange in your enterprise with AMQP
Maximize information exchange in your enterprise with AMQP
Kenneth Peeples
 
HTTP Status Codes Cheat Sheet: An Exhaustive List
HTTP Status Codes Cheat Sheet: An Exhaustive ListHTTP Status Codes Cheat Sheet: An Exhaustive List
HTTP Status Codes Cheat Sheet: An Exhaustive List
Mainstreethost
 
HTTP/2 Changes Everything
HTTP/2 Changes EverythingHTTP/2 Changes Everything
HTTP/2 Changes Everything
Lori MacVittie
 
HTML5 WebSockets in Python/Django
HTML5 WebSockets in Python/DjangoHTML5 WebSockets in Python/Django
HTML5 WebSockets in Python/Django
Tony Abou-Assaleh
 
Real-time Web Application with Socket.IO, Node.js, and Redis
Real-time Web Application with Socket.IO, Node.js, and RedisReal-time Web Application with Socket.IO, Node.js, and Redis
Real-time Web Application with Socket.IO, Node.js, and Redis
York Tsai
 
What's New in ES6 for Web Devs
What's New in ES6 for Web DevsWhat's New in ES6 for Web Devs
What's New in ES6 for Web Devs
Rami Sayar
 
Real time web_apps_pycon2012-v1
Real time web_apps_pycon2012-v1Real time web_apps_pycon2012-v1
Real time web_apps_pycon2012-v1
Avinash Prasad
 
PyConMY 2016 Django Channels
PyConMY 2016 Django ChannelsPyConMY 2016 Django Channels
PyConMY 2016 Django Channels
Kok Hoor Chew
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
Rami Sayar
 
FITC - Bootstrap Unleashed
FITC - Bootstrap UnleashedFITC - Bootstrap Unleashed
FITC - Bootstrap Unleashed
Rami Sayar
 
Redis : Database, cache, pub/sub and more at Jelly button games
Redis : Database, cache, pub/sub and more at Jelly button gamesRedis : Database, cache, pub/sub and more at Jelly button games
Redis : Database, cache, pub/sub and more at Jelly button games
Redis Labs
 
Hacking websockets
Hacking websocketsHacking websockets
Hacking websockets
Tomek Cejner
 
laravel websocket(use redis pubsub) [Laravel meetup tokyo]
laravel websocket(use redis pubsub) [Laravel meetup tokyo]laravel websocket(use redis pubsub) [Laravel meetup tokyo]
laravel websocket(use redis pubsub) [Laravel meetup tokyo]
Yuuki Takezawa
 
Implementation of RSA Algorithm for Speech Data Encryption and Decryption
Implementation of RSA Algorithm for Speech Data Encryption and DecryptionImplementation of RSA Algorithm for Speech Data Encryption and Decryption
Implementation of RSA Algorithm for Speech Data Encryption and Decryption
Md. Ariful Hoque
 
Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial
之宇 趙
 
Django Celery
Django Celery Django Celery
Django Celery
Mat Clayton
 
JVM Garbage Collection Tuning
JVM Garbage Collection TuningJVM Garbage Collection Tuning
JVM Garbage Collection Tuning
ihji
 
Websockets: Pushing the web forward
Websockets: Pushing the web forwardWebsockets: Pushing the web forward
Websockets: Pushing the web forward
Mark Roden
 
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...What You Should Know About WebLogic Server 12c (12.2.1.2)  #oow2015 #otntour2...
What You Should Know About WebLogic Server 12c (12.2.1.2) #oow2015 #otntour2...
Frank Munz
 
Maximize information exchange in your enterprise with AMQP
Maximize information exchange in your enterprise with AMQPMaximize information exchange in your enterprise with AMQP
Maximize information exchange in your enterprise with AMQP
Kenneth Peeples
 
HTTP Status Codes Cheat Sheet: An Exhaustive List
HTTP Status Codes Cheat Sheet: An Exhaustive ListHTTP Status Codes Cheat Sheet: An Exhaustive List
HTTP Status Codes Cheat Sheet: An Exhaustive List
Mainstreethost
 
HTTP/2 Changes Everything
HTTP/2 Changes EverythingHTTP/2 Changes Everything
HTTP/2 Changes Everything
Lori MacVittie
 
HTML5 WebSockets in Python/Django
HTML5 WebSockets in Python/DjangoHTML5 WebSockets in Python/Django
HTML5 WebSockets in Python/Django
Tony Abou-Assaleh
 
Real-time Web Application with Socket.IO, Node.js, and Redis
Real-time Web Application with Socket.IO, Node.js, and RedisReal-time Web Application with Socket.IO, Node.js, and Redis
Real-time Web Application with Socket.IO, Node.js, and Redis
York Tsai
 
What's New in ES6 for Web Devs
What's New in ES6 for Web DevsWhat's New in ES6 for Web Devs
What's New in ES6 for Web Devs
Rami Sayar
 
Real time web_apps_pycon2012-v1
Real time web_apps_pycon2012-v1Real time web_apps_pycon2012-v1
Real time web_apps_pycon2012-v1
Avinash Prasad
 
PyConMY 2016 Django Channels
PyConMY 2016 Django ChannelsPyConMY 2016 Django Channels
PyConMY 2016 Django Channels
Kok Hoor Chew
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
Rami Sayar
 
FITC - Bootstrap Unleashed
FITC - Bootstrap UnleashedFITC - Bootstrap Unleashed
FITC - Bootstrap Unleashed
Rami Sayar
 
Redis : Database, cache, pub/sub and more at Jelly button games
Redis : Database, cache, pub/sub and more at Jelly button gamesRedis : Database, cache, pub/sub and more at Jelly button games
Redis : Database, cache, pub/sub and more at Jelly button games
Redis Labs
 
Hacking websockets
Hacking websocketsHacking websockets
Hacking websockets
Tomek Cejner
 
laravel websocket(use redis pubsub) [Laravel meetup tokyo]
laravel websocket(use redis pubsub) [Laravel meetup tokyo]laravel websocket(use redis pubsub) [Laravel meetup tokyo]
laravel websocket(use redis pubsub) [Laravel meetup tokyo]
Yuuki Takezawa
 
Implementation of RSA Algorithm for Speech Data Encryption and Decryption
Implementation of RSA Algorithm for Speech Data Encryption and DecryptionImplementation of RSA Algorithm for Speech Data Encryption and Decryption
Implementation of RSA Algorithm for Speech Data Encryption and Decryption
Md. Ariful Hoque
 
Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial
之宇 趙
 
Ad

Similar to The State of WebSockets in Django (20)

Scalable Django Architecture
Scalable Django ArchitectureScalable Django Architecture
Scalable Django Architecture
Rami Sayar
 
Realtime rocks
Realtime rocksRealtime rocks
Realtime rocks
Vanbosse
 
Realtime web2012
Realtime web2012Realtime web2012
Realtime web2012
Timothy Fitz
 
Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18
Pierre Joye
 
Python Web Framework – A Detailed List of Web Frameworks in Python
Python Web Framework – A Detailed List of Web Frameworks in PythonPython Web Framework – A Detailed List of Web Frameworks in Python
Python Web Framework – A Detailed List of Web Frameworks in Python
abhishekdf3
 
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoTWebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
Frank Greco
 
End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013
Alexandre Morgaut
 
Laug Mootools And Common Js
Laug   Mootools And Common JsLaug   Mootools And Common Js
Laug Mootools And Common Js
Skills Matter
 
Web Frameworks of the Future
Web Frameworks of the FutureWeb Frameworks of the Future
Web Frameworks of the Future
elliando dias
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
Kasey McCurdy
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
Guillaume Laforge
 
Not Only Streams for Akademia JLabs
Not Only Streams for Akademia JLabsNot Only Streams for Akademia JLabs
Not Only Streams for Akademia JLabs
Konrad Malawski
 
Node
NodeNode
Node
Timothy Strimple
 
Django
DjangoDjango
Django
Momentum Design Lab
 
Stackato v3
Stackato v3Stackato v3
Stackato v3
Jonas Brømsø
 
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There TodayHTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
davyjones
 
NodeJS and what is actually does
NodeJS and what is actually doesNodeJS and what is actually does
NodeJS and what is actually does
Victor Reyes Heitmann
 
Splunking the JVM
Splunking the JVMSplunking the JVM
Splunking the JVM
Damien Dallimore
 
Janus Workshop @ ClueCon 2020
Janus Workshop @ ClueCon 2020Janus Workshop @ ClueCon 2020
Janus Workshop @ ClueCon 2020
Lorenzo Miniero
 
Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Django, What is it, Why is it cool?
Django, What is it, Why is it cool?
Tom Brander
 
Scalable Django Architecture
Scalable Django ArchitectureScalable Django Architecture
Scalable Django Architecture
Rami Sayar
 
Realtime rocks
Realtime rocksRealtime rocks
Realtime rocks
Vanbosse
 
Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18
Pierre Joye
 
Python Web Framework – A Detailed List of Web Frameworks in Python
Python Web Framework – A Detailed List of Web Frameworks in PythonPython Web Framework – A Detailed List of Web Frameworks in Python
Python Web Framework – A Detailed List of Web Frameworks in Python
abhishekdf3
 
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoTWebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
WebSocket Perspectives 2015 - Clouds, Streams, Microservices and WoT
Frank Greco
 
End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013
Alexandre Morgaut
 
Laug Mootools And Common Js
Laug   Mootools And Common JsLaug   Mootools And Common Js
Laug Mootools And Common Js
Skills Matter
 
Web Frameworks of the Future
Web Frameworks of the FutureWeb Frameworks of the Future
Web Frameworks of the Future
elliando dias
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
Kasey McCurdy
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
Guillaume Laforge
 
Not Only Streams for Akademia JLabs
Not Only Streams for Akademia JLabsNot Only Streams for Akademia JLabs
Not Only Streams for Akademia JLabs
Konrad Malawski
 
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There TodayHTML5 is the Future of Mobile, PhoneGap Takes You There Today
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
davyjones
 
Janus Workshop @ ClueCon 2020
Janus Workshop @ ClueCon 2020Janus Workshop @ ClueCon 2020
Janus Workshop @ ClueCon 2020
Lorenzo Miniero
 
Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Django, What is it, Why is it cool?
Django, What is it, Why is it cool?
Tom Brander
 
Ad

More from Rami Sayar (8)

FITC - Exploring Art-Directed Responsive Images
FITC - Exploring Art-Directed Responsive ImagesFITC - Exploring Art-Directed Responsive Images
FITC - Exploring Art-Directed Responsive Images
Rami Sayar
 
Web a Quebec - JS Debugging
Web a Quebec - JS DebuggingWeb a Quebec - JS Debugging
Web a Quebec - JS Debugging
Rami Sayar
 
An Intense Overview of the React Ecosystem
An Intense Overview of the React EcosystemAn Intense Overview of the React Ecosystem
An Intense Overview of the React Ecosystem
Rami Sayar
 
Creating Beautiful CSS3 Animations - FITC Amsterdam 2016
Creating Beautiful CSS3 Animations - FITC Amsterdam 2016Creating Beautiful CSS3 Animations - FITC Amsterdam 2016
Creating Beautiful CSS3 Animations - FITC Amsterdam 2016
Rami Sayar
 
Here Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPressHere Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPress
Rami Sayar
 
FITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript DebuggingFITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript Debugging
Rami Sayar
 
FITC - Node.js 101
FITC - Node.js 101FITC - Node.js 101
FITC - Node.js 101
Rami Sayar
 
FITC - Data Visualization in Practice
FITC - Data Visualization in PracticeFITC - Data Visualization in Practice
FITC - Data Visualization in Practice
Rami Sayar
 
FITC - Exploring Art-Directed Responsive Images
FITC - Exploring Art-Directed Responsive ImagesFITC - Exploring Art-Directed Responsive Images
FITC - Exploring Art-Directed Responsive Images
Rami Sayar
 
Web a Quebec - JS Debugging
Web a Quebec - JS DebuggingWeb a Quebec - JS Debugging
Web a Quebec - JS Debugging
Rami Sayar
 
An Intense Overview of the React Ecosystem
An Intense Overview of the React EcosystemAn Intense Overview of the React Ecosystem
An Intense Overview of the React Ecosystem
Rami Sayar
 
Creating Beautiful CSS3 Animations - FITC Amsterdam 2016
Creating Beautiful CSS3 Animations - FITC Amsterdam 2016Creating Beautiful CSS3 Animations - FITC Amsterdam 2016
Creating Beautiful CSS3 Animations - FITC Amsterdam 2016
Rami Sayar
 
Here Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPressHere Be Dragons - Debugging WordPress
Here Be Dragons - Debugging WordPress
Rami Sayar
 
FITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript DebuggingFITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript Debugging
Rami Sayar
 
FITC - Node.js 101
FITC - Node.js 101FITC - Node.js 101
FITC - Node.js 101
Rami Sayar
 
FITC - Data Visualization in Practice
FITC - Data Visualization in PracticeFITC - Data Visualization in Practice
FITC - Data Visualization in Practice
Rami Sayar
 

Recently uploaded (19)

project_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptxproject_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptx
redzuriel13
 
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry SweetserAPNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC
 
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation TemplateSmart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
yojeari421237
 
Perguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolhaPerguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolha
socaslev
 
Determining Glass is mechanical textile
Determining  Glass is mechanical textileDetermining  Glass is mechanical textile
Determining Glass is mechanical textile
Azizul Hakim
 
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHostingTop Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
steve198109
 
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 SupportReliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
steve198109
 
Understanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep WebUnderstanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep Web
nabilajabin35
 
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
DataProvider1
 
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC
 
(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security
aluacharya169
 
highend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptxhighend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptx
elhadjcheikhdiop
 
OSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description fOSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description f
cbr49917
 
IT Services Workflow From Request to Resolution
IT Services Workflow From Request to ResolutionIT Services Workflow From Request to Resolution
IT Services Workflow From Request to Resolution
mzmziiskd
 
Computers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers NetworksComputers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers Networks
Tito208863
 
DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)
APNIC
 
Best web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you businessBest web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you business
steve198109
 
White and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptxWhite and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptx
canumatown
 
5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx
andani26
 
project_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptxproject_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptx
redzuriel13
 
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry SweetserAPNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC
 
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation TemplateSmart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
yojeari421237
 
Perguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolhaPerguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolha
socaslev
 
Determining Glass is mechanical textile
Determining  Glass is mechanical textileDetermining  Glass is mechanical textile
Determining Glass is mechanical textile
Azizul Hakim
 
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHostingTop Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
steve198109
 
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 SupportReliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
steve198109
 
Understanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep WebUnderstanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep Web
nabilajabin35
 
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
DataProvider1
 
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC
 
(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security
aluacharya169
 
highend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptxhighend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptx
elhadjcheikhdiop
 
OSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description fOSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description f
cbr49917
 
IT Services Workflow From Request to Resolution
IT Services Workflow From Request to ResolutionIT Services Workflow From Request to Resolution
IT Services Workflow From Request to Resolution
mzmziiskd
 
Computers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers NetworksComputers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers Networks
Tito208863
 
DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)
APNIC
 
Best web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you businessBest web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you business
steve198109
 
White and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptxWhite and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptx
canumatown
 
5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx
andani26
 

The State of WebSockets in Django

  • 1. The State of WebSockets in Django Rami Sayar - @ramisayar Technical Evangelist Microsoft Canada
  • 2. Agenda •  Where is WebSockets right now? •  Where is Socket.IO? •  Where does Django fit in? •  Using Django SwampDragon. •  Using Gevent. CONFOO - @RAMISAYAR
  • 3. Assumptions •  Working knowledge of Django, JavaScript & Python. Note: Slides will be made available. CONFOO - @RAMISAYAR
  • 4. What is a production web app? •  Django is surrounded by tons of applications, services and code in production. •  Advanced Django architecture is needed to support Django in production without failing hard. •  WebSockets falls apart from the rest. CONFOO - @RAMISAYAR
  • 5. WebSockets •  “WebSocket is a protocol for full-duplex communication channels over a single TCP connection.” Wikipedia •  Image Reference CONFOO - @RAMISAYAR
  • 7. Socket.IO •  “Socket.IO enables real-time bidirectional event-based communication. It works on every platform, browser or device, focusing equally on reliability and speed.” Reference •  Use by everyone: Microsoft Office, Yammer, Zendesk, Trello, etc… CONFOO - @RAMISAYAR
  • 8. Socket.IO Version 1.0 is here! Technically, now at v1.3.4 CONFOO - @RAMISAYAR
  • 9. Python, Django & WebSockets. CONFOO - @RAMISAYAR
  • 10. Python and WebSockets •  Python and WebSockets has notoriously been very difficult. •  Two reasons: •  WSGI protocol does not support WebSockets. Most popular form of web request handling in the Python web apps. Most frameworks are designed for use with FastCGI or mod_wsgi, etc. •  Default Python networked apps not exactly designed for event-based communication, you have to use things like gevent and twisted/tornado. CONFOO - @RAMISAYAR
  • 11. Django & WebSockets •  Django applications complete HttpResponses. •  Django not well suited for WebSocket event handling structure nor the channel approach in Socket.IO. CONFOO - @RAMISAYAR
  • 12. Presenting 3 Methods for WebSockets in Django CONFOO - @RAMISAYAR
  • 13. gevent •  “gevent is a coroutine-based Python networking library that uses greenlets to provide a synchronous API on top of the libev event loop.” •  Event loop based on libev (same as Node.js) •  Lightweight execution units, a.k.a. “lightweight threads”. •  Cooperative sockets with SSL support. •  Similar programming model to Node.js. CONFOO - @RAMISAYAR
  • 14. gevent-socketio •  gevent-socketio is a pure Python implementation of the Socket.IO protocol. Basically, it is a port of Socket.IO and typically behind in major releases. •  Designed to work with multiple different WSGI-based web frameworks. •  Handles the “WSGI” problem by providing a custom gevent WSGI server for use with gevent-socketio. •  Only dependencies are gevent. •  Imperfect solution: Django is still blocking (monkey patching is not perfect). CONFOO - @RAMISAYAR
  • 15. Demo 1: Django chat engine with gevent-socketio https://github.com/abourget/gevent-socketio/tree/master/examples/ django_chat CONFOO - @RAMISAYAR
  • 16. “Native” Django Implementation •  Previous approach requires significant modifications to your current Django app serving stack. Native as in you don’t need to know anything besides Django. •  Building an implementation of WebSockets on top of Django. •  Identified two problems for WebSockets in Django: •  Problems with WSGI still present EXCEPT in uWSGI. •  Networked event handling model is problematic. •  Solution: •  Use Nginx which follows – event-driven async architecture. •  uWSGI & Gevent for event handling. CONFOO - @RAMISAYAR
  • 17. Django-WebSocket-Redis •  Module implements websockets on top of Django. •  Use Redis as a data store for messaging behind uWSGI and Nginx. •  Runs a separate Django main loop in a cooperative concurrency model using gevent -> 1 thread for all open websockets. •  Django can be started as usual with ‘./manage.py runserver’. •  Normal requests communication with separate main (websocket) loop through Redis. •  Read: Offloading Websockets and Server-Sent Events AKA “Combine them with Django safely” CONFOO - @RAMISAYAR
  • 19. SwampDragon •  New project that adds websocket support •  Self-publishing models •  Django ORM Style Data Filter for Subscription Channels – Similar to WebSockets + Data Filter •  Relies on Redis for messaging + Tornado •  Angular JS Support CONFOO - @RAMISAYAR
  • 20. Demo 3: Django Swampdragon https://github.com/jonashagstedt/swampdragon CONFOO - @RAMISAYAR
  • 21. On Redis •  Redis is extremely popular as an easy and simple publish- subscribe. •  Redis is very particular about memory. Running out of memory in Redis -> CRASH AND BURN! •  If you don’t have enough memory in your VM to run Redis Cache -> Change your approach, use Apache Kafka. CONFOO - @RAMISAYAR
  • 22. What did we learn? •  The State of WebSockets in Django. •  Django and WebSockets is not impossible. CONFOO - @RAMISAYAR
  • 23. Thank You! Questions? Follow @ramisayar CONFOO - @RAMISAYAR
  • 24. Resources •  http://swampdragon.net/ •  http://django-websocket-redis.readthedocs.org/en/latest/ •  https://github.com/jrief/django-websocket-redis •  https://github.com/abourget/gevent-socketio/tree/master/ examples/django_chat •  http://jpadilla.com/post/74391616727/the-easiest-way-to-add- websockets-to-django •  http://ferretfarmer.net/2013/09/05/tutorial-real-time-chat-with- django-twisted-and-websockets-part-1/ CONFOO - @RAMISAYAR
  • 25. ©2013  Microso-  Corpora1on.  All  rights  reserved.  Microso-,  Windows,  Office,  Azure,  System  Center,  Dynamics  and  other  product  names  are  or  may  be  registered  trademarks  and/or  trademarks  in  the   U.S.  and/or  other  countries.  The  informa1on  herein  is  for  informa1onal  purposes  only  and  represents  the  current  view  of  Microso-  Corpora1on  as  of  the  date  of  this  presenta1on.  Because  Microso-   must  respond  to  changing  market  condi1ons,  it  should  not  be  interpreted  to  be  a  commitment  on  the  part  of  Microso-,  and  Microso-  cannot  guarantee  the  accuracy  of  any  informa1on  provided  a-er   the  date  of  this  presenta1on.  MICROSOFT  MAKES  NO  WARRANTIES,  EXPRESS,  IMPLIED  OR  STATUTORY,  AS  TO  THE  INFORMATION  IN  THIS  PRESENTATION.  

Editor's Notes

  • #5: What does a web application look like in production?