Amazon Keyspaces

A fully managed Apache Cassandra-compatible database that provides serverless scalability and availability while using CQL (Cassandra Query Language) as-is

Overview

Amazon Keyspaces (for Apache Cassandra) is a fully managed database service that provides an Apache Cassandra-compatible CQL API. You can use existing Cassandra drivers and tools as-is, freeing you from Cassandra cluster operations (node management, patching, backups, scaling). Storage is automatically replicated across three Availability Zones, delivering a 99.999% availability SLA. Two billing models are available: on-demand capacity mode and provisioned capacity mode.

Cassandra Compatibility and Its Boundaries

Keyspaces supports the majority of CQL (Cassandra Query Language), but not every Cassandra feature is available. Supported features include table CRUD operations, secondary indexes, TTL (Time to Live), static columns, counters, user-defined types (UDTs), and lightweight transactions (LWT). Unsupported features include materialized views, SASI indexes, user-defined functions (UDFs), user-defined aggregates (UDAs), batch logs, and the Thrift API. Before migration, it's essential to run your existing schema and queries against Keyspaces using cqlsh to verify compatibility. AWS DMS can be used for migration from Cassandra, supporting both full load and CDC (Change Data Capture) for continuous replication. During migration, a dual-write approach that writes to both the source Cassandra cluster and Keyspaces minimizes downtime. Keyspaces conforms to the Cassandra 3.11 CQL specification, so features introduced in Cassandra 4.x and later are not available.

Selection Criteria vs. DynamoDB

Keyspaces and DynamoDB are both fully managed NoSQL databases, but they differ in data modeling and query flexibility. DynamoDB is a key-value/wide-column store that requires designing access patterns around partition keys and sort keys upfront. GSIs (Global Secondary Indexes) accommodate additional access patterns, but each index incurs additional cost. Keyspaces is a wide-column store with flexible data modeling through partition keys and clustering columns. CQL's expressiveness exceeds DynamoDB's PartiQL, with range queries, IN clauses, ORDER BY, and ALLOW FILTERING written naturally. As a selection guide: for new projects designed AWS-native, DynamoDB is the better fit; for migrating existing Cassandra workloads, Keyspaces is appropriate. DynamoDB's integration with the AWS ecosystem (Streams, DAX, Global Tables, PartiQL) is overwhelmingly richer, with easy Lambda trigger and EventBridge Pipes connectivity. Keyspaces' strength lies in Cassandra ecosystem compatibility (drivers, ORMs, tools), making it advantageous when prioritizing portability in multi-cloud or hybrid environments.

Capacity Mode Selection and Cost Optimization

Keyspaces offers two capacity modes similar to DynamoDB: on-demand and provisioned. On-demand mode is fully pay-per-request, suited for workloads with unpredictable traffic patterns and development environments. Provisioned mode pre-sets read/write capacity units and is approximately 20-30% cheaper than on-demand. With Auto Scaling enabled, capacity automatically adjusts to traffic fluctuations. For cost optimization, leveraging TTL for automatic data deletion is effective. Setting TTL on data that becomes unnecessary after a certain period - such as log data and session data - controls storage cost growth. Point-in-time recovery (PITR) adds approximately 20% to storage costs when enabled, but it's essential for recovering from accidental data loss and should always be enabled in production. Encryption offers three choices: AWS owned keys (free), AWS managed keys, and customer managed keys (KMS), selected based on compliance requirements.

共有するXB!