Your SlideShare is downloading. ×
RT-MVC: Real Time Model/View/Controller Applications
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.


Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

RT-MVC: Real Time Model/View/Controller Applications


Published on

Video and slides synchronized, mp3 and slide download available at …

Video and slides synchronized, mp3 and slide download available at

Daniel Erickson addresses the problems appearing in mixing MVC and real time frameworks in web applications and how Geddy transparently solves these issues. Filmed at

Daniel Erickson has spent the better part of the last 8 years evolving with the web. He currently works for Yammer as a Senior JavaScript Engineer. He is a core contributor for Geddy, one of the leading web frameworks for Node.js. He has been working with Node since it's early days back in 2010, and has worked with a number of companies to help them write well organized Node applications.

Published in: Technology, Business

  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. 11/7/12 Real Time and MVC with GeddyJS1/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1RT-MVCReal Time Model/View/Controller Applications/Daniel Erickson qConSF
  • 2. News & Community Site• 750,000 unique visitors/month• Published in 4 languages (English, Chinese, Japanese and BrazilianPortuguese)• Post content from our QCon conferences• News 15-20 / week• Articles 3-4 / week• Presentations (videos) 12-15 / week• Interviews 2-3 / week• Books 1 / monthWatch the video with slidesynchronization on!
  • 3. Presented at QCon San Franciscowww.qconsf.comPurpose of QCon- to empower software development by facilitating the spread ofknowledge and innovationStrategy- practitioner-driven conference designed for YOU: influencers ofchange and innovation in your teams- speakers and topics driving the evolution and innovation- connecting and catalyzing the influencers and innovatorsHighlights- attended by more than 12,000 delegates since 2007- held in 9 cities worldwide
  • 4. 11/7/12 Real Time and MVC with GeddyJS2/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1WHATS GOING TOWINREAL TIME OR MVC?
  • 5. 11/7/12 Real Time and MVC with GeddyJS3/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1REAL TIME?
  • 6. 11/7/12 Real Time and MVC with GeddyJS4/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1YEAH!CUZ SOME PEOPLE SAY:MVC doesnt scale wellMVC is dead
  • 7. 11/7/12 Real Time and MVC with GeddyJS5/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1BUT MVC IS HERE TO STAYGives teams structure to get things doneAllows new people to jump into your projectEasy to get started with
  • 8. 11/7/12 Real Time and MVC with GeddyJS6/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1WHATS GOING TOWINREAL TIME OR MVC?
  • 9. 11/7/12 Real Time and MVC with GeddyJS7/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1MVC?
  • 10. 11/7/12 Real Time and MVC with GeddyJS8/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1TOTALLY!CUZ PEOPLE THINK:Real Time is hardMaintain a new stackEvent Machine and Tornado suckFront end code is messy
  • 11. 11/7/12 Real Time and MVC with GeddyJS9/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1BUT REAL TIME IS ALSO HERE TO STAYUse WebSockets to get updates on the front endInstant feedback for your usersWorks really well on mobile
  • 12. 11/7/12 Real Time and MVC with GeddyJS10/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1WHATS GOING TOWINREAL TIME OR MVC?
  • 13. 11/7/12 Real Time and MVC with GeddyJS11/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1BOTH!
  • 14. 11/7/12 Real Time and MVC with GeddyJS12/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1REAL TIME AND MVCACTUALLY MIX PRETTY WELL
  • 15. 11/7/12 Real Time and MVC with GeddyJS13/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1YOU CAN:Define your model once and use it all over the placeuse your templates on both sides of HTTPMirror events from the backend to the frontendinstance createdinstace updatedinstance removed
  • 16. 11/7/12 Real Time and MVC with GeddyJS14/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1HOW WE SOLVED THEREAL TIME PROBLEMWITH GEDDY
  • 17. 11/7/12 Real Time and MVC with GeddyJS15/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1WAIT,WHATS GEDDY?
  • 18. 11/7/12 Real Time and MVC with GeddyJS16/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1THE ORIGINAL MVCFRAMEWORK FOR NODE.JSVery familiar if you know RailsAwesome noSQL and SQL ORMMany different templating languages
  • 19. 11/7/12 Real Time and MVC with GeddyJS17/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1AND NOW ITSUPPORTS REAL TIMERIGHT OUT OF THE BOX
  • 20. 11/7/12 Real Time and MVC with GeddyJS18/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1SO LETS MAKE AN MVC APPTHAT SUPPORTS REAL TIME
  • 21. 11/7/12 Real Time and MVC with GeddyJS19/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1GENERATE AN APP$ npm install -g geddy$ geddy app -rt demo$ cd demo$ geddy scaffold -rt thing title description$ geddy
  • 22. 11/7/12 Real Time and MVC with GeddyJS20/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1TEST IT OUTOpen upandhttp://localhost:4000/thingshttp://localhost:4000/things/add
  • 23. 11/7/12 Real Time and MVC with GeddyJS21/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1FOR THOSE OF YOU FOLLOWINGALONG AT HOME1. add a thing2. watch it show up in the other window3. update the thing4. watch it change in the other window5. remove the item6. watch it get removed from the other window.
  • 24. 11/7/12 Real Time and MVC with GeddyJS22/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1WHAT JUST HAPPENED?geddy app -rt demoGenerated a demoapp with realtime enabled
  • 25. 11/7/12 Real Time and MVC with GeddyJS23/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1WHAT JUST HAPPENED?geddy scaffold -rt thing ...Generated a thingresourcethingmodelmade that model available on the front endthingscontrollerroutesviews that subscribe to the realtime events
  • 26. 11/7/12 Real Time and MVC with GeddyJS24/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1HOW DOES IT WORK?ON THE SERVER SIDE:geddy sees the realtimeflag in your config filecopies your models over to a public js filesets up listeners for each models lifecycle eventsproxies those lifecycle events to
  • 27. 11/7/12 Real Time and MVC with GeddyJS25/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1HOW DOES IT WORK?ON THE CLIENT SIDE:registers listeners for all model related eventsproxies them to the appropriate modelsscaffolds some code that hooks into real time events
  • 28. 11/7/12 Real Time and MVC with GeddyJS26/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1THATS PRETTY COOL,BUT IS IT EASY TO CHANGE?modify your model once and you get it everywhereemit custom events on your modelsall generated code can be modified
  • 29. 11/7/12 Real Time and MVC with GeddyJS27/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1WHATS NEXT ON THE ROADMAP?Create an AJAX adapter for the front-end ORMReal time queriesPer instance real time eventsA better way to share templates
  • 30. 11/7/12 Real Time and MVC with GeddyJS28/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1WANT TO HELP OUT?CHECK OUT GEDDY ATJoin the mailinglistopen bugs on githubsend us pull requests
  • 31. 11/7/12 Real Time and MVC with GeddyJS29/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1ANY QUESTIONS?
  • 32. 11/7/12 Real Time and MVC with GeddyJS30/30file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1