# Cassandra

## 1. Introduction

Apache Cassandra is a typical **AP** Wide Column store, NoSQL DDBMS. It can handle heavy writes and allows for low latency reads. Every node in a Cassandra cluster has the same role, so there's no single point of failure. Data is distributed across the cluster so each node contains different data. Apple uses more than 100.000 Cassandra nodes! Cassandra has:

* Distributed nodes
* Linear performance gains through adding nodes
* No need for separate caching layer
* Flexible schema design
* Data compression
* Easy replication
* Scalability
* Fault-tolerance
* Tunable consistency
* MapReduce support
* Query language (CQL)
* No special hardware or software

## 2. CQL

A KEYSPACE is similar to a SCHEMA or DATABASE. A COLUMNFAMILY is comparable to a TABLE.

```sql
CREATE KEYSPACE MyKeySpace
  WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 };

USE MyKeySpace;

CREATE COLUMNFAMILY MyColumns (id text, Last text, First text, PRIMARY KEY(id));

INSERT INTO MyColumns (id, Last, First) VALUES ('1', 'Doe', 'John');

SELECT * FROM MyColumns;
```

<br>

tombstones

token-ring


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://databook.gitbook.io/environment/technologies/cassandra.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
