Cassandra vs MySQL
Cassandra is an alternative to MySQL, Oracle or other database manager for very large amounts of queries. It tends to be used by more and more different players, but this is a new product which has not been confronted with all the variety of uses that can be experienced. We can expect setbacks in adapting it to a new application.
It is suitable for fully distributed and highly scalable databases, so for the wide traffic of sites such as Facebook (which developed it) with millions of queries per hour.
The distributed model is used to store information on many different servers managed by a central system.
Written in Java, it can be more easily integrated into a server environment in this language.
Cassandra is based on the non-relational data model BigTable created by Google and used by the index of its search engine, running on Dynamo, the storage system model from Amazon.
It has been open sourced by Facebook in 2008 and then supported by the Apache Foundation.
The word Cassandra comes from the Greek mythology, it is the name of a princess who has the power to predict the future but whose fate is never to be believed. The logo of a female gaze refers to the idea of vision. It is assumed that the developer expected not to be believed about the future of this system.
Cassandra vs. MySQL
Cassandra is part of NoSQL the movement that wants to simplify the databases by removing the relational aspect.
Tables are no longer a predetermined fixed schema (that we can actually change later), and can change horizontally (for the columns) as well as vertically (for the lines, so the records).
NoSQL actually means Not Only SQL, so it is not about the query language, which is always SQL.
Cassandra is shemaless and has no table. The number of columns can vary from one row to another. MariaDB (alternative to MySQL) has implemented a system that allows dynamic columns to do the same thing. But we leave the field of SQL commands.
Here is a benchmark comparison provided by Apache:
- Writing: MySQL: 300 ms. Cassandra: 0.12 ms.
- Reading: MySQL: 350ms. Cassandra: 15 ms.
Differences in features:
- Number of columns: MySQL: 4096. Cassandra: 2 billion.
Cassandra is less reliable than MySQL and a weaker community and therefore a smaller support. There are fewer tools to help make it work, such as graphical interfaces, or managers such as phpMyAdmin.
It is not a system like MySQL you just install so that it is operational, you must read the manual carefully and adapt the configuration to your software project (apart from creating tables).
Cassandra users
Twitter does not so far use Cassandra to manage tweets, because it would have to rewrite the system but it is used for statistical data and geolocation.
Complaining of slowness in MySQL, Digg has decided to completely reimplement the management of data to Cassandra.
Netflix, The streaming TV company prefers to forego the benefits of relational database for the scalability of Cassandra.
Facebook is the origin of Cassandra, even though the project was then integrated to Apache. But it was replaced by Hadoop, a Java framework for distributed data processing. Cassandra is also written in Java, but a C++ version exists, ScyllaDB, which is claimed to be 10x faster.
Cassandra like other open source software tend to replace Oracle which saw the number of new licenses to decline by 28% in 2014.