Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Data Sync for Apps: With offline support but without cloud

Data Sync for Apps: With offline support but without cloud

Data is the fuel for any business application on the market. In the year 2016 we're accessing company-internal data not only from our workplace anymore. While in a car, train, hotel—nowadays we want to use other devices like smartphones or tablets instead of that single notebook we had ten years ago.

Your data is your business. And also in terms of informational privacy, your data is deserving protection. Storing sensible data in a public cloud is sometimes out of the question.

Christian Liebel and Marco Frodl of Thinktecture will show you how to implement an offline-aware data store including synchronization to locally stored corporate data with the help of PouchDB and Thinktecture RelayServer. This doesn't only work in a browser, but on a whole bunch of both mobile and desktop platforms.

Christian Liebel

April 27, 2016
Tweet

More Decks by Christian Liebel

Other Decks in Programming

Transcript

  1. RHEINNECKARJS: DATA SYNC FOR APPS SPEAKERS ▸ Hi! I’m Christian

    Liebel :) ▸ Developer at Thinktecture ▸ @chris_liebel ▸ [email protected] ▸ Hi! I’m Marco Frodl :) ▸ Consultant/Director New Business at Thinktecture ▸ @marcofrodl ▸ [email protected]
  2. RHEINNECKARJS: DATA SYNC FOR APPS HOW DO PEOPLE WORK TODAY?

    ▸ More people are working outside the office ▸ Greater flexibility to get work done ▸ wherever, ▸ whenever and ▸ on whatever device works best ▸ People choose and use consumer devices to do their work ▸ People use multiple devices
  3. RHEINNECKARJS: DATA SYNC FOR APPS REAL CROSS PLATFORM Store Phone

    On all devices Any platform Apps and browsers
  4. RHEINNECKARJS: DATA SYNC FOR APPS JUST PUT ALL YOUR DATA

    INTO THE CLOUD ▸ It’s easy ▸ Reduces costs ▸ Better agility ▸ More scalability ▸ Synchronisation ▸ Everyone does it ▸ Business Model ▸ On-Premises ▸ Regulations ▸ Security / Encryption ▸ Visibility ▸ Lack of trust Pro Con
  5. RHEINNECKARJS: DATA SYNC FOR APPS GET THINGS CONNECTED ▸ No

    VPN-Gateway ▸ No static IP ▸ No open Firewall ▸ No certificate hell ▸ Not always online
  6. RHEINNECKARJS: DATA SYNC FOR APPS REQUIREMENTS ▸ .NET runtime ▸

    RabbitMQ ▸ Message Queue ▸ Microsoft SQL Server ▸ Authentication ▸ Link Management ▸ Logging
  7. RHEINNECKARJS: DATA SYNC FOR APPS OFFLINE PARADIGMS ▸ A bad

    connection is worse than no connection at all
 ▸ 
 ▸ Offline First ▸ Offline First == User First 18
  8. RHEINNECKARJS: DATA SYNC FOR APPS ONLINE/OFFLINE STATUS ▸ navigator.onLine property

    ▸ false: the device is definitely offline ▸ true: the device may be online ▸ online event ▸ offline event
  9. RHEINNECKARJS: DATA SYNC FOR APPS TECHNOLOGIES DETECTION STORAGE onLine property


    online/offline events
 (insufficient) Web Storage (Local/Session Storage)
 Web SQL (deprecated)
 IndexedDB (buggy/incomplete in IE/Edge/Safari) Application Cache (deprecated)
 Service Workers (Chrome/Firefox only) AVAILABILITY
  10. RHEINNECKARJS: DATA SYNC FOR APPS NOSQL DATABASES ▸ Not Only

    SQL ▸ SQL is not the only/preferred database language or unavailable ▸ Data manipulation using object-oriented APIs ▸ Open-source
  11. RHEINNECKARJS: DATA SYNC FOR APPS COUCHDB ▸ A Database That

    Completely Embraces The Web ▸ Document-oriented database ▸ Weakly typed JSON documents ▸ REST-ful API ▸ Replication support ▸ Powers npm
  12. RHEINNECKARJS: DATA SYNC FOR APPS POUCHDB ▸ JavaScript implementation of

    CouchDB ▸ Cross-Platform Support (browser/Node.js/…) ▸ Emulates CouchDB’s API ▸ Asynchronous API (Promise-based) ▸ Data is stored locally (IndexedDB/Web SQL) ▸ Offline support ▸ Sync to CouchDB
  13. RHEINNECKARJS: DATA SYNC FOR APPS POUCHDB STORAGE SUPPORT ▸ IndexedDB

    ▸ WebSQL ▸ SQLite ▸ LevelDB ▸ FruitDOWN ▸ In-Memory ▸ Local Storage
  14. RHEINNECKARJS: DATA SYNC FOR APPS POUCHDB PLATFORM SUPPORT + Node.js

    + Cordova https://pouchdb.com/adapters.html#pouchdb_in_the_browser
  15. RHEINNECKARJS: DATA SYNC FOR APPS DEMO ▸ Pizza Management Tool

    ▸ Configuring Thinktecture RelayServer ▸ Running PouchDB Server ▸ Running Thinktecture RelayServer On-Premises Connector ▸ Adding Ionic 2 client ▸ Deploy to device ▸ Have fun!
  16. RHEINNECKARJS: DATA SYNC FOR APPS TEXT ADDITIONAL RESOURCES ▸ Sample

    ▸ https://github.com/thinktecture/relayserver-offline-sync ▸ Slides ▸ https://speakerdeck.com/chliebel/data-sync-for-apps- with-offline-support-but-without-cloud
  17. RHEINNECKARJS: DATA SYNC FOR APPS TEXT CONCLUSION ▸ 9-5 Factory

    jobs ▸ Work wherever you want ▸ Work with multiple devices ▸ Access, sync data ▸ Work offline ▸ Cloud || RelayServer == your choice