繁体   English   中英

使用 CosmosDB 作为 Golang 的键值对存储

[英]Using CosmosDB as a key-value store with Golang

我试图找出在 Microsoft Azure 环境中使用来自 Golang 的键值存储的最佳方法,并了解 CosmosDB 可以提供这一点,但我对如何最好地使用它有点困惑。 我真正想要的一件事是能够为我插入到表中的实体设置 TTL。

I see that CosmosDB has the Tables API, however I the only Golang package I see that would let me interface with that is the package intended to be used with Azure Table Storage, and there's no way to programmatically set the TTL in that case, correct ?

我相信 SQL API 和 Mongo API 都可以为我提供文档数据库。 那是对的吗? 这是否适合用作具有合理快速查找时间的 ak/v 存储?

谢谢

Following on Mark's response, please use the Cosmos DB Go SDK: https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/data/azcosmos

目前支持:

  • 通过主密钥和 RBAC/MSI/AAD 进行身份验证
  • 点操作(涵盖您的 kv 需求)
  • 事务批处理
  • 单分区查询

Go 页面包含 package 的示例和使用文档。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM