Your SlideShare is downloading. ×
Client Side Storage
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Client Side Storage

5,500
views

Published on

An overview of the APIs available on the client for storing data.

An overview of the APIs available on the client for storing data.

Published in: Technology, Business

2 Comments
5 Likes
Statistics
Notes
No Downloads
Views
Total Views
5,500
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
51
Comments
2
Likes
5
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Transcript

    • 1. more space… more opportunities…
    • 2. 97% Web browsers support it, yet 0.001% of Web sites use it ?
    • 3. Client Side Storage
      • There are more options than cookies!
      • More widespread support for local storage than currently recognised
    • 4.  
    • 5. Each to Their Own
      • Gears plugin
      • WHATWG DB
      • WHATWG Global/Session Storage
      • DHTML userData Behaviour
      • Flash cookies
    • 6. Gears
      • SQLite powered DB backend
      • no size limit on capacity (in the beta)
      • full text search
      • very low install base
    • 7. Gears
      • var db = google.gears.factory.create('beta.database');
      • db.open('database-test');
      • db.execute('CREATE TABLE IF NOT EXISTS Test
      • (Phrase text, Timestamp int)');
      • db.execute('INSERT INTO Test VALUES (?, ?)‘,
      • ['Monkey!', new Date().getTime()]);
      • var rs = db.execute(
      • 'SELECT * FROM Test ORDER BY Timestamp DESC');
      • while (rs.isValidRow()) {
      • alert(rs.field(0) + '@' + rs.field(1));
      • rs.next();
      • }
      • rs.close();
    • 8. WHATWG DB
      • SQLite powered DB backend
      • Supported by Safari 3.1+, WebKit
      • Asynchronous execution API
    • 9. WHATWG DB
      • var db = openDatabase("Test", "1.0", "HTML5 Database API example", 200000);
      • db.transaction(function (tx) {
      • tx.executeSql('CREATE TABLE IF NOT EXISTS Test
      • (Phrase text, Timestamp int)');
      • tx.executeSql('INSERT INTO Test VALUES (?, ?)',
      • ['Monkey!', new Date().getTime()]);
      • tx.executeSql('SELECT * FROM Test ORDER BY Timestamp DESC', [], function(tx, result) {
      • for (var i = 0; i < result.rows.length; ++i) { var row = result.rows.item(i);
      • alert(row['Phrase'] + '@' + row['Timestamp']);
      • }
      • }, function(tx, error) {
      • alert('Failed accessing database - ' + error.message);
      • });
      • });
    • 10. WHATWG Global Storage
      • FF 2.0+, IE 8.0
      • globalStorage and sessionStorage
      • Events are fired when keys are modified
      • up to 5MB per accessible bucket (e.g. www.meebo.com's bucket includes meebo.com)
    • 11. WHATWG Global Storage
    • 12. WHATWG Global Storage
      • function onStorage (e) {
      • e = e || event;
      • alert('Storage event fired for domain: ' + event.domain);
      • }
      • if (document.addEventListnener) {
      • document.addEventListener('storage', onStorage, false);
      • } else {
      • document.attachEvent('onstorage', onStorage);
      • }
      • var storage = globalStorage[location.hostname];
      • storage.user = 'paul';
    • 13. userData DHTML Behavior
      • IE 5.5+
      • Stores data in an XML document
      • 128KB per document and 1MB per domain
      • Uses DHTML Behaviors
    • 14. userData DHTML Behavior
      • var el = document.createElement('div');
      • el.addBehavior('#default#userData');
      • el.load('data');
      • el.setAttribute('user', 'paul');
      • el.save('data');
    • 15. Flash Cookies
      • 100KB of space and you can prompt the user to ask for more
      • You’ll need to include a SWF wrapper and use asynchronous calls
    • 16. but when can we use these next generation APIs…
    • 17. Browser Support
      • We tracked the support from our users on
      • meebo.com on Tuesday this week and…
      • 87% of users have flash
      • 74% of users have native client storage (whatwgdb, globalStorage, userData)
      • 97% of users have either flash or native storage
      • … only 96% of our users have cookies!
    • 18. Thanks! Paul Sowden [email_address]

    ×