Indexed DB


Published on

A refresher on IndexedDB, how the API evolved from its initial versions.
Example of LINQ on IndexedDB, IndexedDB-Jquery Plugin and some requirements from IndexedDB

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Indexed DB

  1. 1. IndexedDB<br />Designing the API<br />
  2. 2. Long time ago, in a galaxy far far away …<br />
  3. 3. Applications<br />Partially Connected Applications<br />Can work offline also <br />Email, Calendar, Source Control ? <br />Offline Applications<br />No connection to the internet required<br />Word processors, todo lists<br />Data Caches<br />Privacy, Save bandwidth,<br />Shopping carts, user preferences<br />
  4. 4. IndexedDB Example<br />... IndexedDB refresher...<br /><br />Database<br />Database<br />ObjectStore<br />Index<br />Index<br />key : value<br />search<br />key : value<br />Cursor on Index<br />Cursor on Index<br />ObjectStore<br />key : value<br />key : value<br />Cursor on Object Store<br />Cursor on Object Store<br />key : value<br />key : value<br />
  5. 5. Transactions : Explicit, auto-commit<br />Two Flavors <br />Async on Main browser thread<br />Sync on Web Workers<br />... more star wars like text ...<br />
  6. 6. Cookies – <br />Limited storage, key value pairs<br />and the cookie monster<br />Local Storage<br />Not a database, don’t fake it <br />… days of the old republic … <br />
  7. 7. ... restoring balance to the force ...<br />Google Gears:Database module<br />First release: 2007-05-31<br />Database API based on SQLite – built in DB<br />Web Database API<br />Dialect of SQLite 3 (ref)<br />Frozen (ref)<br />
  8. 8. … the birth of a hero …<br />WebSimpleDB<br />ISAM based store – influenced by Berkley DB<br />Concepts of Entity Store, Indexes, Cursors<br />Most APIs were synchronous<br />Async models – function callbacks<br />Entity Joins, Sequences and Queues<br />
  9. 9. Implemented in Chrome 12, Firefox 4.0, IE10<br />Uniform Requests API<br />Concrete Asynchronous API<br />Use Structured Cloning Algorithm<br />the dojo<br /><br />… the force is strong with this one.…<br />
  10. 10. Microsoft and Mozilla bless the youngling<br />Concept of requests introduced<br />Security concerns addressed<br />Authorization section<br />Privacy Section<br />No more joins, sequences, queues<br />Explicit transactions<br />… young hero shows promise…<br />
  11. 11. Come over to the dark side* <br />
  12. 12. … encountering the Sith Lord …<br />NoSQL<br />Really ? <br />No, No SQL <br />So what should I do for querying ? <br />You got Cursors, Indexes<br />But complex joins ? NoSQL ? <br />Build something on top, we need least common denominator<br />Fine, here is what I’ve done<br />SHOW ME <br />… Stop talking you will … <br />
  13. 13. … what a piece of junk! …<br />Language Integrated Query Language<br />Sounds like english – <br />from table in database, select something when some condition and order by something.<br />Why NoSQL ? <br />Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaghhhh<br /><br />Just an experiment, how about we team up and write a SQL wrapper on this and see how it looks like?<br /><br />
  14. 14. …the ability to speak doesn't make you intelligent …<br />Syntax looks verbose <br />I no Javascript, can I hazJquery? <br />IndexedDB Wrapper on Javascript<br />Less verbose with use of promises, implicit operations<br /><br />
  15. 15. … i find your lack of faith disturbing…<br />Multi Column Indexes – aka Joins <br />Perform union and intersection in JS ? <br />Full Text Search<br />Proposed, but punted to next version<br />DB rollback<br />Versions supported, but no DB version revert<br />Change Tracking and Sync with Server<br />I need to contact my mothership–the USS enterprise<br />
  16. 16. … always in motion is the future …<br />No DOM interaction<br />Impact of ECMA.Next<br />IndexedDB module <br />Promises<br />Iterators, Generators, Yield support<br />Save binary blobs<br />De-structuring assignments [x,y] = [1,2]<br />Classes as Object Schema <br />
  17. 17. May the force be with you<br /> <br />@nparashuram<br /><br />