SlideShare a Scribd company logo
1 of 55
Download to read offline
Offline Web Applications with Dojo Offline & Google Gears




                       quot;Hello? No... I'm sorry...
                    I'm offline at the moment...!quot;
www.puremedia-online.de

  •    Internet-only company in Stuttgart
      •     AJAX / JavaScript
      •     Ruby on Rails
      •     TYPO3 incl. extension development




                        puremedia          t 0700 / 0078 0079   info@puremedia-online.de
                        Reinsburgstr. 37   m 0179 / 90 16 016   www.puremedia-online.de
                        70178 Stuttgart    f 0700 / 0078 0079
www.puremedia-online.de

  •    Internet-only company in Stuttgart
      •     AJAX / JavaScript
      •     Ruby on Rails
      •     TYPO3 incl. extension development



       Customers include...
Contents

  •    Offline??? Browser based Applications!
  •    Use Cases / Examples
  •    Offline Tools
  •    Google Gears
      •     Architecture
      •     Components
  •    Dojo Offline


  •    Comet
quot;User interface and usability
  in the browser are bad.quot;
Offline??? Browser based Applications!




  AJAX.
quot;You can only really use the browser
when you're connected to the internet.quot;
Offline??? Browser based Applications!




  Offline capable Web Applications.
Offline??? Browser based Applications!




  Offline closes one of the last gaps between web and desktop apps!
Use Cases / Examples

  Use Cases

  •    Internet connection is...
      •     spotty / unstable / slow
      •     not existing

  •    on the road
      •    airplane / train / bus
      •    at the customer's
Use Cases / Examples

  Examples

  •    Offline News Reader [Google Reader]
  •    Notepad [GearPad]
  •    Task list [Remember The Milk]
  •    Email Client
  •    CRM
  •    Projectmanagement-Tools
  •    Calendar
  •    .........
Offline Tools

   Tools [in the past] - (Offline is not brand new)

   •    Dojo Storage
   •    Derby / JavaDB
   •    Zimbra (Derby-based)
Offline Tools

   Tools [today]

   •    Adobe AIR (früher: Apollo)

   •    Joyent Slingshot (Ruby on Rails)

   •    Google Gears
Offline Tools

   Tools [coming soon]

   •    Firefox 3
   •    Webkit (Safari)
   •    HTML5 Working Draft of the WHATWG (quot;Client-side database
        storagequot;)
Google Gears - Basics

  What is Google Gears?

  •    Browser-Plugin
      •    Firefox
      •    Internet Explorer
      •    maybe soon: Opera and Safari
Google Gears - Basics

  What does it cost? Under which license?

  •    License
      •    OpenSource (New BSD license)
Google Gears - Differences

  What distinguishes Gears from other offline tools?

  •    App stays completely in the browser (no extra app / start up)
  •    Google's AJAX background -- developers use well-known technologies
       (JS / CSS / HTML), extended by a few now JS-API-calls
  •    lightweight / hardly no installation necessary
  •    open framework
  •    quot;offline onlyquot; (no goodies)
  •    ...it's from Google!
Google Gears - Components




                   LocalServer
                   Local URL- / resource-cache


                   Database
                   Local relational DB (SQLite)


                   Workerpool
                   puts time-intensive processes in the background
Google Gears

  Flow in ONLINE mode




               Client                 Server



                           Internet
             Webserver
           LocalServer                Webserver
             Localserver




                 DB
                                         DB
               (SQLite)
Google Gears

  Flow in ONLINE mode




               Client                 Server



                           Internet
             Webserver
           LocalServer                Webserver
             Localserver




                 DB
                                         DB
               (SQLite)
Google Gears

  Flow in OFFLINE mode




               Client                 Server



                           Internet
             Webserver
           LocalServer                Webserver
             Localserver




                 DB
                                         DB
               (SQLite)
Google Gears

  Flow in OFFLINE mode




               Client                 Server



                           Internet
             Webserver
           LocalServer                Webserver
             Localserver




                 DB
                                         DB
               (SQLite)
Google Gears - Local Server

  Local Server

  •    Intercepts requests to previously defined resources (CSS, HTML, JS...)...
  •    ...and serves them from the local cache (quot;Resource Storequot;)...
  •    ...regardless of offline/online mode.

  •    Resources are kept in a quot;Resource Storequot; (quot;URL-Containerquot;)
      •   Resource Store (manual update)
      •   Managed Resource Store (automatic update)
Google Gears - Database

  SQLite

  •    complete relational DB (Transactions, Primary keys, Views, Full-text
       search...)
  •    multiple DBs per App possible
  •    sandbox / same origin policy
      •    ATTACH / DETACH not available
  •    bind parameter
      •    execute() with bind parameters protects from SQL Injections
Google Gears

  Local data storage
Google Gears - Workerpool

  JavaScript in the background

  •    time-intensive processes can be run in the background
    •      UI stays responsive / browser doesn't block
    •      no warning dialog quot;Unresponsive Scriptquot;
  •    Restrictions:
    •      no access to the DOM
    •      no access to XMLHttpRequest (see Gears 0.2)

  • Use case: Synchronization
Google Gears - Security

  Security in Gears

  •    same-origin policy
      •    access only your own DB
      •    LocalServer can only cache resources in its own origin
  •    User opt-in before Gears can run
  •    Data is stored in user profile of OS
  •    Bind parameter protects from SQL-Injection attacks
Google Gears - Architecture

  Architecture - modal

  •    online? Communication with the server
  •    offline? Communication with local Gears components

  •    Pros
      •    easy to implement

  •    Cons
      •   User must explicitly and manually change modes (Button quot;Go offlinequot;)
      •   If user forgets to click quot;take me offlinequot;...
Google Gears - Architecture

  Architecture - modeless

  •    online? Almost only for syncing (continuously)
  •    offline? Always being assumed

  •    Pros
      •    User doesn't have to switch modes by hand
      •    Data is always available
      •    Performance is better

  •    Cons
      •   more difficult to implement...
      •   ...mostly because of sync in background
quot;How do I know if the user
is currently online or offline?quot;
quot;How can I do easy synchronization
  without reinventing the wheel?quot;
Dojo Offline

   JavaScript toolbox for Gears

   •    quot;Offline Widgetquot; (on/offline detection)
   •    slurp() finds used resources
   •    Data storage +
       •     encryption
       •     alternative storage
   •    Sync framework
Dojo Offline

   Data storage

   •    Dojo SQL
       •    sits on top of Gears' SQLite-implementation
       •    pro: query-results directly available als JS-objects!
       •    encryption

   •    Dojo Storage
       •    simple Hash-Table (key/value-pairs)
       •    pros: quick & easy
Dojo Offline

   Synchronization

   •    automatic syncing when...
       •    ...app starts / reloads
       •    ...when going back online
   •    manual sync possible
Offline

   Resume

   •      Offline closes one of the last gaps between web and desktop apps
   •      Use cases are limited - but in some cases very interesting
   •      Offline capability is not a byproduct
C: quot;What's the news?quot;   -   S: quot;Nothing.quot;
C: quot;What's the news?quot;   -   S: quot;Nothing!quot;
C: quot;What's the news?quot;   -   S: quot;Nothing!!!quot;
C: quot;What's the news?quot;   -   S: quot;NOTHING!!!quot;
C: quot;What's the news?quot;   -   S: quot;Data. Listen!quot;
Comet

  Polling

  •       Using polling in AJAX means:
        •     quot;The client (JavaScript / AJAX) asks...
        •     the server...
        •     in certain intervals...
        •     if there's new data.quot;
Comet

  The problem with polling

  a) intervals are too short
         most of the request are useless
         wasted bandwidth / high server load

  b) intervals are too long
         UI gets out of date
         displayed data is out-dated
Comet



  The bottom line

  •     why not let the server inform the client [PUSH]
           instead of
  •     having the client permanently ask [PULL]
Comet



  How does a traditional request work? [simplified...]
Comet



  How does a traditional request work?

  1.    Client makes a request to the server. A connection is opened.




                 Server




                Webserver
             Client / Browser
               Localserver
Comet



  How does a traditional request work?

  1.    Client makes a request to the server. A connection is opened.
  2.    Server answers.




                 Server




                Webserver
             Client / Browser
               Localserver
Comet



  How does a traditional request work?

  1.    Client makes a request to the server. A connection is opened.
  2.    Server answers.
  3.    Connection is closed.




                 Server




                Webserver
             Client / Browser
               Localserver
Comet



  How does a traditional request work?

  1.    Client makes a request to the server. A connection is opened.
  2.    Server answers.
  3.    Connection is closed.




                 Server




                Webserver
             Client / Browser
               Localserver
Comet



  How does a Comet request work?

  1.    Client makes a request to the server. A connection is opened.




                 Server




                Webserver
             Client / Browser
               Localserver
Comet



  How does a Comet request work?

  1.    Client makes a request to the server. A connection is opened.
  2.    Maybe there's no new data yet, but the connection is kept open!




                 Server




                Webserver
             Client / Browser
               Localserver
Comet



  How does a Comet request work?

  1.    Client makes a request to the server. A connection is opened.
  2.    Maybe there's no new data yet, but the connection is kept open!
  3.    The connection is kept open...




                 Server




                Webserver
             Client / Browser
               Localserver
Comet



  How does a Comet request work?

  1.    Client makes a request to the server. A connection is opened.
  2.    Maybe there's no new data yet, but the connection is kept open!
  3.    The connection is kept open...
  4.    News on the server! The server answers! The connection is closed or is
        even kept open!




                 Server




                Webserver
             Client / Browser
               Localserver
Comet



  Central idea with Comet

  •     quot;long-lived HTTP-Connectionsquot;
Comet



  Comet

  •     PUSH instead of PULL
  •     Low Latency
  •     Low Bandwidth
  •     UI not getting out-dated / always up-to-date
quot;Is Comet »Web 3.0«??quot;
Comet



    1. Problems with Comet


        one thread on the server per connection...
    •
        long-lived connection = many threads
        many threads = many resources (limited number of threads!)
        no more resources / threads allowed = no more new connections
        Firewalls: close connections that are open for quot;too longquot;
    •
        Proxies: can buffer pushed data - and therefore deliver late
    •
        Browser: one browser can only open 2 connections to the same server
    •
Comet



    1. Problems with Comet

    Solutions are on the way:
    • Jetty Continuations
    • Cometd
    • different Hostnames
Comet



    2. Is Comet necessary???


        For the majority of use cases AJAX / polling is sufficient!
    •

        Use Cases for Comet
    •
        • multi-user / collaborative applications
          • e.g. collaboratively working on a document; chatting
        • applications with real-time data
          •     e.g. stock prices, chats
Offline Web Applications with Dojo Offline & Google Gears




                         puremedia          t 0700 / 0078 0079   info@puremedia-online.de
                         Reinsburgstr. 37   m 0179 / 90 16 016   www.puremedia-online.de
                         70178 Stuttgart    f 0700 / 0078 0079

More Related Content

What's hot

Thinking in Components
Thinking in ComponentsThinking in Components
Thinking in ComponentsFITC
 
State of jQuery June 2013 - Portland
State of jQuery June 2013 - PortlandState of jQuery June 2013 - Portland
State of jQuery June 2013 - Portlanddmethvin
 
Yahoo Pipes Middleware In The Cloud
Yahoo Pipes Middleware In The CloudYahoo Pipes Middleware In The Cloud
Yahoo Pipes Middleware In The CloudConSanFrancisco123
 
High Performance Mobile Web
High Performance Mobile WebHigh Performance Mobile Web
High Performance Mobile WebJames D Bloom
 
Please Don't Touch the Slow Parts V3
Please Don't Touch the Slow Parts V3Please Don't Touch the Slow Parts V3
Please Don't Touch the Slow Parts V3Federico Galassi
 
Building an HTML5 Video Player
Building an HTML5 Video PlayerBuilding an HTML5 Video Player
Building an HTML5 Video PlayerJim Jeffers
 
Web前端性能分析工具导引
Web前端性能分析工具导引Web前端性能分析工具导引
Web前端性能分析工具导引冰 郭
 
14 Tips For Faster Web Apps
14 Tips For Faster Web Apps14 Tips For Faster Web Apps
14 Tips For Faster Web Appsashok kumar
 
High Performance Mobile Web
High Performance Mobile WebHigh Performance Mobile Web
High Performance Mobile WebJames D Bloom
 
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect ModelComprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect ModelvodQA
 
HTML5: An Overview
HTML5: An OverviewHTML5: An Overview
HTML5: An OverviewNagendra Um
 
jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesMark Roden
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)François Massart
 
Jim Webber A Couple Of Ways To Skin An Internet Scale Catx
Jim Webber A Couple Of Ways To Skin An Internet Scale CatxJim Webber A Couple Of Ways To Skin An Internet Scale Catx
Jim Webber A Couple Of Ways To Skin An Internet Scale Catxdeimos
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Timothy Fisher
 
Open Ap Is State Of The Market
Open Ap Is State Of The MarketOpen Ap Is State Of The Market
Open Ap Is State Of The MarketConSanFrancisco123
 
Game Development Using HTML 5
Game Development Using HTML 5Game Development Using HTML 5
Game Development Using HTML 5osa_ora
 

What's hot (20)

Thinking in Components
Thinking in ComponentsThinking in Components
Thinking in Components
 
State of jQuery June 2013 - Portland
State of jQuery June 2013 - PortlandState of jQuery June 2013 - Portland
State of jQuery June 2013 - Portland
 
Echo HTML5
Echo HTML5Echo HTML5
Echo HTML5
 
Yahoo Pipes Middleware In The Cloud
Yahoo Pipes Middleware In The CloudYahoo Pipes Middleware In The Cloud
Yahoo Pipes Middleware In The Cloud
 
High Performance Mobile Web
High Performance Mobile WebHigh Performance Mobile Web
High Performance Mobile Web
 
Please Don't Touch the Slow Parts V3
Please Don't Touch the Slow Parts V3Please Don't Touch the Slow Parts V3
Please Don't Touch the Slow Parts V3
 
Building an HTML5 Video Player
Building an HTML5 Video PlayerBuilding an HTML5 Video Player
Building an HTML5 Video Player
 
Web前端性能分析工具导引
Web前端性能分析工具导引Web前端性能分析工具导引
Web前端性能分析工具导引
 
Magee Dday2 Fixing App Performance Italiano
Magee Dday2 Fixing App Performance ItalianoMagee Dday2 Fixing App Performance Italiano
Magee Dday2 Fixing App Performance Italiano
 
ICEfaces and JSF 2.0 on GlassFish
ICEfaces and JSF 2.0 on GlassFishICEfaces and JSF 2.0 on GlassFish
ICEfaces and JSF 2.0 on GlassFish
 
14 Tips For Faster Web Apps
14 Tips For Faster Web Apps14 Tips For Faster Web Apps
14 Tips For Faster Web Apps
 
High Performance Mobile Web
High Performance Mobile WebHigh Performance Mobile Web
High Performance Mobile Web
 
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect ModelComprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
 
HTML5: An Overview
HTML5: An OverviewHTML5: An Overview
HTML5: An Overview
 
jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPages
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)
 
Jim Webber A Couple Of Ways To Skin An Internet Scale Catx
Jim Webber A Couple Of Ways To Skin An Internet Scale CatxJim Webber A Couple Of Ways To Skin An Internet Scale Catx
Jim Webber A Couple Of Ways To Skin An Internet Scale Catx
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011
 
Open Ap Is State Of The Market
Open Ap Is State Of The MarketOpen Ap Is State Of The Market
Open Ap Is State Of The Market
 
Game Development Using HTML 5
Game Development Using HTML 5Game Development Using HTML 5
Game Development Using HTML 5
 

Viewers also liked

Mobile development strategies with MVVM
Mobile development strategies with MVVMMobile development strategies with MVVM
Mobile development strategies with MVVMJames Montemagno
 
Data Binding in Action using MVVM pattern
Data Binding in Action using MVVM patternData Binding in Action using MVVM pattern
Data Binding in Action using MVVM patternFabio Collini
 
Android Data Binding in action using MVVM pattern - droidconUK
Android Data Binding in action using MVVM pattern - droidconUKAndroid Data Binding in action using MVVM pattern - droidconUK
Android Data Binding in action using MVVM pattern - droidconUKFabio Collini
 
MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )Ahmed Emad
 
Jump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design PatternJump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design PatternNishith Shukla
 

Viewers also liked (6)

Mobile development strategies with MVVM
Mobile development strategies with MVVMMobile development strategies with MVVM
Mobile development strategies with MVVM
 
Data Binding in Action using MVVM pattern
Data Binding in Action using MVVM patternData Binding in Action using MVVM pattern
Data Binding in Action using MVVM pattern
 
Android Data Binding in action using MVVM pattern - droidconUK
Android Data Binding in action using MVVM pattern - droidconUKAndroid Data Binding in action using MVVM pattern - droidconUK
Android Data Binding in action using MVVM pattern - droidconUK
 
MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )
 
Training: MVVM Pattern
Training: MVVM PatternTraining: MVVM Pattern
Training: MVVM Pattern
 
Jump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design PatternJump start to OOP, OOAD, and Design Pattern
Jump start to OOP, OOAD, and Design Pattern
 

Similar to Offline capable web applications with Google Gears and Dojo Offline

How NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeHow NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeRadosław Scheibinger
 
Practical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter SvenssonPractical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter Svenssonrajivmordani
 
WebApp / SPA @ AllFacebook Developer Conference
WebApp / SPA @ AllFacebook Developer ConferenceWebApp / SPA @ AllFacebook Developer Conference
WebApp / SPA @ AllFacebook Developer ConferenceAllFacebook.de
 
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008codebits
 
Velocity EU: Give Responsive Design a Mobile Performance Boost
Velocity EU: Give Responsive Design a Mobile Performance BoostVelocity EU: Give Responsive Design a Mobile Performance Boost
Velocity EU: Give Responsive Design a Mobile Performance BoostJon Arne Sæterås
 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWebDave Bouwman
 
iPhone Development For Experienced Web Developers
iPhone Development For Experienced Web DevelopersiPhone Development For Experienced Web Developers
iPhone Development For Experienced Web Developerslisab517
 
Socket applications
Socket applicationsSocket applications
Socket applicationsJoão Moura
 
GDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
GDD Japan 2009 - Designing OpenSocial Apps For Speed and ScaleGDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
GDD Japan 2009 - Designing OpenSocial Apps For Speed and ScalePatrick Chanezon
 
Devfest09 Cschalk Gwt
Devfest09 Cschalk GwtDevfest09 Cschalk Gwt
Devfest09 Cschalk GwtChris Schalk
 
Disrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsDisrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsChris Love
 
Delivering Mobile Apps That Perform
Delivering Mobile Apps That PerformDelivering Mobile Apps That Perform
Delivering Mobile Apps That PerformRuben Goncalves
 
Building for, perceiving and measuring performance for mobile web
Building for, perceiving and measuring performance for mobile webBuilding for, perceiving and measuring performance for mobile web
Building for, perceiving and measuring performance for mobile webRobin Glen
 
20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performanceAndrew Siemer
 
Web app job and functions - TUGAIT 2017
Web app job and functions  - TUGAIT 2017Web app job and functions  - TUGAIT 2017
Web app job and functions - TUGAIT 2017Steef-Jan Wiggers
 
Server rendering-talk
Server rendering-talkServer rendering-talk
Server rendering-talkDaiwei Lu
 

Similar to Offline capable web applications with Google Gears and Dojo Offline (20)

Ajax World West
Ajax World WestAjax World West
Ajax World West
 
How NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeHow NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscape
 
Practical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter SvenssonPractical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter Svensson
 
WebApp / SPA @ AllFacebook Developer Conference
WebApp / SPA @ AllFacebook Developer ConferenceWebApp / SPA @ AllFacebook Developer Conference
WebApp / SPA @ AllFacebook Developer Conference
 
Web assembly with PWA
Web assembly with PWA Web assembly with PWA
Web assembly with PWA
 
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
 
Velocity EU: Give Responsive Design a Mobile Performance Boost
Velocity EU: Give Responsive Design a Mobile Performance BoostVelocity EU: Give Responsive Design a Mobile Performance Boost
Velocity EU: Give Responsive Design a Mobile Performance Boost
 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWeb
 
iPhone Development For Experienced Web Developers
iPhone Development For Experienced Web DevelopersiPhone Development For Experienced Web Developers
iPhone Development For Experienced Web Developers
 
wt mod3.pdf
wt mod3.pdfwt mod3.pdf
wt mod3.pdf
 
Socket applications
Socket applicationsSocket applications
Socket applications
 
GDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
GDD Japan 2009 - Designing OpenSocial Apps For Speed and ScaleGDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
GDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
 
Devfest09 Cschalk Gwt
Devfest09 Cschalk GwtDevfest09 Cschalk Gwt
Devfest09 Cschalk Gwt
 
Disrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsDisrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applications
 
Modern Web Applications
Modern Web ApplicationsModern Web Applications
Modern Web Applications
 
Delivering Mobile Apps That Perform
Delivering Mobile Apps That PerformDelivering Mobile Apps That Perform
Delivering Mobile Apps That Perform
 
Building for, perceiving and measuring performance for mobile web
Building for, perceiving and measuring performance for mobile webBuilding for, perceiving and measuring performance for mobile web
Building for, perceiving and measuring performance for mobile web
 
20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performance
 
Web app job and functions - TUGAIT 2017
Web app job and functions  - TUGAIT 2017Web app job and functions  - TUGAIT 2017
Web app job and functions - TUGAIT 2017
 
Server rendering-talk
Server rendering-talkServer rendering-talk
Server rendering-talk
 

Recently uploaded

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Recently uploaded (20)

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 

Offline capable web applications with Google Gears and Dojo Offline

  • 1. Offline Web Applications with Dojo Offline & Google Gears quot;Hello? No... I'm sorry... I'm offline at the moment...!quot;
  • 2. www.puremedia-online.de • Internet-only company in Stuttgart • AJAX / JavaScript • Ruby on Rails • TYPO3 incl. extension development puremedia t 0700 / 0078 0079 info@puremedia-online.de Reinsburgstr. 37 m 0179 / 90 16 016 www.puremedia-online.de 70178 Stuttgart f 0700 / 0078 0079
  • 3. www.puremedia-online.de • Internet-only company in Stuttgart • AJAX / JavaScript • Ruby on Rails • TYPO3 incl. extension development Customers include...
  • 4. Contents • Offline??? Browser based Applications! • Use Cases / Examples • Offline Tools • Google Gears • Architecture • Components • Dojo Offline • Comet
  • 5. quot;User interface and usability in the browser are bad.quot;
  • 6. Offline??? Browser based Applications! AJAX.
  • 7. quot;You can only really use the browser when you're connected to the internet.quot;
  • 8. Offline??? Browser based Applications! Offline capable Web Applications.
  • 9. Offline??? Browser based Applications! Offline closes one of the last gaps between web and desktop apps!
  • 10. Use Cases / Examples Use Cases • Internet connection is... • spotty / unstable / slow • not existing • on the road • airplane / train / bus • at the customer's
  • 11. Use Cases / Examples Examples • Offline News Reader [Google Reader] • Notepad [GearPad] • Task list [Remember The Milk] • Email Client • CRM • Projectmanagement-Tools • Calendar • .........
  • 12. Offline Tools Tools [in the past] - (Offline is not brand new) • Dojo Storage • Derby / JavaDB • Zimbra (Derby-based)
  • 13. Offline Tools Tools [today] • Adobe AIR (früher: Apollo) • Joyent Slingshot (Ruby on Rails) • Google Gears
  • 14. Offline Tools Tools [coming soon] • Firefox 3 • Webkit (Safari) • HTML5 Working Draft of the WHATWG (quot;Client-side database storagequot;)
  • 15. Google Gears - Basics What is Google Gears? • Browser-Plugin • Firefox • Internet Explorer • maybe soon: Opera and Safari
  • 16. Google Gears - Basics What does it cost? Under which license? • License • OpenSource (New BSD license)
  • 17. Google Gears - Differences What distinguishes Gears from other offline tools? • App stays completely in the browser (no extra app / start up) • Google's AJAX background -- developers use well-known technologies (JS / CSS / HTML), extended by a few now JS-API-calls • lightweight / hardly no installation necessary • open framework • quot;offline onlyquot; (no goodies) • ...it's from Google!
  • 18. Google Gears - Components LocalServer Local URL- / resource-cache Database Local relational DB (SQLite) Workerpool puts time-intensive processes in the background
  • 19. Google Gears Flow in ONLINE mode Client Server Internet Webserver LocalServer Webserver Localserver DB DB (SQLite)
  • 20. Google Gears Flow in ONLINE mode Client Server Internet Webserver LocalServer Webserver Localserver DB DB (SQLite)
  • 21. Google Gears Flow in OFFLINE mode Client Server Internet Webserver LocalServer Webserver Localserver DB DB (SQLite)
  • 22. Google Gears Flow in OFFLINE mode Client Server Internet Webserver LocalServer Webserver Localserver DB DB (SQLite)
  • 23. Google Gears - Local Server Local Server • Intercepts requests to previously defined resources (CSS, HTML, JS...)... • ...and serves them from the local cache (quot;Resource Storequot;)... • ...regardless of offline/online mode. • Resources are kept in a quot;Resource Storequot; (quot;URL-Containerquot;) • Resource Store (manual update) • Managed Resource Store (automatic update)
  • 24. Google Gears - Database SQLite • complete relational DB (Transactions, Primary keys, Views, Full-text search...) • multiple DBs per App possible • sandbox / same origin policy • ATTACH / DETACH not available • bind parameter • execute() with bind parameters protects from SQL Injections
  • 25. Google Gears Local data storage
  • 26. Google Gears - Workerpool JavaScript in the background • time-intensive processes can be run in the background • UI stays responsive / browser doesn't block • no warning dialog quot;Unresponsive Scriptquot; • Restrictions: • no access to the DOM • no access to XMLHttpRequest (see Gears 0.2) • Use case: Synchronization
  • 27. Google Gears - Security Security in Gears • same-origin policy • access only your own DB • LocalServer can only cache resources in its own origin • User opt-in before Gears can run • Data is stored in user profile of OS • Bind parameter protects from SQL-Injection attacks
  • 28. Google Gears - Architecture Architecture - modal • online? Communication with the server • offline? Communication with local Gears components • Pros • easy to implement • Cons • User must explicitly and manually change modes (Button quot;Go offlinequot;) • If user forgets to click quot;take me offlinequot;...
  • 29. Google Gears - Architecture Architecture - modeless • online? Almost only for syncing (continuously) • offline? Always being assumed • Pros • User doesn't have to switch modes by hand • Data is always available • Performance is better • Cons • more difficult to implement... • ...mostly because of sync in background
  • 30. quot;How do I know if the user is currently online or offline?quot;
  • 31. quot;How can I do easy synchronization without reinventing the wheel?quot;
  • 32. Dojo Offline JavaScript toolbox for Gears • quot;Offline Widgetquot; (on/offline detection) • slurp() finds used resources • Data storage + • encryption • alternative storage • Sync framework
  • 33. Dojo Offline Data storage • Dojo SQL • sits on top of Gears' SQLite-implementation • pro: query-results directly available als JS-objects! • encryption • Dojo Storage • simple Hash-Table (key/value-pairs) • pros: quick & easy
  • 34. Dojo Offline Synchronization • automatic syncing when... • ...app starts / reloads • ...when going back online • manual sync possible
  • 35. Offline Resume • Offline closes one of the last gaps between web and desktop apps • Use cases are limited - but in some cases very interesting • Offline capability is not a byproduct
  • 36. C: quot;What's the news?quot; - S: quot;Nothing.quot; C: quot;What's the news?quot; - S: quot;Nothing!quot; C: quot;What's the news?quot; - S: quot;Nothing!!!quot; C: quot;What's the news?quot; - S: quot;NOTHING!!!quot; C: quot;What's the news?quot; - S: quot;Data. Listen!quot;
  • 37. Comet Polling • Using polling in AJAX means: • quot;The client (JavaScript / AJAX) asks... • the server... • in certain intervals... • if there's new data.quot;
  • 38. Comet The problem with polling a) intervals are too short most of the request are useless wasted bandwidth / high server load b) intervals are too long UI gets out of date displayed data is out-dated
  • 39. Comet The bottom line • why not let the server inform the client [PUSH] instead of • having the client permanently ask [PULL]
  • 40. Comet How does a traditional request work? [simplified...]
  • 41. Comet How does a traditional request work? 1. Client makes a request to the server. A connection is opened. Server Webserver Client / Browser Localserver
  • 42. Comet How does a traditional request work? 1. Client makes a request to the server. A connection is opened. 2. Server answers. Server Webserver Client / Browser Localserver
  • 43. Comet How does a traditional request work? 1. Client makes a request to the server. A connection is opened. 2. Server answers. 3. Connection is closed. Server Webserver Client / Browser Localserver
  • 44. Comet How does a traditional request work? 1. Client makes a request to the server. A connection is opened. 2. Server answers. 3. Connection is closed. Server Webserver Client / Browser Localserver
  • 45. Comet How does a Comet request work? 1. Client makes a request to the server. A connection is opened. Server Webserver Client / Browser Localserver
  • 46. Comet How does a Comet request work? 1. Client makes a request to the server. A connection is opened. 2. Maybe there's no new data yet, but the connection is kept open! Server Webserver Client / Browser Localserver
  • 47. Comet How does a Comet request work? 1. Client makes a request to the server. A connection is opened. 2. Maybe there's no new data yet, but the connection is kept open! 3. The connection is kept open... Server Webserver Client / Browser Localserver
  • 48. Comet How does a Comet request work? 1. Client makes a request to the server. A connection is opened. 2. Maybe there's no new data yet, but the connection is kept open! 3. The connection is kept open... 4. News on the server! The server answers! The connection is closed or is even kept open! Server Webserver Client / Browser Localserver
  • 49. Comet Central idea with Comet • quot;long-lived HTTP-Connectionsquot;
  • 50. Comet Comet • PUSH instead of PULL • Low Latency • Low Bandwidth • UI not getting out-dated / always up-to-date
  • 51. quot;Is Comet »Web 3.0«??quot;
  • 52. Comet 1. Problems with Comet one thread on the server per connection... • long-lived connection = many threads many threads = many resources (limited number of threads!) no more resources / threads allowed = no more new connections Firewalls: close connections that are open for quot;too longquot; • Proxies: can buffer pushed data - and therefore deliver late • Browser: one browser can only open 2 connections to the same server •
  • 53. Comet 1. Problems with Comet Solutions are on the way: • Jetty Continuations • Cometd • different Hostnames
  • 54. Comet 2. Is Comet necessary??? For the majority of use cases AJAX / polling is sufficient! • Use Cases for Comet • • multi-user / collaborative applications • e.g. collaboratively working on a document; chatting • applications with real-time data • e.g. stock prices, chats
  • 55. Offline Web Applications with Dojo Offline & Google Gears puremedia t 0700 / 0078 0079 info@puremedia-online.de Reinsburgstr. 37 m 0179 / 90 16 016 www.puremedia-online.de 70178 Stuttgart f 0700 / 0078 0079