views:

139

answers:

2

Is it possible to build the entire social networking application on cassandra? Sure, it takes longer to set up, but it scales much better. Correct?

Please list the situations when Cassandra should be used.

A: 

Cassandra is in use at Digg, Facebook, Twitter, Reddit, Rackspace, Cloudkick, Cisco etc. so the answer to your first question would be yes.

The short version of the list that describes the situations in when Cassandra should be used.

  • You need the possibility to add new nodes to yout cluster, with no downtime.

  • You need a richer data model (column oriented) than simple key/value

  • You need the possibility to have both synchronous and asynchronous replication for each update.

Schildmeijer
A: 

To briefly summarize Brewer's CAP Theorem, your database is going to give you at most two of the following three properties:

  • Consistency
  • Availability
  • Partition Tolerance

A relational database such as SQL Server or MySQL will give you consistency and sacrifices either availability or partition tolerance. A distributed database such as Cassandra will sacrifice consistency to give you both availability and partition tolerance.

So in short, use Cassandra if you don't need immediate consistency and are OK with eventual consistency.

John Bledsoe
CAP applies equally to ANY database model. It does not imply that a RDBMS can't satisfy both availability and partition tolerance. There's nothing about the relational model that makes it unsuitable for a distributed, web scale application. In many ways the relational model is well suited for the kind of application under discussion. It's just that most standard SQL DBMSs don't provide good out of the box support for partitioning
dportas
Good clarification. Are you aware of any SQL DBMS's that sacrifice consistency for the sake of partitioning and availability by design?
John Bledsoe
I can't think of any SQL DBMS that forces consistency on you when you don't want it. If you don't require consistency between servers in a distributed system then you don't implement it that way.
dportas