简体   繁体   English

多区域 Postgres 延迟问题 Azure

[英]Multi Region Postgres Latency Issue Azure

Architecture which we are using currently is as below我们目前使用的架构如下

Private Web App Services hosted in US Region and India Region.私有 Web 美区和印度区托管的应用服务。 Both the apps are behind the respective App Gateway, this app Gateway is behind the front door which helps us serve the request from the nearest app gateway.这两个应用程序都在各自的应用程序网关后面,这个应用程序网关在前门后面,帮助我们处理来自最近应用程序网关的请求。 But Both apps uses the same postgres which is present in US region.但是这两个应用程序都使用美国地区存在的相同 postgres。

Now our issue is when we hit the api from US response time is less then 2sec whereas when we hit the api from India region it takes 70sec.现在我们的问题是,当我们从美国地区拨打 api 时,响应时间少于 2 秒,而当我们从印度地区拨打 api 时,则需要 70 秒。

How can we reduce the latency?我们怎样才能减少延迟? 在此处输入图像描述

Actually, the problem is the APIs does write operation due to which we cannot a read replica.实际上,问题是 API 执行写操作,因此我们无法读取副本。

There a few things you can do您可以做一些事情

1- Add a cache layer to both regions and rather than querying directly on DB, check if the data is available in the cache first, and if it's not, get it from DB and add to the cache layer. 1- 向两个区域添加一个缓存层,而不是直接在数据库上查询,首先检查数据是否在缓存中可用,如果不可用,则从数据库中获取数据并添加到缓存层。

2- Add a secondary database on India region which will be a read only. 2- 在印度地区添加一个只读的辅助数据库。

PS: You may have stale data with both approaches so you should sync properly according to your requirements PS:这两种方法都可能有过时的数据,所以你应该根据你的要求正确同步

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

相关问题 面临 Azure cosmos 多区域 AKS 更改提要处理器的问题 - Facing issue with Azure cosmos change feed processor for Multi region AKS 在 Azure EventHub 消费者中面临延迟问题 - Facing latency issue in Azure EventHub consumer 主动主动模式的多区域架构 azure - Multi region architecture with active active mode azure Postgres 数据库的多区域可用性能够为我们的客户提供 4+9 的可用性? - Multi-Region Availability for Postgres Database to be able to offer our clients 4+ 9's of availability? KMS 的多区域策略 - Multi region strategy for KMS 多区域 Aurora 上的多主机 - 可能吗? - multi-master over multi-region Aurora - possible? Azure Lighthouse - 获取订阅级别部署的区域 - Azure Lighthouse - Get the region for subscription level deployment 如何构建多区域 firebase 应用程序? - How to structure a multi-region firebase app? 无法从 Azure aks 连接到 Azure Postgres - unable to connect to Azure Postgres from Azure aks 我们不能在具有地理冗余、多区域写入和无服务器容量的任何区域中创建 Azure CosmosDB Core(SQL) API 帐户吗? - Can't we create Azure CosmosDB Core(SQL) API account in any regions with Geo-Redundancy, Multi-region Writes and Serverless capacity?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM