edit-article
Home
Up
Delete
Article Name:
Article 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
Chapter ID/Name:
Status:
Write
Writing
Written
Add Photo:
Owner ID:
Content:
use HTML
Edit Content
<h1 style="text-align: center;">HTML5 Storage Wars - localStorage vs. IndexedDB vs. Web SQL</h1> <h2>[WHAT]</h2> <ol> <li>] 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:</li> </ol> <h2>[WHY]</h2> <ol> <li>] </li> </ol> <h2>[WHERE]</h2> <ol> <li><strong>] READ THE FULL ARTICLE</strong></li> <ol> <li>] <a href="http://csimms.botonomy.com/2011/05/html5-storage-wars-localstorage-vs-indexeddb-vs-web-sql.html" target="_blank">http://csimms.botonomy.com/2011/05/html5-storage-wars-localstorage-vs-indexeddb-vs-web-sql.html</a></li> </ol></ol> <h2>[WHEN]</h2> <ol> <li>] 2017-04-25</li> </ol> <h2>[EXAMPLE]</h2> <ol> <li><strong>] Web Storage -</strong> and specifically the localStorage part of it, is a really simple key/value persistence system.</li> <ol> <li>] PRO: Really simple API.</li> <li>] PRO: Already available in all major new browsers.</li> <li>] 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.</li> <li>] 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.</li> </ol> <li><strong>] IndexedDB -</strong> is basically a simple flat-file database with hierarchical key/value persistence and basic indexing.</li> <ol> <li>] PRO: If you're a NoSQL type of person, then this might fit the bill perfectly.</li> <li><span style="text-decoration: line-through;">] CON: Not yet available in most new browsers.</span></li> <li>] 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.</li> </ol> <li><strong>[DEPRECATED] Web Sql -</strong> 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).</li> <ol> <li>] PRO: Fast and pretty feature-rich sql implementation (besides select/insert/update/delete, you can do joins, inner selects, etc).</li> <li>] CON: Available in Chrome and webkit-based browsers (Safari, etc.) but not Firefox or IE.</li> <li>] 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.</li> </ol></ol> <div> </div> <h2>[HOW-TO]</h2> <ol> <li>]</li> </ol> <h2>[REFERENCE]</h2> <ol> <li>] SRC = g?=</li> <li>] find BM = indepth article comparing each of these technologies</li> <li>] </li> </ol> <h2>[RELATED]</h2> <div><ol> <li>] http://blogs.shephertz.com/2014/01/14/html5-learn-how-to-use-indexeddb/, SRC=g?='indexedDB', r# 1.7</li> </ol></div> <h1 style="text-align: center;"> </h1>