Open In App

What Is AWS Keyspaces? How To Setup AWS Keyspaces

Last Updated : 07 Mar, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

AWS Keyspaces is a fully managed, scalable, and highly available NoSQL database service configured by Amazon Web Services (AWS) for people to use. It is based on Apache Cassandra Tech. With AWS Keyspaces, users can store, query, and manage semi-structured data efficiently without knowing how to manage the underlying infrastructure. It offers features such as automatic proper scaling, replication across multiple data centers for high availability, and built-in high-security controls. In essence, it provides a reliable and durable solution for storing and accessing large data sets in a cloud environment in a very effective way.

What Is AWS Keyspaces?

In simpler words, AWS Keyspaces is like a high-tech storage system for large amounts of information in key and cell formats. It’s managed by Amazon and uses a special technology to organize and handle data efficiently. Think of it as a super organized digital library where you are free to store and find your files easily with few queries, without needing to worry about how it looks behind the scenes.

How Does AWS Keyspaces Work?

Amazon Keyspaces streamlines the management of Cassandra, contrasting traditional Cassandra architecture with its own. In Apache Cassandra, clusters are comprised of nodes that must be individually managed, causing operational challenges as the cluster scales. Conversely, Amazon Keyspaces eliminates the need for server management, enabling developers to prioritize application development. It offers flexible throughput modes and maintains compatibility with Cassandra Query Language (CQL), ensuring ease of transition for existing applications. Effective data modeling is crucial for optimizing performance in Amazon Keyspaces, requiring a distinct approach from relational databases. Accessing Amazon Keyspaces involves utilizing CQL and Cassandra drivers, with minimal adjustments needed in the application configuration.

Accessing Amazon Keyspaces (for Apache Cassandra) in AWS Console

Using the console, AWS CloudShell, an Apache 2.0 licensed Cassandra driver, the AWS SDK, or a CQLSH client, you can access Amazon Keyspaces programmatically. Drivers and clients compatible with Apache Cassandra 3.11.2 are supported by Amazon Keyspaces. You need to finish configuring AWS Identity and Access Management before you can access Amazon Keyspaces. After that, you can provide IAM identity access permissions to Amazon Keyspaces.

Setting Up Amazon Keyspaces

IAM is used to control access to Amazon Keyspaces resources. You can attach rules that provide read and write access to particular resources in Amazon Keyspaces to IAM users, roles, and federated identities.

You can use one of the AWS-managed policies for Amazon Keyspaces to begin issuing access to an IAM identity:

  1. AmazonKeyspacesFullAccess: This policy allows users to have complete access to all features and resources within Amazon Keyspaces.
  2. AmazonKeyspacesReadOnlyAccess_v2: It gives Amazon Keyspaces read-only access.

Working With Amazon Keyspaces: A Step By Step Guide

Follow the AWS setup requirements in Accessing Amazon Keyspaces (for Apache Cassandra) mentioned above before beginning this walk through. AWS registration and the creation of an Identity and Access Management (IAM) user with access to Amazon Keyspaces are included in these stages.

Step 1: Create a keyspace and a table in Amazon Keyspaces

  • Related tables that are pertinent to one or more applications are grouped together in a keyspace.
  • One or more tables and the replication technique for each table are defined within a keyspace.

amazon_keyspaces

  • Please click Get Started and then CQL Editor.

CQL Editor

  • Please execute the below query for creating keyspace named “devscripter2024keyspace”

Executing the query

  • Please execute the below query for creating table named “devscripter2024table”

Executing query with "devscripter2024table""

  • Let`s verify this by clicking on Table (Newly added button) in AWS Keyspace.

Verifying The table

Step 2: Create, Read, Update, And Delete Data (CRUD)

  • Let`s see how to insert sample data in the table which we just created using CQL..

Inserting data into the table

  • Let`s see how to fetch the sample data , inserted recently using CQL..

Fetching the data with query

  • Let’s see how to update the data with some new value using CQL.

Updating the data with query

  • Let`s see how to delete the data using CQL.

Deleting the data with query

  • Let’s fetch the data again just for validations.

validation of data

Step 3: Delete A Table And Keyspace In Amazon Keyspaces

  • Deleting the Table.

Deleting the table

  • Validating the Table and its contents.

Validating the table with contents

  • Deleting the existing Keyspace.

deleting the existing keyspace

  • Fantastic Job! We are not able to see the Table and Keyspace, that means it is gone now.

Successfully deleted table and keyspaces

AWS Keyspaces – FAQs

What Is AWS Keyspaces, And How Does It Differ From Traditional Databases?

AWS Keyspaces is a managed database service by Amazon that uses special technology to efficiently organize and handle data. It’s like a highly organized digital library where you can easily store and find your files with minimal effort, without needing to understand the technical details.

Do We Have Any Minimum Fees To Use AWS Keyspace?

No, with Amazon Keyspaces (for Apache Cassandra), you only pay for the specific resources you use, such as reading and writing data, storage, and networking. There’s no set minimum cost.

What Is The Maximum Throughput An Amazon Keyspaces Table Can Support?

Amazon Keyspaces tables can scale up and down to support virtually unlimited throughput and storage needs.

What Is The Maximum Size Of An AWS Keyspace Table?

There’s no limit on the size of a table or the number of rows you can store in it with AWS Keyspaces.

What kind of performance can I expect from Amazon Keyspaces?

Amazon Keyspaces provides consistent single-digit-millisecond performance for reading and writing data, along with high availability and durability of your data.

Do I Need To Change Client Drivers To Use Amazon Keyspaces?

No, you can continue using your existing Apache 2.0–licensed Cassandra drivers with Amazon Keyspaces.



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads