# Apache Cassandra on AWS: The basics and how to manage

Apache Cassandra on AWS: The basics and how to manage
=====================================================

Apache Cassandra is a highly scalable, open-source NoSQL database to handle large amounts of data across many commodity servers.

 [Talk to a consultant](/contact-us/) 

 

 

 

    - [ What Is Amazon Keyspaces (for Apache Cassandra)? ](#sec-0)
- [ The differences between Apache Cassandra and AWS Keyspaces ](#sec-1)
- [ How Amazon Keyspaces works ](#sec-2)
- [ Amazon Keyspaces: Key use cases ](#sec-3)
- [ Quick tutorial: Getting started with Amazon Keyspaces (for Apache Cassandra) ](#sec-4)
- [ Leveraging the power of Instaclustr for Apache Cassandra on AWS ](#sec-5)
 
      What Is Amazon Keyspaces (for Apache Cassandra)?   The differences between Apache Cassandra and AWS Keyspaces   How Amazon Keyspaces works   Amazon Keyspaces: Key use cases   Quick tutorial: Getting started with Amazon Keyspaces (for Apache Cassandra)   Leveraging the power of Instaclustr for Apache Cassandra on AWS   

 What Is Amazon Keyspaces (for Apache Cassandra)? 
-------------------------------------------------

[Apache Cassandra](/education/apache-cassandra/apache-cassandra-database/) is a highly scalable, open source NoSQL database developed to handle large amounts of data across many commodity servers. In the AWS ecosystem, this functionality is delivered through a managed service known as Amazon Keyspaces (for Apache Cassandra). Amazon Keyspaces offers a serverless database solution that eliminates the need to manage infrastructure for Cassandra databases.

Amazon Keyspaces ensures compatibility with Cassandra Query Language (CQL), allowing for migration and integration of existing Cassandra applications. It provides automatic scaling and high availability, without requiring deep technical knowledge of Cassandra, and easily integrating with other AWS services.

*This is part of a series of articles about [Apache Cassandra](https://www.instaclustr.com/education/apache-cassandra/apache-cassandra-database/)*

 

 

The differences between Apache Cassandra and AWS Keyspaces
----------------------------------------------------------

 **Feature****Apache Cassandra****Amazon Keyspaces (for Apache Cassandra)****Management**Requires full infrastructure management, including hardware provisioning, software updates, and performance optimization.Fully managed by AWS: eliminating the need for infrastructure management. AWS handles provisioning, updates, and scaling.**Scalability and Availability**Can be configured for scalability and high availability through manual setup; high availability by default of Cassandra’s architecture. but requires manual setup and expertise.Automatically scales to meet application demands and ensures high availability by default.**Infrastructure**Organizations are responsible for deploying and managing clusters across servers, but a managed service can do this for them.Serverless architecture, meaning AWS manages server provisioning and cluster configuration automatically.**Operational Overhead**Operational overhead due to the need for infrastructure and database management if not using a managed service.Minimal operational overhead, as AWS handles administrative tasks, allowing developers to focus on application development.**Skill Requirement**Requires expertise in managing and configuring Cassandra clusters or support via a managed service.No deep Cassandra expertise required; AWS automates infrastructure tasks and scaling.**Related content: Learn more in our detailed [Apache Cassandra tutorial](https://www.instaclustr.com/education/apache-cassandra/apache-cassandra-tutorial-cheat-sheet-basic-setup-and-vector-search/)**

 

 

How Amazon Keyspaces works 
---------------------------

Amazon Keyspaces operates as a serverless database service, meaning it automatically handles the infrastructure management tasks typically associated with running a database. This includes provisioning servers, configuring clusters, and managing software updates. Users perform queries using the familiar CQL language provided by Cassandra.

![Amazon Keyspaces high level chart](https://www.instaclustr.com/wp-content/uploads/keyspaces-hi-level.png)

Source: [Amazon](https://docs.aws.amazon.com/keyspaces/latest/devguide/how-it-works.html)

At its core, Amazon Keyspaces uses a partitioned data model similar to Apache Cassandra. Data is distributed across partitions, which allows for horizontal scaling and ensures high availability. When a read or write request is made, Amazon Keyspaces routes the request to the appropriate partition, balancing the load across multiple servers. This mechanism supports the service’s ability to handle large volumes of simultaneous requests with low latency.

To enable automatic scaling, the service monitors workload patterns and adjusts capacity dynamically to meet demand. This elasticity is especially important for applications with unpredictable or highly variable workloads.

Security in Amazon Keyspaces is managed through AWS Identity and Access Management (IAM). Developers can define granular access policies to control who can read or write data. Additionally, data is encrypted both at rest and in transit, adhering to industry-standard security practices.

Amazon Keyspaces also integrates with other AWS services. For instance, it can be used alongside Amazon S3 for data storage or AWS Lambda for serverless computing.

**Related content: Learn more about [data architecture principles](/education/data-architecture/6-data-architecture-principles-and-how-to-implement-them/)**

 

 

Amazon Keyspaces: Key use cases
-------------------------------

### Build applications that require low latency

Applications requiring low latency can benefit from Amazon Keyspaces. With its partitioned data model and high throughput, Keyspaces can handle large volumes of read and write operations with minimal delay. This makes it suitable for real-time applications like live streaming, gaming, and financial trading platforms, where performance is critical.

### Move your Cassandra workloads to the cloud

Migrating existing Cassandra workloads to Amazon Keyspaces offers different advantages. Amazon Keyspaces maintains compatibility with CQL, which means your existing Cassandra applications don’t require extensive rewrites.

### Build Applications in AWS Using Open Source Technologies

Because Amazon Keyspaces uses the same CQL as Apache Cassandra, developers familiar with Cassandra can adopt Amazon Keyspaces without needing to learn new skills.

Additionally, the compatibility with open source frameworks means you can leverage a broad range of tools and libraries that work with Apache Cassandra.

**Related content: Learn more in our detailed guide to [Cassandra architecture](https://www.instaclustr.com/blog/cassandra-architecture/)**

 

 

Quick tutorial: Getting started with Amazon Keyspaces (for Apache Cassandra)
----------------------------------------------------------------------------

The following tutorial is based on the official Amazon Keyspaces [documentation](https://docs.aws.amazon.com/keyspaces/latest/devguide/getting-started.ddl.html).

### Step 1: Create a Keyspace and a Table

Creating a keyspace and a table in Amazon Keyspaces is a straightforward process that involves a few steps within the AWS Management Console.

### *Creating a keyspace*

A keyspace in Amazon Keyspaces groups related tables that are relevant for one or more applications. It defines the replication strategy for all the tables it contains.  
**Steps to create a keyspace:**

1. Sign in to the AWS Management Console and navigate to Amazon Keyspaces.![Amazon Keyspaces dashboard](https://www.instaclustr.com/wp-content/uploads/IR0724-8-3.png)
2. In the navigation pane, select **Keyspaces**.![Amazon Keyspaces dashboard - create a Keyspace](https://www.instaclustr.com/wp-content/uploads/IR0724-8-4.png)![Amazon Keyspaces dashboard - set Keyspace details](https://www.instaclustr.com/wp-content/uploads/IR0724-8-5.png)
3. In the **Keyspace name** box, enter catalog as the name for your keyspace.
4. Under **AWS Regions**, confirm that **Single-Region replication** is the replication strategy for the keyspace.
5. Click on **Create keyspace**.![Amazon Keyspaces dashboard - create a new Keyspace](https://www.instaclustr.com/wp-content/uploads/IR0724-8-6.png)
6. To verify keyspace creation, go to the navigation pane, select Keyspaces, and locate your keyspace catalog in the list.![Amazon Keyspaces dashboard - verify new Keyspace](https://www.instaclustr.com/wp-content/uploads/IR0724-8-7.png)

### *Creating a table*

A table is where your data is organized and stored. The primary key of your table determines how data is partitioned and indexed.  
**Steps to create a table:**

1. Sign in to the AWS Management Console, navigate to Amazon Keyspaces, and click **Keyspaces**.![Amazon Keyspaces dashboard - select your new Keyspace](https://www.instaclustr.com/wp-content/uploads/IR0724-8-7.png)
2. Choose the keyspace catalog where you want to create the table.![Amazon Keyspaces dashboard - select your new Keyspace](https://www.instaclustr.com/wp-content/uploads/IR0724-8-8.png)![Amazon Keyspaces dashboard - select your new Keyspace](https://www.instaclustr.com/wp-content/uploads/IR0724-8-9.png)
3. In the **Table name** box, enter `famous_films` as the name for your table.
4. In the Columns section, add the following columns and data types: 
    - `year (int)`
    - `title (text)`
    - `director (text)`
    - `producer (text)`
    - `length (int)`
    - `genre (text)`
    - `rating (text)`
5. Set the Partition Key: 
    - Choose title and year as the partition keys.
6. Add **Clustering Columns**: 
    - Choose genre and director.
    - For genre, select ASC to sort in ascending order.
7. In the **Table settings** section, choose **Default settings**.
8. Click on **Create table**.
9. To verify the table creation, go to the navigation pane, select **Tables**, and confirm that your table `famous_films` is listed. Select the table name and verify that all columns and data types are correct.![Amazon Keyspaces dashboard - verify new table](https://www.instaclustr.com/wp-content/uploads/IR0724-8-11.png)

### Step 2: Create and read data

**Create data**

To insert data into your `famous_films` table, use the `INSERT` statement. Here’s how you can add a single row:

1. Open AWS CloudShell and connect to Amazon Keyspaces using the following command, replacing us-east-1 with your specific region:   
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    cqlsh-expansion cassandra.us-east-1.amazonaws.com 9142 --ssl
    
       1
    
    
    
      cqlsh-expansion cassandra.us-east-1.amazonaws.com 9142 --ssl
    
    
    
       
    
     
    
     **Note:** If `csqlsh` is not installed on your cloud shell, you can install it using this command:
    
      
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    pip install cqlsh
    
       1
    
    
    
      pip install cqlsh
    
    
    
       
    
     
    
     ![Create data - terminal view](https://www.instaclustr.com/wp-content/uploads/IR0724-8-14.png)
2. Also install the required tools using the following command:   
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    pip install --user cqlsh-expansion
    
       1
    
    
    
      pip install --user cqlsh-expansion
    
    
    
       
    
     
    
     ![Create data - terminal view](https://www.instaclustr.com/wp-content/uploads/IR0724-8-15.png)
3. Now initialize it using the following command:   
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    cqlsh-expansion.init
    
       1
    
    
    
      cqlsh-expansion.init
    
    
    
       
    
     
    
     ![Create data - terminal view](https://www.instaclustr.com/wp-content/uploads/IR0724-8-16.png)
4. Once connected, set the write consistency for your session to `LOCAL_QUORUM` by running:   
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    CONSISTENCY LOCAL\_QUORUM;
    
       1
    
    
    
      CONSISTENCY LOCAL\_QUORUM;
    
    
    
       
    
     
    
     ![Create data - terminal view](https://www.instaclustr.com/wp-content/uploads/IR0724-8-18.png)
5. Insert a single record into the `famous_films` table:   
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    INSERT INTO catalog.famous\_films (title, year, genre, director, producer, length, rating) VALUES ('Inception', 2010, 'Sci-Fi', 'Christopher Nolan', 'Emma Thomas', 148, 'PG-13');
    
       1
    
    2
    
    
    
      INSERT INTO catalog.famous\_films (title, year, genre, director, producer, length, rating)
    
    VALUES ('Inception', 2010, 'Sci-Fi', 'Christopher Nolan', 'Emma Thomas', 148, 'PG-13');
6. Verify the data was added successfully by running:   
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    SELECT \* FROM catalog.famous\_films;
    
       1
    
    
    
      SELECT \* FROM catalog.famous\_films;
    
    
    
       
    
     
    
     The output should look similar to this:
    
    ![Create data - terminal view](https://www.instaclustr.com/wp-content/uploads/IR0724-8-19.png)

### Step 3: Insert multiple records from a CSV file

To insert multiple records, follow these steps:

1. Download the sample CSV file keyspaces\_sample\_table.csv. You can download the file [here](https://drive.google.com/file/d/1wWvtKAv76XGv3Awqw13_MVg-YrM54jrJ/view?usp=drive_link).
2. Open AWS CloudShell and connect to Amazon Keyspaces:   
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    cqlsh-expansion cassandra.us-east-1.amazonaws.com 9142 --ssl
    
       1
    
    
    
      cqlsh-expansion cassandra.us-east-1.amazonaws.com 9142 --ssl
3. Specify the keyspace:   
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    USE catalog;
    
       1
    
    
    
      USE catalog;
4. Set the write consistency:   
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    CONSISTENCY LOCAL\_QUORUM;
    
       1
    
    
    
      CONSISTENCY LOCAL\_QUORUM;
5. Upload the CSV file to AWS CloudShell using the upload option and note the file path.![Insert multiple records - terminal view](https://www.instaclustr.com/wp-content/uploads/IR0724-8-20.png)
6. At the keyspace prompt, run:   
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    COPY famous\_films (title, year, genre, director, producer, length, rating) FROM '/home/cloudshell-user/keyspaces\_sample\_table.csv' WITH header=TRUE;
    
       1
    
    2
    
    
    
      COPY famous\_films (title, year, genre, director, producer, length, rating)
    
    FROM '/home/cloudshell-user/keyspaces\_sample\_table.csv' WITH header=TRUE;
7. Verify the data by running:   
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    SELECT \* FROM famous\_films;
    
       1
    
    
    
      SELECT \* FROM famous\_films;
    
    
    
       
    
     
    
     The output should be similar to:
    
    ![Insert multiple records - terminal view](https://www.instaclustr.com/wp-content/uploads/IR0724-8-23.png)

### Read data

To read data from the `famous_films` table, use the `SELECT` statement. Here are some examples:  
**Select all data:**

  





























SELECT \* FROM catalog.famous\_films;

   1



  SELECT \* FROM catalog.famous\_films;



   

 

 ![Read data - terminal view](https://www.instaclustr.com/wp-content/uploads/IR0724-8-23.png)

This returns all columns and rows in the table.  
**Select specific columns:**

  





























SELECT title, genre, year FROM catalog.famous\_films;

   1



  SELECT title, genre, year FROM catalog.famous\_films;



   

 

 This returns only the title, genre, and year columns.

![Read data - terminal view](https://www.instaclustr.com/wp-content/uploads/IR0724-8-24.png)

**Select specific rows:**

  





























SELECT \* FROM catalog.famous\_films WHERE year=2010 AND title='Inception';

   1



  SELECT \* FROM catalog.famous\_films WHERE year=2010 AND title='Inception';



   

 

 This filters the data to return only rows where the year is 2010 and the title is ‘Inception’.

![Read data - terminal view](https://www.instaclustr.com/wp-content/uploads/IR0724-8-25.png)

 

 

Leveraging the power of Instaclustr for Apache Cassandra on AWS
---------------------------------------------------------------

Self-managed, and even Apache Cassandra on AWS, can be complex to manage without the required expertise. Boost your Apache Cassandra operations with Instaclustr, a trusted managed service provider known for its prowess in supporting this highly scalable and distributed NoSQL database. With a strong focus on reliability, performance, and security, Instaclustr provides a range of services to ensure smooth operations and optimal utilization of Cassandra clusters.

- **Effortless Deployment and Management:** Instaclustr takes the complexity out of managing and deploying Cassandra clusters. We offer automated provisioning and configuration of Cassandra nodes, making database setup and scaling a breeze. We also handle node replacements, repairs, and upgrades, freeing your developers to focus more on your applications and less on infrastructure maintenance.
- **Proactive Monitoring and Optimization:** With Instaclustr, you get real-time tracking of the health and performance of your Cassandra clusters. Through proactive monitoring and alerting, we can identify potential issues early and take necessary actions to prevent downtime or performance degradation. Plus, our performance tuning services ensure efficient query execution and minimal latency.
- **Uncompromising Security and Compliance:** Protecting your data is our priority. Our robust security measures, including encryption at rest and in transit, role-based access control, and regular security audits, safeguard your Cassandra clusters. Plus, we provide the tools and guidance you need to comply with industry standards and regulations like GDPR and HIPAA.
- **24/7 Expert Support:** Our experienced team of Cassandra experts is here to provide you with 24/7 technical support. You can count on us to promptly troubleshoot issues, provide best practice guidance, and assist with any Cassandra-related challenges.
- **Why Choose Managed Cassandra Over AWS Keyspaces:** While AWS Keyspaces offers a managed service for Cassandra, opting for Instaclustr’s managed Cassandra provides you with more flexibility and control. Instaclustr allows for greater customization of your clusters, which can be critical for businesses with specific performance or security requirements. Additionally, our dedicated support and tuning services ensure that your Cassandra implementation is optimized to suit your unique business needs.

**Ready to experience the best in Cassandra management? [Explore Instaclustr’s solutions for Apache Cassandra today](https://www.instaclustr.com/platform/managed-apache-cassandra/).**

For more information:

- [Instaclustr for Apache Cassandra](https://www.instaclustr.com/platform/managed-apache-cassandra/)
- [Instaclustr for Cassandra 5.0](https://www.instaclustr.com/platform/apache-cassandra-version-5-0/)
- [The World’s Largest Apache Kafka® and Apache Cassandra® Migration](https://www.instaclustr.com/blog/the-worlds-largest-apache-kafka-and-apache-cassandra-migration/)

 

 

 [ Add Instaclustr as a preferred source on Google ](https://google.com/preferences/source?q=instaclustr.com)



 

 ### Related content

 [Apache Cassandra tutorial: Cheat sheet, basic setup and vector search](https://www.instaclustr.com/education/apache-cassandra/apache-cassandra-tutorial-cheat-sheet-basic-setup-and-vector-search/) [Understanding Apache Cassandra: Complete 2026 Guide](https://www.instaclustr.com/education/apache-cassandra/apache-cassandra-database/) [A Comprehensive Guide to Apache Cassandra Architecture](https://www.instaclustr.com/blog/cassandra-architecture/) [DataStax: History, key features, limitations, and alternatives](https://www.instaclustr.com/education/datastax/datastax-history-key-features-limitations-and-alternatives/) [Datastax Astra: Solution overview, pros and cons](https://www.instaclustr.com/education/datastax/datastax-astra-solution-overview-pros-and-cons/) 

  

 

  ### Related content

 [ Understanding Apache Cassandra: Complete 2026 Guide 

 

 Apache Cassandra is a free, open source, NoSQL distributed database designed to handle massive amounts of data across commodity ... 

 

 

 

 

 

 

 ](https://www.instaclustr.com/education/apache-cassandra/apache-cassandra-database/) 

 [ Apache Cassandra on AWS: The basics and how to manage 

 

 Apache Cassandra is a highly scalable, open-source NoSQL database to handle large amounts of data across many commodity servers... 

 

 

 

 

 

 

 ](https://www.instaclustr.com/education/apache-cassandra/apache-cassandra-on-aws-the-basics-and-how-to-manage/) 

 [ Apache Cassandra tutorial: Cheat sheet, basic setup and vector search 

 

 Apache Cassandra is a distributed NoSQL database for handling large amounts of data across commodity servers without a single ... 

 

 

 

 

 

 

 ](https://www.instaclustr.com/education/apache-cassandra/apache-cassandra-tutorial-cheat-sheet-basic-setup-and-vector-search/) 

 

  Spin up a cluster  
In minutes
------------------------------

 

 [ Check it out ](/platform/)
