article

HTML5 Storage Wars - localStorage vs. IndexedDB vs. Web SQL

[WHAT]

  1. ] by csimms @ botonomy.com - Currently, there are three competing approaches for saving serious amounts of data (i.e., persistently, and bigger than cookies) locally in your browser:

[WHY]

[WHERE]

  1. ] READ THE FULL ARTICLE
    1. http://csimms.botonomy.com/2011/05/html5-storage-wars-localstorage-vs-indexeddb-vs-web-sql.html

[WHEN]

  1. ] 2017-04-25

[EXAMPLE]

  1. ] Web Storage - and specifically the localStorage part of it, is a really simple key/value persistence system.
    1. ] PRO: Really simple API.
    2. ] PRO: Already available in all major new browsers.
    3. ] CON: No query language, schemas, really nothing you'd normally call a database. So it wouldn't scale well where you need to impose organization on a larger data set.
    4. ] CON: They didn't put transactional safety into the standard. I don't think I can sleep at night with an app running that might have race conditions and then have the risk of corrupt data.
  2. ] IndexedDB - is basically a simple flat-file database with hierarchical key/value persistence and basic indexing.
    1. ] PRO: If you're a NoSQL type of person, then this might fit the bill perfectly.
    2. ] CON: Not yet available in most new browsers.
    3. ] CON: If you wanted SQL, you're not getting it here. Though in the future, it might be a great building block for implementing a SQL engine for the browser.
  3. [DEPRECATED] Web Sql - is basically sqlite embedded into the browser. I've used sqlite off-and-on for a few years. At first I was turned off by the name (excuse my superficiality) and by the architecture (just a flat file database). But after digging into it, I found that it's a rock solid platform, and great for production use, as long as you keep in mind its limitations. Its limitations aren't so much size (I think you can go at least 1 GB without a problem), but inherent in flat file databases (high levels of concurrency) and missing features (stored procs and other higher-end database features).
    1. ] PRO: Fast and pretty feature-rich sql implementation (besides select/insert/update/delete, you can do joins, inner selects, etc).
    2. ] CON: Available in Chrome and webkit-based browsers (Safari, etc.) but not Firefox or IE.
    3. ] CON: The darn W3C Working Group has put a hold on the standard since they say they want at least two independent implementations of the standard, and there's only one so far, since everybody is using sqlite.
 

[HOW-TO]

  1. ]

[REFERENCE]

  1. ] SRC = g?=
  2. ] find BM = indepth article comparing each of these technologies

[RELATED]

  1. ] http://blogs.shephertz.com/2014/01/14/html5-learn-how-to-use-indexeddb/, SRC=g?='indexedDB', r# 1.7

 

Details Photos Edit more

Details

ID: 5715

NAME: HTML5-storage-wars-localStorage-vs-IndexedDB-vs-webSQL

DESCRIPTION: ] by csimms @ botonomy.com - Currently, there are three competing approaches for saving serious amounts of data (i.e., persistently, and bigger than cookies) locally in your browser

AUTHOR: article.author/s

EDITOR: article.editor/s

PUBLISHER: article.publisher/s

STATUS: Write

PRIORITY: -5

OWNER ID: 75

Content Photos Edit more

photos

page_photo

actions

Email Email-Owner SMS and