在多区域Azure Cosmos DB中更改Feed [英] Change Feed in multi-region Azure Cosmos DB

查看:106
本文介绍了在多区域Azure Cosmos DB中更改Feed的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Cosmos DB多区域(单个区域写入)帐户.目前,在美国东部和美国西部启用了此功能.书写区域是美国西部.

I am using Cosmos DB multi-region (single region write) account. Currently it is enabled in East US and West US. The write region is West US.

Change Feed侦听器已部署在美国东部和美国西部.我想了解一下,如果我可以指定部署在美国东部的侦听器读取来自美国东部的更改提要,而在美国西部的侦听器则读取来自美国西部的更改提要.还是所有的收听者都将始终从写入区域读取更改提要"?

The Change Feed listeners are deployed in both East US and West US. I wanted to understand, if I can specify that the listeners deployed in East US reads Change Feed from East US and listeners in West US reads Change Feed from West US. Or all the listeners will always read Change Feed from write region?

推荐答案

您当然可以使您的听众从最近的区域进行读取,这将改善您的延迟.您可以使用

You can certainly make your listeners read from the closest region, which should improve your latency. You can use the PreferredLocations attribute to customize that:

var localPolicy = new ConnectionPolicy();
localPolicy.PreferredLocations.Add("East US");

// Builder initialization
.WithFeedCollection(new DocumentCollectionInfo()
{
    DatabaseName = DbName,
    Uri = new Uri(uri),
    CollectionName = feedCollection,
    MasterKey = key,
    ConnectionPolicy = localPolicy
})
.BuildAsync();

这篇关于在多区域Azure Cosmos DB中更改Feed的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆