Echo JS 0.11.0

<~>
sbruchmann 3286 days ago.
Hello Community,

I’m currently investigating databases that one could use in an  Electron app and stumbled upon LevelDB. (Relations are not necessary, since I can do that in my business logic.)

There are some things that are quite compelling:

  - developed by Google
  - it is the backend for IndexedDB in Chrome
  - good ecosystem of third party modules

However, I’m still not solved on it. Has someone used it in a medium to large JavaScript project and can write a sentence or two about it?


Thanks in advance.

nolanlawson 3284 days ago. link 2 points
I'm a big fan of LevelDB and the Level community. PouchDB uses LevelDB under the hood, and we've optimized for several different storage engines (LevelDB, IndexedDB, WebSQL) across several different browsers and Node, so we've had an opportunity to compare the performance of all of them. And for our use-case and on Mac hardware anyway, LevelDB in Node is always the fastest (runner-up is WebSQL on Safari).

So if you are building for Electron and have a wealth of database options to choose from, it's hard to go wrong with LevelDB. :) Only downside is the complexity of re-building for Electron, but as timoxley says you can use level-js if that becomes an issue.
sanemat 3283 days ago. link 1 point
I built my application with electron and level-js.
https://github.com/lyrictenor/electron-triage-for-github/
(Triage for GitHub - Desktop app for dividing GitHub issues and pull-requests into go or no-go quickly.)

I read this wiki.
https://github.com/nwjs/nw.js/wiki/Save-persistent-data-in-app
And I want to use indexeddb or its wrapper.
I think mongo/couch interface is too heavy for my purpose.

Compiling embedded database is also too heavy for me.
So I choose level-js.

And I have a plan to port my app to react-native or cordova.
Then I can use the same interface. There is indexeddb with level-js (android), localstorage with fruitdown (ios).

I think realm is another choice. But they don't have JavaScript SDK yet.
timoxley 3284 days ago. link 1 point
Haven't  needed to use anything but key/value stores for the past four years, and have primarily used leveldb with great success. Ability to just npm install it removes a lot of hassle, plus it's very fast.

LevelDB is the right choice if you want to keep your persistence layer minimal. With smart choice of keys you can achieve a lot with very little. In fact, having no features can really help you to simplify your designs. 

The ecosystem is good: https://github.com/Level/levelup/wiki/Modules

Particularly recommend looking into a sublevel tool like level-sublevel or level-spaces but it's also easy enough to just split your keys into namespaces yourself.

Big benefit is you can also use the same API and much of the ecosystem in the browser with tools like level-js: https://www.npmjs.com/package/level-js
sbruchmann 3286 days ago. link 2 points
Thanks for your reply, @kyofight!

As @RangerMauve pointed out correctly, I need an embeddable database. And looking at the comparison, I’d still favour LevelDB over Redis, since Redis offers features I’ll never need. Keeping systems as simple as possible should be everyone’s goal ;)

Aside from that, I may should have explained my use case more: The electron app needs to store RSS feeds and their items, along with some additional metadata. Nothing complex.
RangerMauve 3286 days ago. link 2 points
Redis isn't embeddable, which as far as I understand is the main advantage of LevelDB. Especially, since this is proposed for an electron app.