SlideShare a Scribd company logo
Client Side Storage
                  Star wars style
                  


     WebSQL and
     IndexedDB
Long time ago, in a galaxy far
far away …
Client storage
… 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

More Related Content

PPTX
Indexed DB
Parashuram N
 
PPTX
Indexed db - the store in the browser
Parashuram N
 
PDF
Building a spa_in_30min
Michael Hackstein
 
PDF
Rupy2012 ArangoDB Workshop Part2
ArangoDB Database
 
PDF
Couchdb Nosql
elliando dias
 
PDF
HTML5: Introduction
Guillermo Paz
 
PDF
Introduction to html & css
sesharao puvvada
 
PPT
W3Conf slides - The top web features from caniuse.com you can use today
adeveria
 
Indexed DB
Parashuram N
 
Indexed db - the store in the browser
Parashuram N
 
Building a spa_in_30min
Michael Hackstein
 
Rupy2012 ArangoDB Workshop Part2
ArangoDB Database
 
Couchdb Nosql
elliando dias
 
HTML5: Introduction
Guillermo Paz
 
Introduction to html & css
sesharao puvvada
 
W3Conf slides - The top web features from caniuse.com you can use today
adeveria
 

What's hot (20)

KEY
CouchDB introduction
Sander van de Graaf
 
PPTX
.Less - CSS done right
Daniel Hölbling
 
PDF
Introduction to couchdb
iammutex
 
PDF
Introduction to MongoDB
Justin Smestad
 
PPTX
Start using less css
Ali MasudianPour
 
PPTX
Intro To Mongo Db
chriskite
 
PDF
Who's afraid of front end databases?
Gil Fink
 
PDF
MongoDB at FrozenRails
Mike Dirolf
 
PDF
Aleact
Hyun Je Moon
 
PPTX
Basic JS
alexisabril
 
PPT
Web development basics (Part-1)
Rajat Pratap Singh
 
PPTX
JavaScript: Creative Coding for Browsers
noweverywhere
 
PPTX
Quick start guide to java script frameworks for sharepoint add ins oslo
Sonja Madsen
 
PPTX
JavaScript Frameworks for SharePoint add-ins Cambridge
Sonja Madsen
 
PDF
How Does the Internet Work? (Wix she codes; branch)
Dina Goldshtein
 
PDF
CouchDB in The Room
Makoto Ohnami
 
PPTX
Javascript
Mozxai
 
PPTX
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
Kyle Banerjee
 
PDF
On Again; Off Again - Benjamin Young - ebookcraft 2017
BookNet Canada
 
PPTX
Quick start guide to java script frameworks for sharepoint apps spsbe-2015
Sonja Madsen
 
CouchDB introduction
Sander van de Graaf
 
.Less - CSS done right
Daniel Hölbling
 
Introduction to couchdb
iammutex
 
Introduction to MongoDB
Justin Smestad
 
Start using less css
Ali MasudianPour
 
Intro To Mongo Db
chriskite
 
Who's afraid of front end databases?
Gil Fink
 
MongoDB at FrozenRails
Mike Dirolf
 
Aleact
Hyun Je Moon
 
Basic JS
alexisabril
 
Web development basics (Part-1)
Rajat Pratap Singh
 
JavaScript: Creative Coding for Browsers
noweverywhere
 
Quick start guide to java script frameworks for sharepoint add ins oslo
Sonja Madsen
 
JavaScript Frameworks for SharePoint add-ins Cambridge
Sonja Madsen
 
How Does the Internet Work? (Wix she codes; branch)
Dina Goldshtein
 
CouchDB in The Room
Makoto Ohnami
 
Javascript
Mozxai
 
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
Kyle Banerjee
 
On Again; Off Again - Benjamin Young - ebookcraft 2017
BookNet Canada
 
Quick start guide to java script frameworks for sharepoint apps spsbe-2015
Sonja Madsen
 
Ad

Viewers also liked (7)

PPTX
Understanding Javascript Engines
Parashuram N
 
PPTX
ReactJS Code Impact
Raymond McDermott
 
PPTX
IndexedDB - Querying and Performance
Parashuram N
 
PDF
Help Wanted: Projections of Jobs and Education Requirements Through 2018
CEW Georgetown
 
PDF
What's It Worth?: The Economic Value of College Majors
CEW Georgetown
 
PDF
Six Million Missing Jobs: The Lingering Pain of the Great Recession
CEW Georgetown
 
Understanding Javascript Engines
Parashuram N
 
ReactJS Code Impact
Raymond McDermott
 
IndexedDB - Querying and Performance
Parashuram N
 
Help Wanted: Projections of Jobs and Education Requirements Through 2018
CEW Georgetown
 
What's It Worth?: The Economic Value of College Majors
CEW Georgetown
 
Six Million Missing Jobs: The Lingering Pain of the Great Recession
CEW Georgetown
 
Ad

Similar to Client storage (20)

PDF
Using Spring with NoSQL databases (SpringOne China 2012)
Chris Richardson
 
PDF
Spring one2gx2010 spring-nonrelational_data
Roger Xia
 
PDF
Play Framework and Activator
Kevin Webber
 
PDF
High-Performance Storage Services with HailDB and Java
sunnygleason
 
PDF
Accelerating NoSQL
sunnygleason
 
PDF
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
OpenBlend society
 
PDF
MongoDB: a gentle, friendly overview
Antonio Pintus
 
PPTX
In-browser storage and me
Jason Casden
 
KEY
Hybrid MongoDB and RDBMS Applications
Steven Francia
 
PPT
Ruby On Rails
iradarji
 
PPT
Wmware NoSQL
Murat Çakal
 
KEY
Introduction to MongoDB
Sean Laurent
 
KEY
KeyValue Stores
Mauro Pompilio
 
PDF
Rapid Prototyping with Solr
Lucidworks (Archived)
 
PDF
Rapid prototyping with solr - By Erik Hatcher
lucenerevolution
 
PDF
Migrating structured data between Hadoop and RDBMS
Bouquet
 
PPTX
SQL To NoSQL - Top 6 Questions Before Making The Move
IBM Cloud Data Services
 
KEY
Why ruby and rails
Reuven Lerner
 
KEY
Introduction to Riak and Ripple (KC.rb)
Sean Cribbs
 
PPTX
Drop acid
Mike Feltman
 
Using Spring with NoSQL databases (SpringOne China 2012)
Chris Richardson
 
Spring one2gx2010 spring-nonrelational_data
Roger Xia
 
Play Framework and Activator
Kevin Webber
 
High-Performance Storage Services with HailDB and Java
sunnygleason
 
Accelerating NoSQL
sunnygleason
 
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
OpenBlend society
 
MongoDB: a gentle, friendly overview
Antonio Pintus
 
In-browser storage and me
Jason Casden
 
Hybrid MongoDB and RDBMS Applications
Steven Francia
 
Ruby On Rails
iradarji
 
Wmware NoSQL
Murat Çakal
 
Introduction to MongoDB
Sean Laurent
 
KeyValue Stores
Mauro Pompilio
 
Rapid Prototyping with Solr
Lucidworks (Archived)
 
Rapid prototyping with solr - By Erik Hatcher
lucenerevolution
 
Migrating structured data between Hadoop and RDBMS
Bouquet
 
SQL To NoSQL - Top 6 Questions Before Making The Move
IBM Cloud Data Services
 
Why ruby and rails
Reuven Lerner
 
Introduction to Riak and Ripple (KC.rb)
Sean Cribbs
 
Drop acid
Mike Feltman
 

Recently uploaded (20)

PPTX
Jared Gersun – Rising Tennis Star from Australia Breaking Limits at Just 16
jaredgersun22
 
PDF
Famous Cricketers Whose Divorces Shocked Fans.pdf
marketing674892
 
DOCX
FIFA 2026 Set to Make History as Soccer Surges in America.docx
FIFA World Cup Tickets
 
DOCX
FIFA World Cup Tickets Cristiano Ronaldo Tipped for Glory by Former Coach.docx
FIFA World Cup Tickets
 
DOCX
Soccer World Cup Tickets Messi’s Argentina Set for Finalissima Showdown with ...
Worldwideticketsandhospitality
 
DOCX
Trump’s Policies Unlikely to Derail FIFA 2026 Plans.docx
FIFA World Cup Tickets
 
PPTX
Best Fan Experience Pass me .pptxxxxxxxx
counterten
 
DOCX
Felix's Al Nassr Move Tied to Soccer World Cup, Ronaldo.docx
maqsoodbhatti2266
 
PDF
Blue Mind Bodysurfing - Fringe Magazine Volume 1, 2025
Spencer Dunlap
 
PPTX
A Sport Fort, get an insight on Badminton.pptx
asmiparents
 
PPTX
Jared Gersun – Rising Tennis Star from Australia Breaking Limits at Just 16
jaredgersun22
 
PDF
Inside the Career of a Sports Business Leader
Neil Horowitz
 
PDF
Best Fan Experience Pass me .pdfxxxxxxxx
counterten
 
PDF
Start Your Diving Journey - Be An Open Water Diver in Andaman
Seahawks Scuba
 
PDF
World Cup FIFA president Gianni Infantino wants soccer to be the No. 1 sport ...
FIFA World Cup Tickets
 
PDF
FIFA World Cup Tickets Red Stars of Turkiye Shine on Global Stage.pdf
Worldwideticketsandhospitality
 
PDF
Essence of Bodysurfing: Exploring the Cultural History of an Ancient Aquatic ...
Spencer Dunlap
 
PDF
World Cup Vancouver FIFA 2026 Planning Moves Forward with Anticipation.pdf
FIFA World Cup Tickets
 
DOCX
Eby Backs More FIFA 2026 Games for B.C..docx
FIFA World Cup Tickets
 
PPTX
Breaking Down the Battle: Tallon vs. Nepveu in a Micro Max Showdown for the Age.
Jeremy Tallon
 
Jared Gersun – Rising Tennis Star from Australia Breaking Limits at Just 16
jaredgersun22
 
Famous Cricketers Whose Divorces Shocked Fans.pdf
marketing674892
 
FIFA 2026 Set to Make History as Soccer Surges in America.docx
FIFA World Cup Tickets
 
FIFA World Cup Tickets Cristiano Ronaldo Tipped for Glory by Former Coach.docx
FIFA World Cup Tickets
 
Soccer World Cup Tickets Messi’s Argentina Set for Finalissima Showdown with ...
Worldwideticketsandhospitality
 
Trump’s Policies Unlikely to Derail FIFA 2026 Plans.docx
FIFA World Cup Tickets
 
Best Fan Experience Pass me .pptxxxxxxxx
counterten
 
Felix's Al Nassr Move Tied to Soccer World Cup, Ronaldo.docx
maqsoodbhatti2266
 
Blue Mind Bodysurfing - Fringe Magazine Volume 1, 2025
Spencer Dunlap
 
A Sport Fort, get an insight on Badminton.pptx
asmiparents
 
Jared Gersun – Rising Tennis Star from Australia Breaking Limits at Just 16
jaredgersun22
 
Inside the Career of a Sports Business Leader
Neil Horowitz
 
Best Fan Experience Pass me .pdfxxxxxxxx
counterten
 
Start Your Diving Journey - Be An Open Water Diver in Andaman
Seahawks Scuba
 
World Cup FIFA president Gianni Infantino wants soccer to be the No. 1 sport ...
FIFA World Cup Tickets
 
FIFA World Cup Tickets Red Stars of Turkiye Shine on Global Stage.pdf
Worldwideticketsandhospitality
 
Essence of Bodysurfing: Exploring the Cultural History of an Ancient Aquatic ...
Spencer Dunlap
 
World Cup Vancouver FIFA 2026 Planning Moves Forward with Anticipation.pdf
FIFA World Cup Tickets
 
Eby Backs More FIFA 2026 Games for B.C..docx
FIFA World Cup Tickets
 
Breaking Down the Battle: Tallon vs. Nepveu in a Micro Max Showdown for the Age.
Jeremy Tallon
 

Client storage

  • 1. Client Side Storage Star wars style  WebSQL and IndexedDB
  • 2. Long time ago, in a galaxy far far away …
  • 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