Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Looking for distributed/scalable database solution where all nodes are read/write? Not MongoDB? [closed]

I'm looking to implement a database that can be widely distributed geographically and such that each node can be read/write with eventual consistency to all other nodes. Where should I be looking?

I thought that MongoDB seemed like a nice option for other reasons until I came to this concern. Apparently all MongoDB nodes are readable, but only a master is writable? Is there anyway to get around this? I can't allow a single point failure for writing to the database.

like image 345
JnBrymn Avatar asked Mar 25 '11 17:03

JnBrymn


People also ask

Why should I use MongoDB and not MySQL with node?

Even though Node. js works well with MySQL database, the perfect combination is a NoSQL like MongoDB wherein the schema need not be well-structured. MongoDB represents the data as a collection of documents rather than tables related by foreign keys.

Can MongoDB replace MySQL?

It's unlikely MongoDB will completely replace MySQL, but it's possible that both structured and unstructured databases will be used for different purposes in one environment. Developers interested in enterprise programming should learn both platforms to stay competitive in the job market.

Is MongoDB still popular?

MongoDB has become quite popular in the last few years with the number of users growing at almost the same rate as PostgreSQL. For a very different kind of database application, of course.

How does CouchDB support the CAP Theorem?

The CAP Theorem. The CAP theorem describes a few different strategies for distributing application logic across networks. CouchDB's solution uses replication to propagate application changes across participating nodes.


2 Answers

I just finished my review of several similar databases. I ended up with Mongo for different reasons. Riak and Cassandra are both implementations of Amazon's Dynamo, which could each do a good job of that. At the Riak site, they have good comparisons of Riak and a few other databases. For your specific question, I think both Riak and Cassandra handle writes on any node with a vector clock for Riak's commits, and a timestamp for Cassandra's to handle conflicts.

Other than that, you have a few other choices that may make sense:

  • HBase can do very big, can do concurrent writes on various nodes. It's design is good for many attributes on each document/record.
  • CouchDB has good multiple-write conflict support but with a simpler document space.
  • I read a good argument for schema-less MySQL here, with a nod to the still-green Drizzle

I'm not sure that's a complete answer. My search took several weeks and about 50 pages of notes, but if large, distributed, and safe writes are the big criteria, that should move you along.

like image 73
David Richards Avatar answered Sep 19 '22 16:09

David Richards


If your concern is about a single point of failure: MongoDB uses replicasets for distributing reads and sharding for distributing writes. To achieve what you are looking for you can shard your system with each shard being a replica set. If your primary in a shard dies then a new primary is automatically elected and hence is not a single point of failure. Note: MongoDB does not support multi-master replication

like image 39
Sridhar Avatar answered Sep 20 '22 16:09

Sridhar