Enabling realtime collaborative data

Enabling realtime collaborative data-intensive web applications 1 Betreuer: Sascha Roth Kooperationspartner: Pentasys AG Tobias Höfler 29.04.2013 A ca...

0 downloads 43 Views 916KB Size
Fakultät für Informatik Technische Universität München

Enabling realtime collaborative dataintensive web applications A case study using serverside JavaScript

Betreuer: Sascha Roth Kooperationspartner: Pentasys AG Tobias Höfler

29.04.2013

1

Outline

1.  Node.js – Introduction & Survey 2.  Prototypical implementation of a real-time collaboration tool 3.  Conclusion & Outlook

Tobias Höfler

29.04.2013

2

Node.js - Introduction §  Developed by Ryan Dahl in 2009 §  JavaScript Interpreter §  JavaScript outside of the browser §  Extends Googles V8 with low-level bindings •  Filesystem, Sockets,... §  Every binding is asynchronous, event loop §  Single threaded §  Current version: 0.10

Tobias Höfler

29.04.2013

3

Node.js - Survey §  Hypotheses •  JavaScript developers are unsatisfied with the current tool support •  Developers do not like the syntax of JavaScript •  JavaScript code is hard to maintain •  Node.js is suitable for enterprise applications §  Participants •  100 complete answers •  Countries: –  Germany: –  USA: –  UK:

37% 22% 3%

•  Mostly Web-Developers

Tobias Höfler

29.04.2013

4

Node.js - Survey §  Key results about JavaScript •  53.7% are satisfied with their editors –  Most popular: IntelliJ, WebStorm, Emacs –  Missing features: code completion, code navigation, debugging

•  65% like the syntax of JavaScript –  CoffeeScript and TypeScript are not planed to be used in future

•  •  •  • 

Tobias Höfler

44% do not think, JS is hard to maintain 65% said JS code is easy to read 42% use testing frameworks The usage of testing frameworks influences maintainability

29.04.2013

5

Node.js - Survey §  Key results about Node.js •  88% have heard about Node.js •  Node.js projects tend to be smaller –  41.5% of projects: –  22.6% of projects:

1 poeple 3 poeple

•  Typical kinds of projects –  61.9% of projects :

Tobias Höfler

29.04.2013

Web Application

6

Node.js - Survey §  Key results about Node.js •  Reasons for using Node.js –  –  –  –  –  – 

Simplicity Performance „Good fit for Web Applications“ No „phase shift“ Realtime capabilities Event-driven

•  64.8% confirmed the enterprise readiness –  –  –  – 

Tobias Höfler

Scalability Stability Short time to market Same language at client & server

29.04.2013

7

Prototypical implementation of a Real-Time collaboration tool

Tobias Höfler

29.04.2013

8

Demo

Tobias Höfler

29.04.2013

9

The Real-Time Architecture §  Proposed by Alex MacCaw (JavaScript Web Applications) •  Real-Time architecture = event-driven •  Driven by user interactions §  Client-side MVC §  Which model updates need to be distributed ? §  Who needs to be notified ? §  PubSub pattern

Tobias Höfler

29.04.2013

10

Prototypical Implementation – Fundamental Architecture

Tobias Höfler

29.04.2013

11

Prototypical Implementation – Technology Stack §  Client UI with Twitter Bootstrap §  Client MVC with EmberJS: •  Model:

CollaborativeEditor.Documents = Ember.A([]); CollaborativeEditor.Document = Ember.Object.extend({ name : null, lastModified : null, numberOfPeopleEditing : null, tags : Ember.A([]) });

Tobias Höfler

29.04.2013

12

Prototypical Implementation – Technology Stack §  Client MVC with EmberJS: •  Controller: CollaborativeEditor.DocumentsController = Ember.ArrayController.extend({ createNewDoc : function() { ... }, ...

Tobias Höfler

29.04.2013

13

Prototypical Implementation – Technology Stack §  Client MVC with EmberJS: •  View: