Listing Keyspaces in Cassandra DB

13.02.2025

Cassandra is a popular NoSQL database that is known for its scalability and high availability. In Cassandra, a keyspace is a container for tables, similar to a schema in a relational database. Keyspaces allow you to organize your data and define replication strategies.

Backups | Apache Cassandra Documentation

Listing Keyspaces in Cassandra DB

Using cqlsh

One way to list keyspaces in Cassandra is to use the CQL Shell (cqlsh), which is a command-line tool that allows you to interact with Cassandra. To list keyspaces, you can use the following CQL command:

Cassandra Collection Data Types – List, Set, Map – YouTube
Aug 13, 2019 … cassandra query map which collection type in cassandra is dictionary like object cassandra frozen collection cassandra set heap collection …
DESCRIBE KEYSPACES;

Using nodetool

Another way to list keyspaces is to use the nodetool utility, which is a command-line tool for managing and monitoring a Cassandra cluster. You can use the following command to list keyspaces:

nodetool describestacks

Using DataStax DevCenter

DataStax DevCenter is a visual tool for working with Cassandra that provides a graphical user interface for interacting with the database. In DevCenter, you can easily view and manage keyspaces through the user interface.

Using Cassandra Java Driver

If you are developing a Java application that interacts with Cassandra, you can use the DataStax Java Driver to query the system schema tables and retrieve information about keyspaces programmatically.

Using REST API

Cassandra also provides a REST API that allows you to perform various operations on the database, including listing keyspaces. You can make an HTTP request to the system keyspaces endpoint to retrieve a list of keyspaces.

Using Cassandra Cluster Manager (CCM)

If you are running a Cassandra cluster locally for development or testing purposes, you can use the Cassandra Cluster Manager (CCM) to manage your cluster. CCM provides commands to create, start, stop, and list keyspaces in your local cluster.

Overall, there are several ways to list keyspaces in Cassandra, depending on your preference and the tools you are using. Whether you prefer command-line tools like cqlsh and nodetool, visual tools like DevCenter, or programmatic access using the Java Driver or REST API, Cassandra offers flexibility in how you can interact with your data.

Do you like the article?

Yan Hadzhyisky

fullstack PHP+JS+REACT developer