Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQLite-like alternative for MongoDB? [closed]

I'm looking for a document-oriented db with a Ruby API that has SQLite-like properties:

  • self-contained,
  • serverless,
  • zero-configuration.

Are there light alternatives to MongoDB or CouchDB?

Is RDDB a possibility?

If not, what are the best paths to walk then?

like image 743
davidbe Avatar asked Feb 21 '10 19:02

davidbe


People also ask

Is SQLite like MongoDB?

MongoDB is similar to SQLite in that it uses a file oriented approach to database management. However, it implements this a little differently. It uses a document-orientated database or document store which uses a JSON like syntax. As such, MongoDB is referred to as NoSQL.

Does SQLite support NoSQL?

SQLite has a backend which is well suited as a key-value store. Here is a NoSql database based on the SQLite backend: https://github.com/rochus-keller/Udb.


4 Answers

I know, the question was asked 5 years ago, but just for completeness' sake, embedded MongoDB has happened since:

https://github.com/hamiltop/MongoLiteDB

like image 192
Hans Meiser Avatar answered Oct 06 '22 03:10

Hans Meiser


It's not ready yet, but embeddable version of CouchDB are on the long term roadmap.

Replication is intended to enable offline applications with CouchDB. If you ended up with very specific needs you could replicate data from couchdb to a local datastructure, store it locally, update it, and push the data back via replication but it would take some code.

like image 36
mikeal Avatar answered Oct 06 '22 01:10

mikeal


If you were using Perl, I'd recommend DBM::Deep, which stores arbitrary data structures on disk, including transactions with commit/rollback, and it's a non-C one-Perl-module install. Doesn't get much lighter than that.

like image 45
Randal Schwartz Avatar answered Oct 06 '22 02:10

Randal Schwartz


I almost feel you could do some sort of hack to achieve this.

Have a table using sqlite's row ids along with a field for collection name and text blob that would be json code.

Have another table for indexing with fields in a collection (collection name, field name, field value, document row id).

You could do some wrapper class to handle things like updates and lookups. Would be interesting.

like image 25
RobKohr Avatar answered Oct 06 '22 02:10

RobKohr