Functional Differences: Amazon Keyspaces versus Apache Cassandra - Amazon Keyspaces(针对 Apache Cassandra)
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 AWS 服务入门


Functional Differences: Amazon Keyspaces versus Apache Cassandra

Following are the functional differences between Amazon Keyspaces and Apache Cassandra.

Apache Cassandra APIs, Operations, and Data Types

Amazon Keyspaces supports all commonly used Cassandra data-plane operations, such as creating keyspaces and tables, reading data, and writing data. 要查看当前支持的项,请参阅Amazon Keyspaces 中支持的 Cassandra APIs、操作和数据类型.

Asynchronous Creation and Deletion of Keyspaces and Tables

Amazon Keyspaces performs data definition language (DDL) operations, such as creating and deleting keyspaces and tables, asynchronously. To learn how to monitor the creation status of resources, see Creating Keyspaces in Amazon Keyspaces and 在 Amazon Keyspaces 中创建表. For a list of DDL statements in the CQL language reference, see Amazon 键空间中的 DDL 语句(数据定义语言).


Amazon Keyspaces (for Apache Cassandra) uses AWS Identity and Access Management (IAM) for user authentication and authorization, and supports the equivalent authorization policies as Apache Cassandra. As such, Amazon Keyspaces does not support Apache Cassandra's security configuration commands.


Amazon Keyspaces supports unlogged batch commands with up to 30 commands in the batch. 批处理中仅允许无条件的 INSERTUPDATEDELETE 命令。不支持记录的批处理。


Amazon Keyspaces is serverless, so there are no clusters, hosts, or Java virtual machines (JVMs) to configure. Cassandra’s settings for compaction, compression, caching, garbage collection, and bloom filtering are not applicable to Amazon Keyspaces and are ignored if specified.

CQL 查询吞吐量调整

Amazon Keyspaces supports up to 3000 CQL queries per TCP connection per second, but there is no limit on the number of connections a driver can establish. Most open source Cassandra drivers establish a connection pool to Cassandra and load balance queries over that pool of connections. Amazon Keyspaces exposes 9 peer IP addresses to drivers, and the default behavior of most drivers is to establish a single connection to each peer IP address. 因此,使用默认设置的驱动程序的最大 CQL 查询吞吐量将是每秒 27000 次 CQL 查询。要增大此数字,我们建议增加驱动程序在其连接池中维护的每个 IP 地址的连接数。例如,如果将每个 IP 地址的最大连接数设置为 2,则将使驱动程序的最大吞吐量增加一倍,达到每秒 54000 次 CQL 查询。

Empty Strings

Amazon Keyspaces supports empty strings and blob values. However, empty strings and blobs are not supported as clustering column values.


Amazon Keyspaces (for Apache Cassandra) fully supports compare and set functionality on INSERT and UPDATE commands, which are known as lightweight transactions (LWTs) in Apache Cassandra. As a serverless offering, Amazon Keyspaces (for Apache Cassandra) provides consistent performance at any scale, including for lightweight transactions. With Amazon Keyspaces, there is no performance penalty for using lightweight transactions.


The system.peers table entries correspond to Amazon Keyspaces load balancers. 要获得最佳结果,我们建议使用轮询负载平衡策略并调整每个 IP 的连接数以满足应用程序需求。


Amazon Keyspaces paginates results based on the number of rows that Keyspaces reads to process a request, not the number of rows returned in the result set. As a result, some pages may contain less rows than you specify in PAGE SIZE for filtered queries. In addition, Amazon Keyspaces paginates results automatically after reading 1MB of data to provide customers with consistent, single-digit millisecond read performance. 有关更多信息,请参阅 在 Amazon 键空间中对结果进行分页


Amazon Keyspaces supports deleting items in range. 在单个命令中,范围删除的限制为 1000 个行。范围删除是原子删除,但它不是孤立的。

System Tables

Amazon Keyspaces populates the system tables required by Apache 2.0 open source Cassandra drivers. 对客户端可见的系统表包含经过身份验证的用户所特有的信息。The system tables are fully controlled by Amazon Keyspaces and are read-only.