SQLite-like alternative for MongoDB?

10.6k views Asked by At

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?

4

There are 4 answers

0
Hans Meiser On

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

https://github.com/hamiltop/MongoLiteDB

0
mikeal On

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.

0
RobKohr On

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.

0
Randal Schwartz On

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.