Amazon Keyspaces(Apache Cassandra 兼容)库和工具 - Amazon Keyspaces(Apache Cassandra 兼容)
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

Amazon Keyspaces(Apache Cassandra 兼容)库和工具

本节提供有关 Amazon Keyspaces(Apache Cassandra 兼容)库、代码示例和工具的信息。

库和示例

您可以在 GitHub 上的 AmazonAmazon samples 存储库中找到 Amazon Keyspaces 开源库和开发人员工具。

Amazon Keyspaces(Apache Cassandra 兼容)开发人员工具包

此存储库提供了 Docker 映像,其中包含适用于 Amazon Keyspaces 的实用开发人员工具。例如,它包括包含最佳实践的 CQLSHRC 文件、用于 cqlsh 的可选 Amazon 身份验证扩展,以及用于执行常见任务的助手工具。该工具包针对 Amazon Keyspaces 进行了优化,但也适用于 Apache Cassandra 集群。

https://github.com/aws-samples/amazon-keyspaces-toolkit.

Amazon Keyspaces(Apache Cassandra 兼容)示例

此存储库是我们的 Amazon Keyspaces 示例代码的官方列表。存储库按语言细分为几个部分(参见 Examples)。每种语言都有自己的示例子部分。这些示例演示了常见的 Amazon Keyspaces 服务实现和模式,您可以在构建应用程序时使用。

https://github.com/aws-samples/amazon-keyspaces-examples/.

Amazon 签名版本 4 (SigV4) 身份认证插件

借助这些插件,您可以使用 Amazon Identity and Access Management (IAM) 用户和角色来管理对 Amazon Keyspaces 的访问。

Java:https://github.com/aws/aws-sigv4-auth-cassandra-java-driver-plugin

Node.js:https://github.com/aws/aws-sigv4-auth-cassandra-nodejs-driver-plugin

Python: https://github.com/aws/aws-sigv4-auth-cassandra-python-driver-plugin

Go:https://github.com/aws/aws-sigv4-auth-cassandra-gocql-driver-plugin

重点介绍的示例和开发人员工具存储库

下面是精选的适用于 Amazon Keyspaces(Apache Cassandra 兼容)的实用社区工具。

Amazon Keyspaces 协议缓冲区

您可以将协议缓冲区 (Protobuf) 与 Amazon Keyspaces 配合使用,以提供 Apache Cassandra User Defined Types (UDT) 的替代方案。Protobuf 是一种免费的开源跨平台数据格式,用于序列化结构化数据。您可以使用 CQL BLOB 数据类型存储 Protobuf 数据并重构 UDT,同时跨应用程序和编程语言保留结构化数据。

此存储库提供了一个代码示例,用于连接到 Amazon Keyspaces、创建新表并插入包含 Protobuf 消息的行,然后以强一致性读取该行。

https://github.com/aws-samples/amazon-keyspaces-examples/tree/main/java/datastax-v4/protobuf-user-defined-types

为 Amazon Keyspaces(Apache Cassandra 兼容)指标创建 Amazon CloudWatch 控制面板的 Amazon CloudFormation 模板

此存储库提供了用于快速设置 Amazon Keyspaces 的 CloudWatch 指标的 Amazon CloudFormation 模板。使用此模板可以提供包含常用指标的可部署的预构建 CloudWatch 控制面板,让您更容易上手。

https://github.com/aws-samples/amazon-keyspaces-cloudwatch-cloudformation-templates.

将 Amazon Keyspaces(Apache Cassandra 兼容)与 Amazon Lambda 结合使用

该存储库包含一些示例,展示了如何从 Lambda 连接到 Amazon Keyspaces。下面是一些示例。

C#/.NET:https://github.com/aws-samples/amazon-keyspaces-examples/tree/main/dotnet/datastax-v3/connection-lambda

Java:https://github.com/aws-samples/amazon-keyspaces-examples/tree/main/java/datastax-v4/connection-lambda

另一个展示如何从 Python Lambda 部署和使用 Amazon Keyspaces 的 Lambda 示例可从以下存储库中获得。

https://github.com/aws-samples/aws-keyspaces-lambda-python

将 Amazon Keyspaces(Apache Cassandra 兼容)与 Spring 结合使用

此示例向您展示了如何将 Amazon Keyspaces 与 Spring Boot 结合使用。

https://github.com/aws-samples/amazon-keyspaces-examples/tree/main/java/datastax-v4/spring

将 Amazon Keyspaces(Apache Cassandra 兼容)与 Scala 结合使用

此示例展示了如何使用基于 Scala 的 SigV4 身份验证插件连接到 Amazon Keyspaces。

https://github.com/aws-samples/amazon-keyspaces-examples/tree/main/scala/datastax-v4/connection-sigv4

将 Amazon Keyspaces(Apache Cassandra 兼容)与 Amazon Glue 结合使用

此示例展示了如何将 Amazon Keyspaces 与 Amazon Glue 结合使用。

https://github.com/aws-samples/amazon-keyspaces-examples/tree/main/scala/datastax-v4/aws-glue

Amazon Keyspaces(Apache Cassandra 兼容)Cassandra query language (CQL) 到 Amazon CloudFormation 的转换器

该软件包实现了一种命令行工具,用于将 Apache Cassandra Query Language (CQL) 脚本转换为 Amazon CloudFormation (CloudFormation) 模板,该工具允许在 CloudFormation 堆栈中轻松管理 Amazon Keyspaces 架构。

https://github.com/aws/amazon-keyspaces-cql-to-cfn-converter.

Java 版 Apache Cassandra 驱动程序的 Amazon Keyspaces(Apache Cassandra 兼容)助手

此存储库包含将 DataStax Java 驱动程序用于 Amazon Keyspaces(Apache Cassandra 兼容)时的驱动程序策略、示例和最佳实践。

https://github.com/aws-samples/amazon-keyspaces-java-driver-helpers.

Amazon Keyspaces(Apache Cassandra 兼容)快速压缩演示

此存储库演示了如何压缩、存储和读取/写入大型对象,以提高性能,降低吞吐量和存储成本。

https://github.com/aws-samples/amazon-keyspaces-compression-example.

Amazon Keyspaces(Apache Cassandra 兼容)和 Amazon S3 编解码器演示

自定义 Amazon S3 编解码器支持 UUID 指针到 Amazon S3 对象的透明、用户可配置的映射。

https://github.com/aws-samples/amazon-keyspaces-large-object-s3-demo.