Contents
Apache Cassandra
Apache Cassandra is a free and open-source database management system designed to handle large volumes of data across multiple commodity servers. Cassandra supports computer clusters and spans multiple data centers, featuring asynchronous and masterless replication. It enables low-latency operations for all clients and incorporates Amazon's Dynamo distributed storage as well as replication techniques, combined with Google's Bigtable data storage engine model.
History
Avinash Lakshman, a co-author of Amazon's Dynamo, and Prashant Malik developed Cassandra at Facebook to support the inbox search functionality. Facebook open-sourced Cassandra on Google Code in July 2008. In March 2009, it became an Apache Incubator project and on February 17, 2010, it graduated to a top-level project. The developers at Facebook named their database after Cassandra, the mythological Trojan prophetess, alluding to the classical curse placed on an oracle.
Features
Cassandra implements a distributed architecture in which all nodes perform the same functions, minimizing the risk of single points of failure. Data is distributed throughout the cluster using configurable replication strategies that can be implemented across multiple data centers, thereby enhancing redundancy and supporting disaster recovery. The system supports linear scaling, allowing read and write throughput to increase proportionally with the addition of new nodes, all while ensuring uninterrupted service. Cassandra is categorized as an AP (Availability and Partition Tolerance) system, emphasizing availability and partition tolerance over consistency. It also offers tunable consistency levels for both read and write operations. Additionally, Cassandra's compatibility with Hadoop and related tools allows for integration with existing big data processing workflows. Eventual consistency is managed through tombstones for reads, upserts, and deletes.
Cassandra Query Language
Cassandra Query Language (CQL) is the interface for accessing Cassandra, as an alternative to the traditional Structured Query Language (SQL). CQL adds an abstraction layer that hides implementation details of this structure and provides native syntaxes for collections and other common encodings. Language drivers are available for Java (JDBC), Python (DBAPI2), Node.JS (DataStax), Go (gocql), and C++. The key space in Cassandra is a namespace that defines data replication across nodes. Therefore, replication is defined at the key space level. Below is an example of key space creation, including a column family in CQL 3.0: Which gives:
Known issues
Up to Cassandra 1.0, Cassandra was not row-level consistent, meaning that simultaneous inserts and updates into the table that affect the same row may affect the non-key columns in inconsistent ways. One update may affect one column while another affects the other, resulting in sets of values within the row that were never specified or intended. Cassandra 1.1 solved this issue by introducing row-level isolation. Cassandra is not supported on Windows as of version 4.
Tombstones
Deletion markers called "tombstones" are known to cause performance degradation in delete-heavy workloads. Tombstones are common in many databases, and this problem is not unique to Cassandra.
Data model
Cassandra is wide-column store, and, as such, it is essentially a hybrid between a key-value and a tabular database management system. Its data model is a partitioned row store with tunable consistency. Rows are organized into tables; the first component of a table's primary key is the partition key; within a partition, rows are clustered by the remaining columns of the key. Other columns may be indexed separately from the primary key. Tables may be created, dropped, or altered at run-time without blocking updates and queries. Cassandra cannot execute joins or subqueries. Rather, Cassandra emphasizes denormalization through features such as collections. A column family (called "table" since CQL 3) resembles a table in a relational database management system (RDBMS). Column families contain rows and columns. Each row is uniquely identified by a row key. Each row has multiple columns, each of which has a name, value, and timestamp. Unlike a table in an RDBMS, different rows in the same column family do not have to share the same set of columns, and a column may be added to one or multiple rows at any time. Each key in Cassandra corresponds to a value which is an object. Each key has values as columns, and these columns are grouped together into sets called 'column families'. Thus, each key identifies a row of a variable number of elements. These column families could be considered, then, as tables. A table in Cassandra is a distributed multidimensional map indexed by a key. Furthermore, applications can specify the sort order of columns within a Super Column or Simple Column family.
Management and monitoring
Cassandra is a Java-based system that can be managed and monitored via Java Management Extensions (JMX). The JMX-compliant Nodetool utility, for instance, can be used to manage a Cassandra cluster. Nodetool also offers a number of commands to return Cassandra metrics pertaining to disk usage, latency, compaction, garbage collection, and more. Since the release of Cassandra 2.0.2 in 2013, measures of several metrics are produced via the Dropwizard metrics framework, and may be queried via JMX using tools such as JConsole or passed to external monitoring systems via Dropwizard-compatible reporter plugins.
Releases
Releases after graduation include:
This article is derived from Wikipedia and licensed under CC BY-SA 4.0. View the original article.
Wikipedia® is a registered trademark of the
Wikimedia Foundation, Inc.
Bliptext is not
affiliated with or endorsed by Wikipedia or the
Wikimedia Foundation.