SlideShare uma empresa Scribd logo
1 de 25
Client Side Storage
                  Star wars style
                  


     WebSQL and
     IndexedDB
Long time ago, in a galaxy far
far away …
… days of the old republic …

 • Cookies –
   – Limited storage, key value pairs
 • Local/Session Storage
   – Store {Key,Value} pairs
   – Iterate over values
   – Synchronous, no transactions
   – Not a database, don‟t fake it
... restoring balance to the force ...

  • Google Gears:Database module
    – First release: 2007-05-31
    – Database API based on SQLite – built in DB


  • Web Database API
    – Dialect of SQLite 3 (ref)
    – Deprecated (ref)
... WebSql refresher...
 IndexedDB Example
           http://yourwebpage.com                                            search




                       Database                   Database

                     Transactions              Transactions

                                      Create table bookShop (key
                                      varchar(255), value varchar(255))

                                      Insert into bookShop values (“name”,
                                      “desc”)

                                      Drop table bookShop
                     SQLite Dialect
                                      Select * from bookShop where name =
                                      „name‟;
... an apprentice to a master ...
... an apprentice to a master ...

 • Powerful query capabilities
 • Familiar SQL syntax, easy for developers
 • Already supported by browsers, no better
   alternative.

    “User agents must implement the SQL
      dialect supported by Sqlite 3.6.19”
... Denying the destiny ...
... Denying the destiny ...
Come over to the dark side*
… the birth of a hero …

  • WebSimpleDB
    – ISAM based store – influenced by Berkley DB
    – Concepts of ObjectStores, Indexes, Cursors
    – Most APIs were synchronous
    – Async models – function callbacks
    – No SQL
… the force is strong with this one.…

  • Mozilla, Microsoft Bless youngling
    – Implemented in Chrome 12, Firefox 4.0, IE10
  • Simple implementation for browsers
    – Basic concepts like transactions
    – Async and Sync APIs
    – Libraries to enhance capabilities
... IndexedDB refresher...
 IndexedDB Example
           http://yourwebpage.com                                           search




                     Database                            Database

        Object Store                            Object Store

        key : value                  Index      key : value         Index
        key : value                             key : value
                                    Cursor on                   Cursor on
        key : value                  Index      key : value      Index

         Cursor on                               Cursor on
        Object Store                            Object Store
Demo time
… what a piece of junk! …
 • Specification still evolving
   – setVersion vs onupgradeneeded
   – IDBTransaction.READ_ONLY vs “readonly”
   – Mostly done, now the browsers need to catch
     up
 • No SQL
 • Verbose syntax – requests vs promises
… the alliance …
 • https://github.com/axemclion/jquery-
   indexeddb
 • http://linq2indexeddb.codeplex.com/
 • https://github.com/superfeedr/indexeddb-
   backbonejs-adapter
 • https://github.com/philikon/queryIndexedD
   B
 • http://gazeljs.org/
 • http://aaronpowell.github.com/db.js/
… for the rest of us …
… for the rest of us …
... The grand plan …
… The grand plan …
   - IndexedDB Shim over WebSql
      - http://nparashuram.com/IndexedDB/polyfill
   - WebSql shims over Flash, etc.

   - Or use the libraries
… the alliance …
… the alliance …
•   Lawnchair
•   persistence.js
•   persistJS
•   amplify.store
•   localStorageDB
•   realStorage
•   YUI3 CacheOffline
•   dojox.storage
•   DomSQL
•   Impel
•   ActiveJS ActiveRecord
•   JazzRecord
•   picnet.data.DataManager
•   ShinyCar
•   Lscache
•   Kizzy
•   Artemia
•   microcache.js
•   Store.js
… always in motion is the future …
 • Impact of ECMA.Next
   –   IndexedDB module
   –   Promises
   –   Iterators, Generators, Yield support
   –   Save binary blobs
   –   De-structuring assignments [x,y] = [1,2]
   –   Classes as Object Schema
http://nparashuram.com/IndexedDB
May the force be with you




        @
        http://nparashuram.com

Mais conteúdo relacionado

Mais procurados

Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Justin Smestad
 
Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Db
chriskite
 
JavaScript: Creative Coding for Browsers
JavaScript: Creative Coding for BrowsersJavaScript: Creative Coding for Browsers
JavaScript: Creative Coding for Browsers
noweverywhere
 

Mais procurados (20)

CouchDB introduction
CouchDB introductionCouchDB introduction
CouchDB introduction
 
.Less - CSS done right
.Less - CSS done right.Less - CSS done right
.Less - CSS done right
 
Introduction to couchdb
Introduction to couchdbIntroduction to couchdb
Introduction to couchdb
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Start using less css
Start using less cssStart using less css
Start using less css
 
Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Db
 
Who's afraid of front end databases?
Who's afraid of front end databases?Who's afraid of front end databases?
Who's afraid of front end databases?
 
MongoDB at FrozenRails
MongoDB at FrozenRailsMongoDB at FrozenRails
MongoDB at FrozenRails
 
Aleact
AleactAleact
Aleact
 
Basic JS
Basic JSBasic JS
Basic JS
 
Web development basics (Part-1)
Web development basics (Part-1)Web development basics (Part-1)
Web development basics (Part-1)
 
JavaScript: Creative Coding for Browsers
JavaScript: Creative Coding for BrowsersJavaScript: Creative Coding for Browsers
JavaScript: Creative Coding for Browsers
 
Quick start guide to java script frameworks for sharepoint add ins oslo
Quick start guide to java script frameworks for sharepoint add ins osloQuick start guide to java script frameworks for sharepoint add ins oslo
Quick start guide to java script frameworks for sharepoint add ins oslo
 
JavaScript Frameworks for SharePoint add-ins Cambridge
JavaScript Frameworks for SharePoint add-ins CambridgeJavaScript Frameworks for SharePoint add-ins Cambridge
JavaScript Frameworks for SharePoint add-ins Cambridge
 
How Does the Internet Work? (Wix she codes; branch)
How Does the Internet Work? (Wix she codes; branch)How Does the Internet Work? (Wix she codes; branch)
How Does the Internet Work? (Wix she codes; branch)
 
CouchDB in The Room
CouchDB in The RoomCouchDB in The Room
CouchDB in The Room
 
Javascript
JavascriptJavascript
Javascript
 
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
Dropping ACID: Wrapping Your Mind Around NoSQL DatabasesDropping ACID: Wrapping Your Mind Around NoSQL Databases
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
 
On Again; Off Again - Benjamin Young - ebookcraft 2017
On Again; Off Again - Benjamin Young - ebookcraft 2017On Again; Off Again - Benjamin Young - ebookcraft 2017
On Again; Off Again - Benjamin Young - ebookcraft 2017
 
Quick start guide to java script frameworks for sharepoint apps spsbe-2015
Quick start guide to java script frameworks for sharepoint apps spsbe-2015Quick start guide to java script frameworks for sharepoint apps spsbe-2015
Quick start guide to java script frameworks for sharepoint apps spsbe-2015
 

Destaque

Destaque (7)

Understanding Javascript Engines
Understanding Javascript Engines Understanding Javascript Engines
Understanding Javascript Engines
 
ReactJS Code Impact
ReactJS Code ImpactReactJS Code Impact
ReactJS Code Impact
 
IndexedDB - Querying and Performance
IndexedDB - Querying and PerformanceIndexedDB - Querying and Performance
IndexedDB - Querying and Performance
 
Help Wanted: Projections of Jobs and Education Requirements Through 2018
Help Wanted: Projections of Jobs and Education Requirements Through 2018Help Wanted: Projections of Jobs and Education Requirements Through 2018
Help Wanted: Projections of Jobs and Education Requirements Through 2018
 
STEM
STEMSTEM
STEM
 
What's It Worth?: The Economic Value of College Majors
What's It Worth?: The Economic Value of College MajorsWhat's It Worth?: The Economic Value of College Majors
What's It Worth?: The Economic Value of College Majors
 
Six Million Missing Jobs: The Lingering Pain of the Great Recession
Six Million Missing Jobs: The Lingering Pain of the Great Recession Six Million Missing Jobs: The Lingering Pain of the Great Recession
Six Million Missing Jobs: The Lingering Pain of the Great Recession
 

Semelhante a Client storage

Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
OpenBlend society
 
Hybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS ApplicationsHybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS Applications
Steven Francia
 
Introduction to Riak and Ripple (KC.rb)
Introduction to Riak and Ripple (KC.rb)Introduction to Riak and Ripple (KC.rb)
Introduction to Riak and Ripple (KC.rb)
Sean Cribbs
 

Semelhante a Client storage (20)

Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
 
Spring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_dataSpring one2gx2010 spring-nonrelational_data
Spring one2gx2010 spring-nonrelational_data
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and Activator
 
High-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and JavaHigh-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and Java
 
Accelerating NoSQL
Accelerating NoSQLAccelerating NoSQL
Accelerating NoSQL
 
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
 
MongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overviewMongoDB: a gentle, friendly overview
MongoDB: a gentle, friendly overview
 
In-browser storage and me
In-browser storage and meIn-browser storage and me
In-browser storage and me
 
Hybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS ApplicationsHybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS Applications
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
Wmware NoSQL
Wmware NoSQLWmware NoSQL
Wmware NoSQL
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
KeyValue Stores
KeyValue StoresKeyValue Stores
KeyValue Stores
 
Rapid Prototyping with Solr
Rapid Prototyping with SolrRapid Prototyping with Solr
Rapid Prototyping with Solr
 
Rapid prototyping with solr - By Erik Hatcher
Rapid prototyping with solr -  By Erik Hatcher Rapid prototyping with solr -  By Erik Hatcher
Rapid prototyping with solr - By Erik Hatcher
 
Migrating structured data between Hadoop and RDBMS
Migrating structured data between Hadoop and RDBMSMigrating structured data between Hadoop and RDBMS
Migrating structured data between Hadoop and RDBMS
 
SQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The MoveSQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The Move
 
Why ruby and rails
Why ruby and railsWhy ruby and rails
Why ruby and rails
 
Introduction to Riak and Ripple (KC.rb)
Introduction to Riak and Ripple (KC.rb)Introduction to Riak and Ripple (KC.rb)
Introduction to Riak and Ripple (KC.rb)
 
Drop acid
Drop acidDrop acid
Drop acid
 

Último

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
Asli Kala jadu, Black magic specialist in Pakistan Or Kala jadu expert in Egy...
Asli Kala jadu, Black magic specialist in Pakistan Or Kala jadu expert in Egy...Asli Kala jadu, Black magic specialist in Pakistan Or Kala jadu expert in Egy...
Asli Kala jadu, Black magic specialist in Pakistan Or Kala jadu expert in Egy...
baharayali
 

Último (20)

Netherlands Players expected to miss UEFA Euro 2024 due to injury.docx
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docxNetherlands Players expected to miss UEFA Euro 2024 due to injury.docx
Netherlands Players expected to miss UEFA Euro 2024 due to injury.docx
 
Technical Data | Sig Sauer Easy6 BDX 1-6x24 | Optics Trade
Technical Data | Sig Sauer Easy6 BDX 1-6x24 | Optics TradeTechnical Data | Sig Sauer Easy6 BDX 1-6x24 | Optics Trade
Technical Data | Sig Sauer Easy6 BDX 1-6x24 | Optics Trade
 
Trossard's Message Bridging Celebrities and Sports in Euro Cup 2024.docx
Trossard's Message Bridging Celebrities and Sports in Euro Cup 2024.docxTrossard's Message Bridging Celebrities and Sports in Euro Cup 2024.docx
Trossard's Message Bridging Celebrities and Sports in Euro Cup 2024.docx
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Croatia vs Italy Euro Cup 2024 Three pitfalls for Spalletti’s Italy in Group ...
Croatia vs Italy Euro Cup 2024 Three pitfalls for Spalletti’s Italy in Group ...Croatia vs Italy Euro Cup 2024 Three pitfalls for Spalletti’s Italy in Group ...
Croatia vs Italy Euro Cup 2024 Three pitfalls for Spalletti’s Italy in Group ...
 
Spain Vs Italy 20 players confirmed for Spain's Euro 2024 squad, and three po...
Spain Vs Italy 20 players confirmed for Spain's Euro 2024 squad, and three po...Spain Vs Italy 20 players confirmed for Spain's Euro 2024 squad, and three po...
Spain Vs Italy 20 players confirmed for Spain's Euro 2024 squad, and three po...
 
Ramban Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts In...
Ramban  Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts In...Ramban  Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts In...
Ramban Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts In...
 
Who Is Emmanuel Katto Uganda? His Career, personal life etc.
Who Is Emmanuel Katto Uganda? His Career, personal life etc.Who Is Emmanuel Katto Uganda? His Career, personal life etc.
Who Is Emmanuel Katto Uganda? His Career, personal life etc.
 
JORNADA 5 LIGA MURO 2024INSUGURACION.pdf
JORNADA 5 LIGA MURO 2024INSUGURACION.pdfJORNADA 5 LIGA MURO 2024INSUGURACION.pdf
JORNADA 5 LIGA MURO 2024INSUGURACION.pdf
 
Personal Brand Exploration - By Bradley Dennis
Personal Brand Exploration - By Bradley DennisPersonal Brand Exploration - By Bradley Dennis
Personal Brand Exploration - By Bradley Dennis
 
Spain Vs Italy Spain to be banned from participating in Euro 2024.docx
Spain Vs Italy Spain to be banned from participating in Euro 2024.docxSpain Vs Italy Spain to be banned from participating in Euro 2024.docx
Spain Vs Italy Spain to be banned from participating in Euro 2024.docx
 
UEFA Euro 2024 Squad Check-in Who is Most Favorite.docx
UEFA Euro 2024 Squad Check-in Who is Most Favorite.docxUEFA Euro 2024 Squad Check-in Who is Most Favorite.docx
UEFA Euro 2024 Squad Check-in Who is Most Favorite.docx
 
Unveiling the Mystery of Main Bazar Chart
Unveiling the Mystery of Main Bazar ChartUnveiling the Mystery of Main Bazar Chart
Unveiling the Mystery of Main Bazar Chart
 
Asli Kala jadu, Black magic specialist in Pakistan Or Kala jadu expert in Egy...
Asli Kala jadu, Black magic specialist in Pakistan Or Kala jadu expert in Egy...Asli Kala jadu, Black magic specialist in Pakistan Or Kala jadu expert in Egy...
Asli Kala jadu, Black magic specialist in Pakistan Or Kala jadu expert in Egy...
 
Slovenia Vs Serbia UEFA Euro 2024 Fixture Guide Every Fixture Detailed.docx
Slovenia Vs Serbia UEFA Euro 2024 Fixture Guide Every Fixture Detailed.docxSlovenia Vs Serbia UEFA Euro 2024 Fixture Guide Every Fixture Detailed.docx
Slovenia Vs Serbia UEFA Euro 2024 Fixture Guide Every Fixture Detailed.docx
 
WhatsApp Chat: 📞 8617697112 Birbhum Call Girl available for hotel room package
WhatsApp Chat: 📞 8617697112 Birbhum  Call Girl available for hotel room packageWhatsApp Chat: 📞 8617697112 Birbhum  Call Girl available for hotel room package
WhatsApp Chat: 📞 8617697112 Birbhum Call Girl available for hotel room package
 
Hire 💕 8617697112 Kasauli Call Girls Service Call Girls Agency
Hire 💕 8617697112 Kasauli Call Girls Service Call Girls AgencyHire 💕 8617697112 Kasauli Call Girls Service Call Girls Agency
Hire 💕 8617697112 Kasauli Call Girls Service Call Girls Agency
 
Sports Writing (Rules,Tips, Examples, etc)
Sports Writing (Rules,Tips, Examples, etc)Sports Writing (Rules,Tips, Examples, etc)
Sports Writing (Rules,Tips, Examples, etc)
 
TAM Sports_IPL 17 Till Match 37_Celebrity Endorsement _Report.pdf
TAM Sports_IPL 17 Till Match 37_Celebrity Endorsement _Report.pdfTAM Sports_IPL 17 Till Match 37_Celebrity Endorsement _Report.pdf
TAM Sports_IPL 17 Till Match 37_Celebrity Endorsement _Report.pdf
 
Spain Vs Albania- Spain at risk of being thrown out of Euro 2024 with Tournam...
Spain Vs Albania- Spain at risk of being thrown out of Euro 2024 with Tournam...Spain Vs Albania- Spain at risk of being thrown out of Euro 2024 with Tournam...
Spain Vs Albania- Spain at risk of being thrown out of Euro 2024 with Tournam...
 

Client storage

  • 1. Client Side Storage Star wars style  WebSQL and IndexedDB
  • 2. Long time ago, in a galaxy far far away …
  • 3.
  • 4. … days of the old republic … • Cookies – – Limited storage, key value pairs • Local/Session Storage – Store {Key,Value} pairs – Iterate over values – Synchronous, no transactions – Not a database, don‟t fake it
  • 5. ... restoring balance to the force ... • Google Gears:Database module – First release: 2007-05-31 – Database API based on SQLite – built in DB • Web Database API – Dialect of SQLite 3 (ref) – Deprecated (ref)
  • 6. ... WebSql refresher... IndexedDB Example http://yourwebpage.com search Database Database Transactions Transactions Create table bookShop (key varchar(255), value varchar(255)) Insert into bookShop values (“name”, “desc”) Drop table bookShop SQLite Dialect Select * from bookShop where name = „name‟;
  • 7. ... an apprentice to a master ...
  • 8. ... an apprentice to a master ... • Powerful query capabilities • Familiar SQL syntax, easy for developers • Already supported by browsers, no better alternative. “User agents must implement the SQL dialect supported by Sqlite 3.6.19”
  • 9. ... Denying the destiny ...
  • 10. ... Denying the destiny ...
  • 11. Come over to the dark side*
  • 12. … the birth of a hero … • WebSimpleDB – ISAM based store – influenced by Berkley DB – Concepts of ObjectStores, Indexes, Cursors – Most APIs were synchronous – Async models – function callbacks – No SQL
  • 13. … the force is strong with this one.… • Mozilla, Microsoft Bless youngling – Implemented in Chrome 12, Firefox 4.0, IE10 • Simple implementation for browsers – Basic concepts like transactions – Async and Sync APIs – Libraries to enhance capabilities
  • 14. ... IndexedDB refresher... IndexedDB Example http://yourwebpage.com search Database Database Object Store Object Store key : value Index key : value Index key : value key : value Cursor on Cursor on key : value Index key : value Index Cursor on Cursor on Object Store Object Store
  • 16. … what a piece of junk! … • Specification still evolving – setVersion vs onupgradeneeded – IDBTransaction.READ_ONLY vs “readonly” – Mostly done, now the browsers need to catch up • No SQL • Verbose syntax – requests vs promises
  • 17. … the alliance … • https://github.com/axemclion/jquery- indexeddb • http://linq2indexeddb.codeplex.com/ • https://github.com/superfeedr/indexeddb- backbonejs-adapter • https://github.com/philikon/queryIndexedD B • http://gazeljs.org/ • http://aaronpowell.github.com/db.js/
  • 18. … for the rest of us …
  • 19. … for the rest of us …
  • 20. ... The grand plan …
  • 21. … The grand plan … - IndexedDB Shim over WebSql - http://nparashuram.com/IndexedDB/polyfill - WebSql shims over Flash, etc. - Or use the libraries
  • 23. … the alliance … • Lawnchair • persistence.js • persistJS • amplify.store • localStorageDB • realStorage • YUI3 CacheOffline • dojox.storage • DomSQL • Impel • ActiveJS ActiveRecord • JazzRecord • picnet.data.DataManager • ShinyCar • Lscache • Kizzy • Artemia • microcache.js • Store.js
  • 24. … always in motion is the future … • Impact of ECMA.Next – IndexedDB module – Promises – Iterators, Generators, Yield support – Save binary blobs – De-structuring assignments [x,y] = [1,2] – Classes as Object Schema
  • 25. http://nparashuram.com/IndexedDB May the force be with you @ http://nparashuram.com