Hacker News new | past | comments | ask | show | jobs | submit login

What is a browser database and what is it good for? Would you use one instead of a back-end DB or in conjunction with one? How? Why? Why is this on 1st page - what is cool about it?

I'm clearly missing something, but I can't be bothered to watch the videos - can someone TL;DR it for me, please.




We have a web app that downloads a large list of simple repetitive maintenance tasks ("check amount of spare printer toner", "water the office plants", and such) with documentation, images, etc. that need to be performed regularly, and then shows the user that list so he can perform the tasks and send back the results. Some companies using this app do not allow internet access in the specific areas where tasks have to be performed, so some parts of the app have to work without it. Business requirement was "store enough info on the device to be able to run without internet access for one month".

Without an in-browser persistent database (we used WebSQL, with all the future risks), it would require some interesting workarounds (can you serialize multiple megabytes to local storage? how long will it take? will it rollback from a fault correctly?) or Phonegap type solutions.


Offline-first web apps. Think of all of the "native mobile apps" that could actually be done as a web app, but instead get built as native applications just because the application needs to store data.


Also Electron apps. It's currently pretty painful getting sqlite working with Electron, this could be a nice alternative.


Have you tried the emscripten port of SQLite? It's worked well for me... http://github.com/kripken/sql.js


I've tried it, the main problem I have withe it is that the whole DB has to be loaded into memory. It seems like it would be slow and unwieldy with even a moderate sized database. I'm still keeping it open as an option, but I like that Lovefield uses indexedb under the sheets.


It's like having PouchDB -> CouchDB but with SQL not NoSQL

For me I'd like to:

Firebase as backend. Sync user data to browser. Query user data elegantly in browser using select statements.


> It's like having PouchDB -> CouchDB but with SQL not NoSQL

Also, without the replication and conflict detection.


Have you seen http://gunDB.io (disclosure: I am the author)? It has what you are describing. As well as replication and conflict resolution that the other commenter mentions.


Better way to describe it was "like SQLite"


Any data-heavy applications that have significant grouping/filtering/etc.. SQL is very powerful, and when you try to work with large datasets in the browser, its kind of disappointing that you have to either transfer a lot of data on every data view change or do SQL's job with lodash collection methods.


I implemented a character manager using TaffyDB[1], loading lots of static data upfront. Made calculations using cross "table" lookups much simpler from a coding perspective.

[1] http://www.taffydb.com




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: