DB固定集合迁移到无限集合

DB固定集合迁移到无限集合

本文介绍了将具有分区键的Cosmos DB固定集合迁移到无限集合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Cosmos DB固定集合.该集合已创建,并使用了分区键.

I have a Cosmos DB Fixed Collection. The collection was created and utilizes a partition key.

从此固定集合到无限集合的迁移选项是什么?

What are the migration options from this Fixed Collection to an Unlimited Collection?

我知道我可以使用 Azure Cosmos DB迁移工具将数据导出到JSON,然后将其导入到新配置的Unlimited Collection中. Microsoft还支持其他任何选项吗?

I know that I can use the Azure Cosmos DB Migration Tool to export data to JSON, then import it into a newly provisioned Unlimited Collection. Are there any other options supported by Microsoft?

推荐答案

Azure团队编写了一个使用Cosmos Change Feed和Change Feed Processor的迁移工具:

The Azure team wrote a migration tool that uses Cosmos Change Feeds and the Change Feed Processor:

https://github.com/Azure/azure -documentdb-dotnet/tree/master/samples/ChangeFeedMigrationTool

变更供稿处理器通过检查租约集合来工作.租约集合包含每个源集合分区的文档.如果此租约集合中没有文档(这不会是您第一次启动该程序),则源集合中的所有文档都将被视为更改.

The change feed processor works by checking a lease collection. The lease collection holds a document for each of your source collection partitions. If there are no documents in this lease collection (which there won't be the first time you start the program), all documents in your source collection are considered changes.

迁移工具将所有更改的文档复制到目标集合(DocumentFeedObserver.ProcessChangesAsync).

The migration tool copies any changed document into a destination collection (DocumentFeedObserver.ProcessChangesAsync).

这篇关于将具有分区键的Cosmos DB固定集合迁移到无限集合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 18:47