AMZ DIGICOM

Digital Communication

AMZ DIGICOM

Digital Communication

MongoDB vs Cassandra: comparison

PARTAGEZ

Comparing MongoDB vs Cassandra reveals a lot of similarities. However, the two are used in very different ways: MongoDB seduces us with its optimal scalability while Cassandra's strong point is its greater availability.

MongoDB vs Cassandra: the two successful NoSQL databases

MongoDB and Cassandra are two of the most important NoSQL databases. They are used by the most well-known and successful companies and also provide remarkable services to users with more modest needs.

Managing ever-increasing and diverse data streams has given importance to database management systems and NoSQL databases. These non-relational databases are attractive because of their great scalability on the one hand and their great resilience on the other hand. These systems evolve as the volume of data increases, while maintaining a clear structure.

MongoDB focuses on collections and documents

Before looking in more detail at MongoDB vs Cassandra and comparing them, let's come back to the advantages of MongoDB: the name of this system comes from the English “huMONGOus” (gigantic). This database developed in 2009 by the company 10gen (now MongoDB Inc.) is today operated by the owner Server Side Public License. It is written in C++ and saves data in collections and documents. MongoDB, the most famous database in the world, is available in a free community version and a proprietary license.

A NoSQL database that suits you: choose Managed MongoDB on IONOS and benefit from maximum scalability, in-depth data analysis and the optimal hardware for your workload. Find the offer that meets your needs now!

Cassandra: the column-oriented database

Although MongoDB and Cassandra differ in many ways, both systems came into existence around the same time. Cassandra appeared in 2008, but at that time it was developed only for Facebook. In 2009, the Apache Software Foundation took over the reins of the cross-platform NoSQL database management system programmed in Java and which works column oriented.

In addition to creators Avinash Lakshman and Prashant Malik, companies such as DataStax, IBM and Twitter also took part in the development of Cassandra. Nowadays, the system marketed under the Apache license is available in a free version and in several paid versions. Cassandra is one of the most famous column-oriented databases in the world.

Scope of use and scalability

Both options are particularly suitable for the treatment of large data collections and in fact rely on the NoSQL approach. Both systems can thus handle quantities of unstructured data because they act independently of tables and instead rely on different nodes. Which, in turn, increases the scalability of both solutions. Compared to their SQL competitors, MongoDB and Cassandra are very suitable for companies that want to process large volumes of data from the start. They are also suitable for businesses with evolving needs that increase over time.

Better to opt for MongoDB if you need to deal with quantities of mostly unstructured data. Certainly, both systems are suitable for this task but the flexibility of MongoDB allows database management to be a little more scalable. Cassandra also offers flexibility but its similar SQL style construction makes it easier to move to NoSQL. Cassandra uses query language CQL which resembles traditional databases. On this point, MongoDB lags behind in our MongoDB vs Cassandra comparison with a clean query that must first be learned.

IONOS Cloud Compute Engine

Medium and large companies choose Cloud Made in Germany. IaaS and PaaS from hidden champion to hidden champions.

MongoDB vs Cassandra: which approach?

The objectives of MongoDB vs Cassandra are certainly similar, but their respective approach is completely different. MongoDB stores its data in documents collected in collections. Each document is made up of key-value pairs. Generally, keys consist of a character string. Values ​​are often Boolean values, data, other documents, numbers or even strings of characters. Conversely, Cassandra works column-oriented (in Sorted String Tables) and uses row-based partitioning. SSTables cannot be modified later. They contain a sorted set of respective key-value pairs. Although Cassandra is a NoSQL database, its approach is more “Not only SQL”. Its query language, however, is much more flexible.

Data model

In our MongoDB vs Cassandra comparison, it is clear that MongoDB offers more flexibility in the data model. MongoDB works schema-less and uses a JSON format similar to BSON format. For example, an employee register could look like this:

Employé : [
{
Employé_ID : "1",
Nom : "Marie Durand",
Ville : "Paris"
},
{
Employé_ID : "2",
Domaine : "IT",
Email : "jdupont@exemple.fr"
}]

bson

Cassandra, on the other hand, relies on tables that can be conventionally divided into rows and columns. Data is saved as key-value pairs. A comparable employee register might look something like this:

Employé_ID 1 Colonne - Nom		Colonne - Ville
		Valeur - Marie Durand	Valeur - Paris
Employé_ID 2 Colonne - Nom		Colonne - Domaine		Colonne - Email
		Valeur - Jean Dupont	Valeur - IT		Valeur - jdupont@exemple.fr

text

Availability

Concerning the availability of stored data, the MongoDB vs Cassandra comparison also reveals commonalities and differences. Both systems secure data by distributing the load across different server nodes. However, MongoDB only uses a single primary node which is replicated so that it can cope with possible outages. All writes are directed to this master node and then forwarded to its replicas. If the master node fails, a new one takes over. In Cassandra, on the other hand, it is possible to configure multiple master nodes using the appropriate infrastructure. In the event of a breakdown of one or more nodes, they are immediately replaced to ensure continuity of service.

Compatibility and programming languages

Both Cassandra and MongoDB are compatible with different server operating systems. Both work with Linux, macOS and Windows. Cassandra also supports BSD and MongoDB supports Solaris.

Both database management solutions support the following programming languages:

Programming language Supported by Mongo DB Supported by Cassandra
Actionscript
VS
VS#
C++
Clojure
ColdFusion
D
Dart
Delphi
Erlang
Go
Groovy
Haskell
Java
JavaScript
Kotlin
Lisp
Lua
MatLab
Perl
PHP
PowerShell
Prolog
Python
R
Ruby
Scala
Smalltalk
Swift

Security

MongoDB and Cassandra users have system security for the respective base versions in their hands. In addition to an SSL certificate or TLS certificate for client connections as well as user authentications, other reinforced measures are recommended such as the use of an adequate firewall. Commercial solutions such as MongoDB Atlas, on the other hand, offer extensive security features such as X.509, client- and server-side encryption, and Kerberos and LDAP integration.

Mobile version

No special version of Cassandra is dedicated to mobile use. Tools for (continuous) development on smartphones do not exist either. In fact, MongoDB has more options for mobile use in our MongoDB vs Cassandra comparison. Realm is the database management system designed by MongoDB for mobile operating systems. The paid Atlas version also offers solutions for mobile use.

Which companies use MongoDB and Cassandra?

If MongoDB and Cassandra have distinct operations, the list of companies which respectively use one or the other is rather balanced. The most famous companies that use MongoDB are:

  • Adobe
  • Amadeus
  • AppScale
  • Craftbase
  • Disney
  • Etsy
  • Foursquare
  • Lyft
  • MTV
  • The New York Times
  • Via Varejo

The companies that use Cassandra are just as renowned. Of course, Facebook (or Meta) no longer uses Cassandra's services, but we have nevertheless listed the following companies:

  • Apple
  • Discord
  • Digg
  • Hulu
  • Intuit
  • Instagram
  • Netflix
  • Reddit
  • Spotify
  • X (formerly Twitter)

Télécharger notre livre blanc

Comment construire une stratégie de marketing digital ?

Le guide indispensable pour promouvoir votre marque en ligne

En savoir plus

Souhaitez vous Booster votre Business?

écrivez-nous et restez en contact