Is there a performant JSON based DB with a client side implementation?
Asked Answered
O

5

6

I found this question about SQL-like query libraries. What I am looking for is a library that allows queries on JSON objects, embedded in a client-side application (browser), as well as from a remote high performance dedicated database.

Ondine answered 16/11, 2013 at 9:18 Comment(0)
B
4

For the sake of completeness I'll throw out PouchDB and CouchDB.

Pouch for client side: http://pouchdb.com/ Couch for server side: http://couchdb.apache.org/

Buatti answered 21/11, 2013 at 16:56 Comment(1)
In particular in combination with Couchbase Sync Gateway. I cannot imagine a use case where you wan to the share the entire contents of your database with the rest of the universe.Mitre
I
2

I was searching for the same thing and after much searching suddenly came across NeDB, which now has a browser implementation.

https://github.com/louischatriot/nedb

Unlike PouchDB it has a Mongo-like query API.

Intelligibility answered 14/3, 2014 at 1:29 Comment(2)
Just a note that PouchDB now has a MongoDB-like query language via PouchDB-findCaterinacatering
This is a great option using the in-memory capabilities. Just add script tag nedb.min.js (browser out version) and start with var db = new Nedb(). (note that it can load and save files with ajax)Eckhardt
F
1

You could try couchbase lite (client side) that syncs with couchbase server.

http://www.couchbase.com/communities/couchbase-lite and http://www.couchbase.com/

It is a document based nosql database, querying isn't as rich as SQL but you have the ability to create additional indices on which to query your data by using couchbase views (map reduce jobs). These work both on the client and server, it also supports syncing between the device and server.

Fu answered 16/11, 2013 at 9:45 Comment(1)
I don't know how I missed this. I'll have a look at it.Ondine
E
1

(yes i'm late for the party)

There's also a good alternative today: https://github.com/typicode/lowdb. It uses lodash and a UMD build is available on unpkg for testing and quick prototyping:

<script src="https://unpkg.com/lodash@4/lodash.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/low.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/LocalStorage.min.js"></script>
<script>
  var adapter = new LocalStorage('db')
  var db = low(adapter)
</script>

Then, just use it like this:

// Add a post
db.get('posts')
  .push({ id: 1, title: 'lowdb is awesome'})
  .write()

db.get('posts')
  .find({ id: 1 })
  .value()

Here are more examples

Check the different adapters available

Eckhardt answered 18/9, 2020 at 18:6 Comment(0)
W
0

if you want to use SQL-query you could try N1QL. This extension to Couchbase allows you to query the system very similar to SQL-query. Also you should look at ElasticSearch. This is a very powerful search engine, but query language not SQL. Couchbase and ElasticSearch very well interact with each other via the plugin. Also OrientDB allows to do query on language very similar to SQL. I think it is possible to adapt OrientDB to json format. And of course there are MongoDB.

Welladvised answered 16/11, 2013 at 13:52 Comment(3)
I don't quite understand what do you mean by "work in a browser". I can say that Couchbase, ElasticSearch and MongoDB have Web Console, that makes it very easy to manage, and modify the database. Also ElasticSearch and Couchbase have a fairly rich REST-interface. If you explain in more detail what you mean by "work in a browser" maybe I could more accurately answer.Welladvised
N1QL will be part of couchbase in the future, currently its in pre production and doesn't have a fixed release date.Fu
By client side I mean they run on the client (in browser or in v8). I intend to use this for embedded apps.Ondine

© 2022 - 2024 — McMap. All rights reserved.