SlideShare a Scribd company logo
1 of 78
Download to read offline
F**get the Web
            http://flic.kr/p/8JS7km
http://flic.kr/p/8Tsj3N
http://flic.kr/p/a25FHi
http://ftw.nodester.com
Change this to your
            Twitter username




              This is live now


http://ftw.nodester.com
http://ftw.nodester.com
http://flic.kr/p/5rTP9f
•Web Storage

• IndexedDB (where available)

• Web SQL Databases

• History API

• Offline manifest
                         http://flic.kr/p/5rTP9f
http://flic.kr/p/4HYNgX
๏ Web Storage simple, and
  well supported IE8+
๏ Web SQL has good mobile
  support, but no Firefox
๏ IndexedDB gives us
  coverage
                            http://flic.kr/p/4HYNgX
Web Storage
Cookies
suck.
Not the edible kind, duh!


Cookies
suck.
1. Code for cookies difficult
2. Date format is fugly
3. Limitations in size and number
4. Deleting doesn't really delete
5. Sessions leak...but not always!
http://flic.kr/p/5irsCG




Fuck cookies.
Sexy Storage FTW


              http://flic.kr/p/3pBDzf
•   localStorage no expiry
    required & persists

•   sessionStorage doesn't leak

• Applied to document origin, i.e.
    scheme/host/port tuple

•   Insanely simple API
setItem(key, value)
removeItem(key)
length
key(index)
clear()
var store = localStorage;
store.name = 'remy';
var store = localStorage;
store.name = 'remy';
delete store.name;
Values are coerced
    in to strings
Values are coerced
    in to strings
       Work around: JSON
  (and http://www.json.org/json2.js)
Events Too
Gotcha
 The API isn't protected, you can, if
  you want to mess things up, do:

localStorage.key = 'foo';

 Now the key method is a string :(
Web SQL Databases




               http://flic.kr/p/drmCJ
๏ SQLite based
๏ No longer actively maintained
๏ Good Safari support - i.e. iOS
๏ Fully featured debuggers available
db = openDatabase('Notes', '1.0', 'notes', 5242880);


db.transaction(function(tx) {
  tx.executeSql('CREATE TABLE IF NOT EXISTS ' +
      'notes(id TEXT PRIMARY KEY ASC, title TEXT, ' +
      'rating INTEGER, date DATE, notes TEXT, ' +
      'updated DATE, url TEXT UNIQUE)',
      [], // fields
      success, error);
});
db = openDatabase('Notes', '1.0', 'notes', 5242880);


db.transaction(function(tx) {
  tx.executeSql('CREATE TABLE IF NOT EXISTS ' +
      'notes(id TEXT PRIMARY KEY ASC, title TEXT, ' +
      'rating INTEGER, date DATE, notes TEXT, ' +
      'updated DATE, url TEXT UNIQUE)',
      [], // fields
      success, error);
});
db = openDatabase('Notes', '1.0', 'notes', 5242880);


db.transaction(function(tx) {
  tx.executeSql('CREATE TABLE IF NOT EXISTS ' +
      'notes(id TEXT PRIMARY KEY ASC, title TEXT, ' +
      'rating INTEGER, date DATE, notes TEXT, ' +
      'updated DATE, url TEXT UNIQUE)',
      [], // fields
      success, error);
});
db = openDatabase('Notes', '1.0', 'notes', 5242880);


db.transaction(function(tx) {
  tx.executeSql('CREATE TABLE IF NOT EXISTS ' +
      'notes(id TEXT PRIMARY KEY ASC, title TEXT, ' +
      'rating INTEGER, date DATE, notes TEXT, ' +
      'updated DATE, url TEXT UNIQUE)',
      [], // fields
      success, error);
});
db = openDatabase('Notes', '1.0', 'notes', 5242880);


db.transaction(function(tx) {
  tx.executeSql('CREATE TABLE IF NOT EXISTS ' +
      'notes(id TEXT PRIMARY KEY ASC, title TEXT, ' +
      'rating INTEGER, date DATE, notes TEXT, ' +
      'updated DATE, url TEXT UNIQUE)',
      [], // fields
      success, error);    Field values map to
});
                          '?' values in the SQL
db = openDatabase('Notes', '1.0', 'notes', 5242880);


db.transaction(function(tx) {
  tx.executeSql('CREATE TABLE IF NOT EXISTS ' +
      'notes(id TEXT PRIMARY KEY ASC, title TEXT, ' +
      'rating INTEGER, date DATE, notes TEXT, ' +
      'updated DATE, url TEXT UNIQUE)',
      [], // fields
      success, error);
});
๏ Atomic transactions
๏ Queues every request
๏ Good Safari support - i.e. iOS
๏ Fully featured debuggers available
IndexedDB



            http://flic.kr/p/5KXFwB
• Still very new
• Support will be further reaching
  than Web SQL (but unsure about
  Safari)

• Very, very difficult to debug atm.
var request = indexedDB.open('notes');
request.onerror = fail;
request.onsuccess = function (e) {
     db = e.target.result;
};



       Very, very object event based.
var setVRequest = db.setVersion(v);
setVRequest.onsuccess = function () {
     var store = db.createObjectStore(
                     'notes', {keyPath: 'id'});
     success(); // your callback
};




       Now create the actual data store
var RW = IDBTransaction.READ_WRITE;


var transaction = db.transaction(['notes'], RW, 0),
    store = transaction.objectStore('notes'),
    request = store.put(data);




    Get the object store and put in it
var RW = IDBTransaction.READ_WRITE;


var transaction = db.transaction(['notes'], RW, 0),
       store = transaction.objectStore('notes'),
       request = store.get(id);


request.onsuccess = function (event) {
     callback(event.target.result);
};




     On success, result is in event.target
Lawnchair
http://westcoastlogic.com/lawnchair/
History API



       http://flic.kr/p/a42tLM
function router(path) {
  if (path.indexOf('/conf') === 0) {
    showConferenceDetails(path.substr(5));
  } else if (path === '/about') {
    body.id = '';
    body.className = 'about';
  } else if (path === '/') {
    showConferences('next');
  } else {
    showConferences(path.substr(1));
  }
}
function router(path) {
  if (path.indexOf('/conf') === 0) {
    showConferenceDetails(path.substr(5));
  } else if (path === '/about') {
    body.id = '';
    body.className = 'about';
  } else if (path === '/') {
    showConferences('next');
  } else {
    showConferences(path.substr(1));
  }
}
router(location.pathname);
History API
history.pushState(state,title,url);

window.onpopstate = fn;
link.onclick = function (event) {
   event.preventDefault();
   showConferenceDetails(this.path);
   history.pushState('', '', this.path);
};
link.onclick = function (event) {
   event.preventDefault();
   showConferenceDetails(this.path);
   history.pushState('', '', this.path);
};
link.onclick = function (event) {
   event.preventDefault();
   showConferenceDetails(this.path);
   history.pushState('', '', this.path);
};
link.onclick = function (event) {
   event.preventDefault();
   showConferenceDetails(this.path);
   history.pushState('', '', this.path);
};
link.onclick = function (event) {
   event.preventDefault();
   showConferenceDetails(this.path);
   history.pushState('', '', this.path);
};
link.onclick = function (event) {
   event.preventDefault();
   showConferenceDetails(this.path);
   history.pushState('', '', this.path);
};


  Now our url matches the page
window.onpopstate = function () {
   router(location.pathname);
};
URLs FTW!



      http://flic.kr/p/a42tLM
What about when they request
 a URL that doesn't exist???
http://flic.kr/p/8zrMy8




Offline
<html manifest="myapp.appcache">
<html manifest="myapp.appcache">

Serve with text/manifest
<html manifest="myapp.appcache">

Serve with text/manifest

Set header cache-control: no-cache
<html manifest="myapp.appcache">

Serve with text/manifest

Set header cache-control: no-cache

starts with CACHE   MANIFEST
CACHE MANIFEST

/
range.js
datastore.js
chrome://appcache-internals
CACHE MANIFEST

/
index.html
range.js
datastore.js

FALLBACK:
# force everything through
# the index url
/ /

# this won't match
# anything unless it's on
# another domain
NETWORK:
*

# v4
CACHE MANIFEST

                    /
                    index.html
Served from cache   range.js
                    datastore.js

                    FALLBACK:
                    # force everything through
                    # the index url
                    / /

                    # this won't match
                    # anything unless it's on
                    # another domain
                    NETWORK:
                    *

                    # v4
CACHE MANIFEST

                          /
                          index.html
                          range.js
Requests for files not    datastore.js

found in the cache, are   FALLBACK:
                          # force everything through
     directed to /        # the index url
                          / /
    i.e. index.html
                          # this won't match
    (when offline).       # anything unless it's on
                          # another domain
                          NETWORK:
                          *

                          # v4
CACHE MANIFEST

                       /
                       index.html
                       range.js
                       datastore.js
Any requests to urls
                       FALLBACK:
that don't match / -   # force everything through
                       # the index url
  i.e. on another      / /

  domain, will be      # this won't match
                       # anything unless it's on
served through the     # another domain
                       NETWORK:
       web.            *

                       # v4
CACHE MANIFEST

                       /
                       index.html
                       range.js
                       datastore.js

                       FALLBACK:
                       # force everything through
                       # the index url
                       / /
   Also ensures
                       # this won't match
  browser even         # anything unless it's on
                       # another domain
attempts to load the   NETWORK:
                       *
       asset
                       # v4
CACHE MANIFEST

                       /
                       index.html
                       range.js
                       datastore.js

                       FALLBACK:
                       # force everything through
                       # the index url
                       / /
The contents of the
                       # this won't match
   manifest must       # anything unless it's on
                       # another domain
change to trigger an   NETWORK:
                       *
      update
                       # v4
/future

     /
And let the router code
   handle the path
CACHE MANIFEST

                          /
                          index.html
                          range.js
Requests for files not    datastore.js

found in the cache, are   FALLBACK:
                          # force everything through
     directed to /        # the index url
                          / /
    i.e. index.html
                          # this won't match
    (when offline).       # anything unless it's on
                          # another domain
                          NETWORK:
                          *

                          # v4
http://flic.kr/p/5rTP9f
• Web Storage for simple data
• Larger data in IndexedDB & Web SQL

• History for back button and url

• Offline to support our fake urls

                               http://flic.kr/p/5rTP9f
http://ftw.nodester.com
Thank you.
             http://flic.kr/p/8JS7km

More Related Content

What's hot

Masterclass Advanced Usage of the AWS CLI
Masterclass Advanced Usage of the AWS CLIMasterclass Advanced Usage of the AWS CLI
Masterclass Advanced Usage of the AWS CLIDanilo Poccia
 
codebits 2009 HTML5 JS APIs
codebits 2009 HTML5 JS APIscodebits 2009 HTML5 JS APIs
codebits 2009 HTML5 JS APIsRemy Sharp
 
Facebook的缓存系统
Facebook的缓存系统Facebook的缓存系统
Facebook的缓存系统yiditushe
 
Riak at The NYC Cloud Computing Meetup Group
Riak at The NYC Cloud Computing Meetup GroupRiak at The NYC Cloud Computing Meetup Group
Riak at The NYC Cloud Computing Meetup Groupsiculars
 
4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebookguoqing75
 
How containers helped a SaaS startup be developed and go live
How containers helped a SaaS startup be developed and go liveHow containers helped a SaaS startup be developed and go live
How containers helped a SaaS startup be developed and go liveRamon Navarro
 
Node js introduction
Node js introductionNode js introduction
Node js introductionAlex Su
 
HashiConf Digital 2020: HashiCorp Vault configuration as code via HashiCorp T...
HashiConf Digital 2020: HashiCorp Vault configuration as code via HashiCorp T...HashiConf Digital 2020: HashiCorp Vault configuration as code via HashiCorp T...
HashiConf Digital 2020: HashiCorp Vault configuration as code via HashiCorp T...Andrey Devyatkin
 
Apache CouchDB talk at Ontario GNU Linux Fest
Apache CouchDB talk at Ontario GNU Linux FestApache CouchDB talk at Ontario GNU Linux Fest
Apache CouchDB talk at Ontario GNU Linux FestMyles Braithwaite
 
Plone 5 and machine learning
Plone 5 and machine learningPlone 5 and machine learning
Plone 5 and machine learningRamon Navarro
 
WSO2Con USA 2015: Securing your APIs: Patterns and More
WSO2Con USA 2015: Securing your APIs: Patterns and MoreWSO2Con USA 2015: Securing your APIs: Patterns and More
WSO2Con USA 2015: Securing your APIs: Patterns and MoreWSO2
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyDavid Padbury
 
Beyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the codeBeyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the codeWim Godden
 
How to build a High Performance PSGI/Plack Server
How to build a High Performance PSGI/Plack Server How to build a High Performance PSGI/Plack Server
How to build a High Performance PSGI/Plack Server Masahiro Nagano
 
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript FrameworkAll Things Open
 
Deep Dive - Advanced Usage of the AWS CLI
Deep Dive - Advanced Usage of the AWS CLIDeep Dive - Advanced Usage of the AWS CLI
Deep Dive - Advanced Usage of the AWS CLIAmazon Web Services
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasminePaulo Ragonha
 

What's hot (20)

Masterclass Advanced Usage of the AWS CLI
Masterclass Advanced Usage of the AWS CLIMasterclass Advanced Usage of the AWS CLI
Masterclass Advanced Usage of the AWS CLI
 
codebits 2009 HTML5 JS APIs
codebits 2009 HTML5 JS APIscodebits 2009 HTML5 JS APIs
codebits 2009 HTML5 JS APIs
 
Facebook的缓存系统
Facebook的缓存系统Facebook的缓存系统
Facebook的缓存系统
 
Riak at The NYC Cloud Computing Meetup Group
Riak at The NYC Cloud Computing Meetup GroupRiak at The NYC Cloud Computing Meetup Group
Riak at The NYC Cloud Computing Meetup Group
 
4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook
 
How containers helped a SaaS startup be developed and go live
How containers helped a SaaS startup be developed and go liveHow containers helped a SaaS startup be developed and go live
How containers helped a SaaS startup be developed and go live
 
Django cryptography
Django cryptographyDjango cryptography
Django cryptography
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
 
HashiConf Digital 2020: HashiCorp Vault configuration as code via HashiCorp T...
HashiConf Digital 2020: HashiCorp Vault configuration as code via HashiCorp T...HashiConf Digital 2020: HashiCorp Vault configuration as code via HashiCorp T...
HashiConf Digital 2020: HashiCorp Vault configuration as code via HashiCorp T...
 
Performance patterns
Performance patternsPerformance patterns
Performance patterns
 
Apache CouchDB talk at Ontario GNU Linux Fest
Apache CouchDB talk at Ontario GNU Linux FestApache CouchDB talk at Ontario GNU Linux Fest
Apache CouchDB talk at Ontario GNU Linux Fest
 
About Data::ObjectDriver
About Data::ObjectDriverAbout Data::ObjectDriver
About Data::ObjectDriver
 
Plone 5 and machine learning
Plone 5 and machine learningPlone 5 and machine learning
Plone 5 and machine learning
 
WSO2Con USA 2015: Securing your APIs: Patterns and More
WSO2Con USA 2015: Securing your APIs: Patterns and MoreWSO2Con USA 2015: Securing your APIs: Patterns and More
WSO2Con USA 2015: Securing your APIs: Patterns and More
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
 
Beyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the codeBeyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the code
 
How to build a High Performance PSGI/Plack Server
How to build a High Performance PSGI/Plack Server How to build a High Performance PSGI/Plack Server
How to build a High Performance PSGI/Plack Server
 
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript Framework
 
Deep Dive - Advanced Usage of the AWS CLI
Deep Dive - Advanced Usage of the AWS CLIDeep Dive - Advanced Usage of the AWS CLI
Deep Dive - Advanced Usage of the AWS CLI
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
 

Similar to Forget the Web

HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsRemy Sharp
 
nodejs_at_a_glance.ppt
nodejs_at_a_glance.pptnodejs_at_a_glance.ppt
nodejs_at_a_glance.pptWalaSidhom1
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applicationsTom Croucher
 
Intro to IndexedDB (Beta)
Intro to IndexedDB (Beta)Intro to IndexedDB (Beta)
Intro to IndexedDB (Beta)Mike West
 
RESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingRESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingBertrand Delacretaz
 
UEMB200: Next Generation of Endpoint Management Architecture and Discovery Se...
UEMB200: Next Generation of Endpoint Management Architecture and Discovery Se...UEMB200: Next Generation of Endpoint Management Architecture and Discovery Se...
UEMB200: Next Generation of Endpoint Management Architecture and Discovery Se...Ivanti
 
BlackBerry DevCon 2011 - PhoneGap and WebWorks
BlackBerry DevCon 2011 - PhoneGap and WebWorksBlackBerry DevCon 2011 - PhoneGap and WebWorks
BlackBerry DevCon 2011 - PhoneGap and WebWorksmwbrooks
 
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...King Foo
 
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...SPTechCon
 
HTML5: huh, what is it good for?
HTML5: huh, what is it good for?HTML5: huh, what is it good for?
HTML5: huh, what is it good for?Remy Sharp
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCLFastly
 
Managing Your Content with Elasticsearch
Managing Your Content with ElasticsearchManaging Your Content with Elasticsearch
Managing Your Content with ElasticsearchSamantha Quiñones
 
JavaServer Faces 2.0 - JavaOne India 2011
JavaServer Faces 2.0 - JavaOne India 2011JavaServer Faces 2.0 - JavaOne India 2011
JavaServer Faces 2.0 - JavaOne India 2011Arun Gupta
 
Running Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeRunning Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeDanielle Madeley
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsBen Hall
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsasync_io
 
Hw09 Sqoop Database Import For Hadoop
Hw09   Sqoop Database Import For HadoopHw09   Sqoop Database Import For Hadoop
Hw09 Sqoop Database Import For HadoopCloudera, Inc.
 

Similar to Forget the Web (20)

HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & sockets
 
nodejs_at_a_glance.ppt
nodejs_at_a_glance.pptnodejs_at_a_glance.ppt
nodejs_at_a_glance.ppt
 
Hive
HiveHive
Hive
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
 
Intro to IndexedDB (Beta)
Intro to IndexedDB (Beta)Intro to IndexedDB (Beta)
Intro to IndexedDB (Beta)
 
RESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingRESTful Web Applications with Apache Sling
RESTful Web Applications with Apache Sling
 
UEMB200: Next Generation of Endpoint Management Architecture and Discovery Se...
UEMB200: Next Generation of Endpoint Management Architecture and Discovery Se...UEMB200: Next Generation of Endpoint Management Architecture and Discovery Se...
UEMB200: Next Generation of Endpoint Management Architecture and Discovery Se...
 
BlackBerry DevCon 2011 - PhoneGap and WebWorks
BlackBerry DevCon 2011 - PhoneGap and WebWorksBlackBerry DevCon 2011 - PhoneGap and WebWorks
BlackBerry DevCon 2011 - PhoneGap and WebWorks
 
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
 
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
 
Nodejs web,db,hosting
Nodejs web,db,hostingNodejs web,db,hosting
Nodejs web,db,hosting
 
HTML5: huh, what is it good for?
HTML5: huh, what is it good for?HTML5: huh, what is it good for?
HTML5: huh, what is it good for?
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCL
 
Managing Your Content with Elasticsearch
Managing Your Content with ElasticsearchManaging Your Content with Elasticsearch
Managing Your Content with Elasticsearch
 
JavaServer Faces 2.0 - JavaOne India 2011
JavaServer Faces 2.0 - JavaOne India 2011JavaServer Faces 2.0 - JavaOne India 2011
JavaServer Faces 2.0 - JavaOne India 2011
 
Running Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeRunning Django on Docker: a workflow and code
Running Django on Docker: a workflow and code
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based Deployments
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.js
 
Hw09 Sqoop Database Import For Hadoop
Hw09   Sqoop Database Import For HadoopHw09   Sqoop Database Import For Hadoop
Hw09 Sqoop Database Import For Hadoop
 

More from Remy Sharp

HTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymoreHTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymoreRemy Sharp
 
Yearning jQuery
Yearning jQueryYearning jQuery
Yearning jQueryRemy Sharp
 
Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Remy Sharp
 
Interaction Implementation
Interaction ImplementationInteraction Implementation
Interaction ImplementationRemy Sharp
 
jQuery: out with the old, in with the new
jQuery: out with the old, in with the newjQuery: out with the old, in with the new
jQuery: out with the old, in with the newRemy Sharp
 
Developing for Mobile
Developing for MobileDeveloping for Mobile
Developing for MobileRemy Sharp
 
Browsers with Wings
Browsers with WingsBrowsers with Wings
Browsers with WingsRemy Sharp
 
Webapps without the web
Webapps without the webWebapps without the web
Webapps without the webRemy Sharp
 
iPhone Appleless Apps
iPhone Appleless AppsiPhone Appleless Apps
iPhone Appleless AppsRemy Sharp
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009Remy Sharp
 
Write Less Do More
Write Less Do MoreWrite Less Do More
Write Less Do MoreRemy Sharp
 
HTML5 & Friends
HTML5 & FriendsHTML5 & Friends
HTML5 & FriendsRemy Sharp
 
jQuery Loves Developers - SWDC2009
jQuery Loves Developers - SWDC2009jQuery Loves Developers - SWDC2009
jQuery Loves Developers - SWDC2009Remy Sharp
 
DOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryDOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryRemy Sharp
 
Prototype & jQuery
Prototype & jQueryPrototype & jQuery
Prototype & jQueryRemy Sharp
 

More from Remy Sharp (17)

HTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymoreHTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymore
 
Yearning jQuery
Yearning jQueryYearning jQuery
Yearning jQuery
 
Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)
 
Interaction Implementation
Interaction ImplementationInteraction Implementation
Interaction Implementation
 
jQuery: out with the old, in with the new
jQuery: out with the old, in with the newjQuery: out with the old, in with the new
jQuery: out with the old, in with the new
 
Developing for Mobile
Developing for MobileDeveloping for Mobile
Developing for Mobile
 
Browsers with Wings
Browsers with WingsBrowsers with Wings
Browsers with Wings
 
Webapps without the web
Webapps without the webWebapps without the web
Webapps without the web
 
TwitterLib.js
TwitterLib.jsTwitterLib.js
TwitterLib.js
 
iPhone Appleless Apps
iPhone Appleless AppsiPhone Appleless Apps
iPhone Appleless Apps
 
jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009jQuery Loves Developers - Oredev 2009
jQuery Loves Developers - Oredev 2009
 
Write Less Do More
Write Less Do MoreWrite Less Do More
Write Less Do More
 
HTML5 & Friends
HTML5 & FriendsHTML5 & Friends
HTML5 & Friends
 
HTML5 JS APIs
HTML5 JS APIsHTML5 JS APIs
HTML5 JS APIs
 
jQuery Loves Developers - SWDC2009
jQuery Loves Developers - SWDC2009jQuery Loves Developers - SWDC2009
jQuery Loves Developers - SWDC2009
 
DOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQueryDOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQuery
 
Prototype & jQuery
Prototype & jQueryPrototype & jQuery
Prototype & jQuery
 

Recently uploaded

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
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
 
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
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
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
 
"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
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
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
 
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
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
"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
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 

Recently uploaded (20)

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
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
 
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
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
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
 
"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
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
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
 
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
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
"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
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 

Forget the Web

  • 1. F**get the Web http://flic.kr/p/8JS7km
  • 2.
  • 6. Change this to your Twitter username This is live now http://ftw.nodester.com
  • 9. •Web Storage • IndexedDB (where available) • Web SQL Databases • History API • Offline manifest http://flic.kr/p/5rTP9f
  • 11. ๏ Web Storage simple, and well supported IE8+ ๏ Web SQL has good mobile support, but no Firefox ๏ IndexedDB gives us coverage http://flic.kr/p/4HYNgX
  • 14. Not the edible kind, duh! Cookies suck.
  • 15. 1. Code for cookies difficult 2. Date format is fugly 3. Limitations in size and number 4. Deleting doesn't really delete 5. Sessions leak...but not always!
  • 17. Sexy Storage FTW http://flic.kr/p/3pBDzf
  • 18. localStorage no expiry required & persists • sessionStorage doesn't leak • Applied to document origin, i.e. scheme/host/port tuple • Insanely simple API
  • 20. var store = localStorage; store.name = 'remy';
  • 21. var store = localStorage; store.name = 'remy'; delete store.name;
  • 22. Values are coerced in to strings
  • 23. Values are coerced in to strings Work around: JSON (and http://www.json.org/json2.js)
  • 25. Gotcha The API isn't protected, you can, if you want to mess things up, do: localStorage.key = 'foo'; Now the key method is a string :(
  • 26. Web SQL Databases http://flic.kr/p/drmCJ
  • 27. ๏ SQLite based ๏ No longer actively maintained ๏ Good Safari support - i.e. iOS ๏ Fully featured debuggers available
  • 28. db = openDatabase('Notes', '1.0', 'notes', 5242880); db.transaction(function(tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS ' + 'notes(id TEXT PRIMARY KEY ASC, title TEXT, ' + 'rating INTEGER, date DATE, notes TEXT, ' + 'updated DATE, url TEXT UNIQUE)', [], // fields success, error); });
  • 29. db = openDatabase('Notes', '1.0', 'notes', 5242880); db.transaction(function(tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS ' + 'notes(id TEXT PRIMARY KEY ASC, title TEXT, ' + 'rating INTEGER, date DATE, notes TEXT, ' + 'updated DATE, url TEXT UNIQUE)', [], // fields success, error); });
  • 30. db = openDatabase('Notes', '1.0', 'notes', 5242880); db.transaction(function(tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS ' + 'notes(id TEXT PRIMARY KEY ASC, title TEXT, ' + 'rating INTEGER, date DATE, notes TEXT, ' + 'updated DATE, url TEXT UNIQUE)', [], // fields success, error); });
  • 31. db = openDatabase('Notes', '1.0', 'notes', 5242880); db.transaction(function(tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS ' + 'notes(id TEXT PRIMARY KEY ASC, title TEXT, ' + 'rating INTEGER, date DATE, notes TEXT, ' + 'updated DATE, url TEXT UNIQUE)', [], // fields success, error); });
  • 32. db = openDatabase('Notes', '1.0', 'notes', 5242880); db.transaction(function(tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS ' + 'notes(id TEXT PRIMARY KEY ASC, title TEXT, ' + 'rating INTEGER, date DATE, notes TEXT, ' + 'updated DATE, url TEXT UNIQUE)', [], // fields success, error); Field values map to }); '?' values in the SQL
  • 33. db = openDatabase('Notes', '1.0', 'notes', 5242880); db.transaction(function(tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS ' + 'notes(id TEXT PRIMARY KEY ASC, title TEXT, ' + 'rating INTEGER, date DATE, notes TEXT, ' + 'updated DATE, url TEXT UNIQUE)', [], // fields success, error); });
  • 34. ๏ Atomic transactions ๏ Queues every request ๏ Good Safari support - i.e. iOS ๏ Fully featured debuggers available
  • 35. IndexedDB http://flic.kr/p/5KXFwB
  • 36. • Still very new • Support will be further reaching than Web SQL (but unsure about Safari) • Very, very difficult to debug atm.
  • 37. var request = indexedDB.open('notes'); request.onerror = fail; request.onsuccess = function (e) { db = e.target.result; }; Very, very object event based.
  • 38. var setVRequest = db.setVersion(v); setVRequest.onsuccess = function () { var store = db.createObjectStore( 'notes', {keyPath: 'id'}); success(); // your callback }; Now create the actual data store
  • 39. var RW = IDBTransaction.READ_WRITE; var transaction = db.transaction(['notes'], RW, 0), store = transaction.objectStore('notes'), request = store.put(data); Get the object store and put in it
  • 40. var RW = IDBTransaction.READ_WRITE; var transaction = db.transaction(['notes'], RW, 0), store = transaction.objectStore('notes'), request = store.get(id); request.onsuccess = function (event) { callback(event.target.result); }; On success, result is in event.target
  • 42. History API http://flic.kr/p/a42tLM
  • 43.
  • 44.
  • 45. function router(path) { if (path.indexOf('/conf') === 0) { showConferenceDetails(path.substr(5)); } else if (path === '/about') { body.id = ''; body.className = 'about'; } else if (path === '/') { showConferences('next'); } else { showConferences(path.substr(1)); } }
  • 46. function router(path) { if (path.indexOf('/conf') === 0) { showConferenceDetails(path.substr(5)); } else if (path === '/about') { body.id = ''; body.className = 'about'; } else if (path === '/') { showConferences('next'); } else { showConferences(path.substr(1)); } }
  • 49. link.onclick = function (event) { event.preventDefault(); showConferenceDetails(this.path); history.pushState('', '', this.path); };
  • 50. link.onclick = function (event) { event.preventDefault(); showConferenceDetails(this.path); history.pushState('', '', this.path); };
  • 51. link.onclick = function (event) { event.preventDefault(); showConferenceDetails(this.path); history.pushState('', '', this.path); };
  • 52. link.onclick = function (event) { event.preventDefault(); showConferenceDetails(this.path); history.pushState('', '', this.path); };
  • 53. link.onclick = function (event) { event.preventDefault(); showConferenceDetails(this.path); history.pushState('', '', this.path); };
  • 54. link.onclick = function (event) { event.preventDefault(); showConferenceDetails(this.path); history.pushState('', '', this.path); }; Now our url matches the page
  • 55. window.onpopstate = function () { router(location.pathname); };
  • 56. URLs FTW! http://flic.kr/p/a42tLM
  • 57. What about when they request a URL that doesn't exist???
  • 59.
  • 62. <html manifest="myapp.appcache"> Serve with text/manifest Set header cache-control: no-cache
  • 63. <html manifest="myapp.appcache"> Serve with text/manifest Set header cache-control: no-cache starts with CACHE MANIFEST
  • 65.
  • 67. CACHE MANIFEST / index.html range.js datastore.js FALLBACK: # force everything through # the index url / / # this won't match # anything unless it's on # another domain NETWORK: * # v4
  • 68. CACHE MANIFEST / index.html Served from cache range.js datastore.js FALLBACK: # force everything through # the index url / / # this won't match # anything unless it's on # another domain NETWORK: * # v4
  • 69. CACHE MANIFEST / index.html range.js Requests for files not datastore.js found in the cache, are FALLBACK: # force everything through directed to / # the index url / / i.e. index.html # this won't match (when offline). # anything unless it's on # another domain NETWORK: * # v4
  • 70. CACHE MANIFEST / index.html range.js datastore.js Any requests to urls FALLBACK: that don't match / - # force everything through # the index url i.e. on another / / domain, will be # this won't match # anything unless it's on served through the # another domain NETWORK: web. * # v4
  • 71. CACHE MANIFEST / index.html range.js datastore.js FALLBACK: # force everything through # the index url / / Also ensures # this won't match browser even # anything unless it's on # another domain attempts to load the NETWORK: * asset # v4
  • 72. CACHE MANIFEST / index.html range.js datastore.js FALLBACK: # force everything through # the index url / / The contents of the # this won't match manifest must # anything unless it's on # another domain change to trigger an NETWORK: * update # v4
  • 73. /future / And let the router code handle the path
  • 74. CACHE MANIFEST / index.html range.js Requests for files not datastore.js found in the cache, are FALLBACK: # force everything through directed to / # the index url / / i.e. index.html # this won't match (when offline). # anything unless it's on # another domain NETWORK: * # v4
  • 76. • Web Storage for simple data • Larger data in IndexedDB & Web SQL • History for back button and url • Offline to support our fake urls http://flic.kr/p/5rTP9f
  • 78. Thank you. http://flic.kr/p/8JS7km