i

MongoDB vs. Cassandra

MongoDB and Cassandra are both are NoSQL databases, but they have their own features. The below table will help us to understand the difference between MongoDB and Cassandra:

Features

MongoDB

Cassandra

Database type

Document-based

Wide column-based

Protocol

Use Custom binary (BSON)

Use SQL like CQL3

Fault Tolerance

It has a Master-Slave model for failover with no single point of failure

It has high availability with no single point of failure.

Read / Write operation

It meets a low latency requirement for read requests, at low throughput

It meets a low latency requirement for read requests, at low throughput

Querying

It is a query by example model and can execute complex dynamic queries.

It allows querying by key or key range.

Replication

MongoDB uses a replica set that provides auto-failover and data redundancy.

It is very simple. We just need to mention the number of nodes we want our data copied to, and it automatically handles the rest.

Sharding

Sharding is built-in, but MongoDB shards are replications of multiple servers. 

An auto sharding facility is available. Each shard is a server with its data replicated across other servers.

Hadoop Support

It uses MongoDB connector. 

Native Hadoop support, including Hive and Pig.