Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a reliable (single server) MongoDB alternative?

I like the idea of document databases, especially MongoDB. It allows for faster development as we don't have to adjust database schema's. However MongoDB doesn't support multi-document transactions and doesn't guarantee that modifications get written to disk immediately like normal databases (I know that you can make the time between flushes quite small, but it's still no guarantee).

Most of our projects are not that big that they need things like multi-server environments. So keeping that in mind. Are there any single server MongoDB-like document databases that support multi-document transactions and reliable flushing to disk?

like image 845
Tim Avatar asked Feb 19 '13 16:02

Tim


2 Answers

It might be worthwhile to look at ArangoDB. It is a multi model database with a flexible data model for documents, graphs, and key-values. With respect to your specific requirements, ArangoDB database has full ACID transactions which can span over multiple documents in the same collection as well as over multiple collections (see Transactions in ArangoDB). That is, you can execute a group of manipulations to your documents together in a transaction and have guaranteed atomicity and isolation. If you additionally set waitForSync: true (as described further down on said page), you get a guaranteed sync to disk before your transaction reports completion. Note that this happens automatically if your transaction spans multiple collections.

like image 129
Max Neunhöffer Avatar answered Nov 15 '22 20:11

Max Neunhöffer


A very short answer to your specific (but brief) requirements:

Are there any single server MongoDB-like document databases that support multi-document transactions and reliable flushing to disk?

  1. RavenDB [1] provides support for multi-doc transactions [2]. Unfortunately I don't know it handles durability.

  2. CouchDB [3] provides durable writes, but no multi-doc transactions

  3. RethinkDB [4] provides durable writes, but no multi-doc transactions.

So you might wonder what's different about these 3 solutions? Most of the time is their querying support (I'd say RethinkDB has the most advanced one covering pretty much all types of queries: sub-queries, JOINs, aggregations, etc.), their history (read: production readiness -- here I'd probably say CouchDB is in the lead), their distribution model (you mentioned that's not interesting for you), their licensing (RavenDB: commercial, CouchDB: Apache License, Rethinkdb: AGPL).

The next step would be for you to briefly look over their feature set and figure out which one comes close to your needs and give it a try.

like image 31
Alex Popescu Avatar answered Nov 15 '22 18:11

Alex Popescu