Apache Cassandra

From XennisWiki
Jump to: navigation, search

Apache Cassandra is a free and open-source, distributed, wide column store, NoSQL database management system designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure. Cassandra offers robust support for clusters spanning multiple datacenters, with asynchronous masterless replication allowing low latency operations for all clients. (Wikipedia)

cqlsh

Installation

pip install cqlsh

Usage

cqlsh <host> <port>

Setting the user, password and the version

cqlsh -u <user> -p <password> <host> --cqlversion 3.4.0

Usage

Select data

SELECT name, street FROM cities.hamburg WHERE partition_key='126' AND another_partition_key='21654';

Create a keyspace

CREATE KEYSPACE IF NOT EXISTS my_namespace WITH replication = {'class':'SimpleStrategy','replication_factor':1};

Turn expand on

EXPAND on;

See also

External links