Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redis, CouchDB or Cassandra? [closed]

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?

like image 731
nornagon Avatar asked Jan 18 '11 04:01

nornagon


People also ask

Which is faster Redis or Cassandra?

Because Redis stores voluminous data in memory, its transactional response times are much faster than Cassandra that persists data to disk by performing traditional read-write transactions, albeit much quicker than a conventional RDBMS.

When to use Redis or Cassandra?

Key Differences Between Cassandra and Redis Whereas Redis always used for rapidly changed data on both write and read. Cassandra can hold huge data in a tabular format which support HiveQL (SQL like language), whereas Redis store the data as a key-value pair which normally not supported any SQL like language.

Why should you use CouchDB?

The architectural design of CouchDB makes it extremely adaptable when partitioning databases and scaling data onto multiple nodes. CouchDB supports both horizontal partitioning and replication to create an easily managed solution for balancing both read and write loads during a database deployment.

Why is MongoDB more popular than CouchDB?

MongoDB has a much larger user base than CouchDB, making it easier to find support and hire employees for this database solution. Both databases are free and open-source projects but likely require a paid fully managed service to deploy your production workloads.


1 Answers

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.
like image 141
JasonSmith Avatar answered Sep 28 '22 18:09

JasonSmith