42

What are the strengths and weaknesses of the various NoSQL databases available?

In particular, it seems like Redis is weak when it comes to distributing write load over multiple servers. Is that the case? Is it a big problem? How big does a service have to grow before that could be a significant problem?

nornagon
  • 15,393
  • 18
  • 71
  • 85

2 Answers2

80

The strengths and weaknesses of the NoSQL databases (and also SQL databases) is highly dependent on your use case. For very large projects, performance is king; but for brand new projects, or projects where time and money are limited, simplicity and time-to-market are probably the most important. For teaching yourself (broadening your perspective, becoming a better, more valuable programmer), perhaps the most important thing is simple, solid fundamental concepts.

What kind of project do you have in mind?

Some strengths and weaknesses, off the top of my head:

  • Redis
    • Very simple key-value "global variable server"
    • Very simple (some would say "non-existent") query system
    • Easily the fastest in this list
    • Transactions
    • Data set must fit in memory
    • Immature clustering, with unclear future (I'm sure it'll be great, but it's not yet decided.)
  • Cassandra
    • Arguably the most community momentum of the BigTable-like databases
    • Probably the easiest of this list to manage in big/growing clusters
    • Support for map/reduce, good for analytics, data warehousing
    • MUlti-datacenter replication
    • Tunable consistency/availability
    • No single point of failure
    • You must know what queries you will run early in the project, to prepare the data shape and indexes
  • CouchDB
    • Hands-down the best sync (replication) support, supporting master/slave, master/master, and more exotic architectures
    • HTTP protocol, browsers/apps can interact directly with the DB partially or entirely. (Sync is also done over HTTP)
    • After a brief learning curve, pretty sophisticated query system using Javascript and map/reduce
    • Clustered operation (no SPOF, tunable consistency/availability) is currently a significant fork (BigCouch). It will probably merge into Couch but there is no roadmap.
    • Similarly, clustering and multi-datacenter are theoretically possible (the "exotic" thing I mentioned) however you must write all that tooling yourself at this time.
    • Append only file format (both databases and indexes) consumes disk surprisingly quickly, and you must manually run compaction (vacuuming) which makes a full copy of all records in the database. The same is required for each index file. Again, you have to be your own toolsmith.
JasonSmith
  • 72,674
  • 22
  • 123
  • 149
  • 9
    +1 "simplicity and time-to-market are probably the most important". Optimize your business first, technology later. A downside for Redis is that it's really only good for data sets that fit in memory; its clustering capabilities and disk-based solutions are limited. Other Cassandra pluses are multi-datacenter replication, tunable consistency/availability per operation, and no single-point of failure (every node in the cluster plays the same role, no masters). A downside for Cassandra is that you have to think about your queries before you organize your data, and this can take some effort. – Tyler Hobbs Jan 18 '11 at 06:29
  • 5
    By the way, in my experience, "projects where time and money is limited" covers the **vast majority** of projects during the **vast majority** of their lifespans. – JasonSmith Jan 19 '11 at 07:18
  • 2
    BigCouch is excellent software. It was spearheaded by core members of the CouchDB development team. It will be maintained and developed further. While I do not know of a road map, I expect BigCouch will be merged back into CouchDB in some fashion. And if you think I'm a hopeless fanboy, consider that BigCouch is made by my company's competitor! – JasonSmith Jan 20 '11 at 07:24
  • 2
    WARNING: Heavily outdated answer. – Zia Ul Rehman Mughal May 18 '17 at 06:24
32

Take a look at http://kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis He does a good job summing up why you would use one over the other.

webXL
  • 1,630
  • 1
  • 15
  • 21