简体   繁体   English

避免RDS实例跨地域调用

[英]Avoid cross-region call on RDS instance

I am working with a web application that uses AWS RDS database, currently, It is available only on India(Mumbai origin), form now, I want to make it available for multiple regions(US-Ohio and Mumbai both).我正在使用一个使用 AWS RDS 数据库的 Web 应用程序,目前,它仅在印度(孟买起源)可用,现在形成,我想让它在多个地区(美国俄亥俄州和孟买)可用。 In that case, is there any possibility to configure my RDS for below scenarios在这种情况下,是否有可能为以下场景配置我的 RDS

The request comes from US-Ohio it severs by RDS instance from Ohio region and the request comes from India then data will server by RDS instance from Mumbai region and both RDS instance replicate each other means both instance act as single DB请求来自美国俄亥俄州,它由俄亥俄州地区的 RDS 实例提供服务,请求来自印度,然后数据将由孟买地区的 RDS 实例提供服务,两个 RDS 实例相互复制意味着两个实例都充当单个数据库

Thanks in Advance提前致谢

A typical (single-server) database keeps all information in one location (eg Mumbai).典型的(单服务器)数据库将所有信息保存在一个位置(例如孟买)。

You could add a read replica in another region (eg Ohio).您可以在另一个区域(例如俄亥俄州)添加只读副本 This would replicate information to Ohio, but the replica in Ohio could only be used for querying (reading) data.这会将信息复制到俄亥俄州,但俄亥俄州的副本只能用于查询(读取)数据。 All updates would need to be made to the primary database in Mumbai.所有更新都需要对孟买的主数据库进行。 This makes querying faster without needing "multiple masters".这使得查询速度更快,而无需“多主”。

From Working with Amazon Aurora Global Database :使用 Amazon Aurora 全球数据库

An Aurora global database consists of one primary AWS Region where your data is mastered, and up to five read-only, secondary AWS Regions.一个Aurora 全球数据库由一个主 AWS 区域和最多五个只读的次要 AWS 区域组成,您的数据在其中掌握。 Aurora replicates data to the secondary AWS Region with typical latency of under a second. Aurora 以不到一秒的典型延迟将数据复制到辅助 AWS 区域。 You issue write operations directly to the primary DB instance in the primary AWS Region.您直接向主要 AWS 区域中的主要数据库实例发出写入操作。 An Aurora global database uses dedicated infrastructure to replicate your data, leaving database resources available entirely to serve application workloads. Aurora 全球数据库使用专用基础架构来复制您的数据,让数据库资源完全可用以服务应用程序工作负载。 Applications with a worldwide footprint can use reader instances in the secondary AWS Regions for low latency reads.覆盖全球的应用程序可以使用辅助 AWS 区域中的读取器实例进行低延迟读取。 In the unlikely event your database becomes degraded or isolated in an AWS region, you can promote one of the secondary AWS Regions to take full read-write workloads in under a minute.万一您的数据库在 AWS 区域中降级或孤立,您可以提升一个辅助 AWS 区域以在一分钟内处理完整的读写工作负载。

The Aurora cluster in the primary AWS Region where your data is mastered performs both read and write operations.掌握数据的主要 AWS 区域中的 Aurora 集群执行读取和写入操作。 The cluster in the secondary region enables low-latency reads.次要区域中的集群支持低延迟读取。 You can scale up the secondary clusters independently by adding one of more DB instances (Aurora Replicas) to serve read-only workloads.您可以通过添加多个数据库实例之一(Aurora 副本)来独立扩展辅助集群以提供只读工作负载。 For disaster recovery, you can remove and promote one of the secondary clusters to allow full read and write operations.对于灾难恢复,您可以删除和提升辅助集群之一,以允许完整的读写操作。

Going one step further, you could Work with Amazon Aurora Multi-Master Clusters where all DB instances have read-write capability:更进一步,您可以使用 Amazon Aurora 多主集群,其中所有数据库实例都具有读写功能:

In a multi-master cluster , all DB instances can perform write operations.多主集群中,所有的数据库实例都可以进行写操作。 The notions of a single read-write primary instance and multiple read-only Aurora Replicas don't apply.单个读写主实例和多个只读 Aurora 副本的概念不适用。 There isn't any failover when a writer DB instance becomes unavailable, because another writer DB instance is immediately available to take over the work of the failed instance.当写入器数据库实例变得不可用时,不会有任何故障转移,因为另一个写入器数据库实例可立即接管故障实例的工作。 We refer to this type of availability as continuous availability , to distinguish it from the high availability (with brief downtime during failover) offered by a single-master cluster.我们将这种可用性称为持续可用性,以将其与单主集群提供的高可用性(故障转移期间短暂停机)区分开来。

Each option is a trade-off between performance, cost and complexity.每个选项都是性能、成本和复杂性之间的权衡。 It is highly likely that a Read Replica or Global Database will be sufficient for your needs, because most database operations are queries rather than updates .只读副本全局数据库很可能足以满足您的需求,因为大多数数据库操作是查询而不是更新

You should experiment with each option and run performance tests on your application to confirm that you are achieving your desired performance.您应该对每个选项进行试验并在您的应用程序上运行性能测试,以确认您实现了所需的性能。 Also, review the associated costs (which will likely double due to having multiple servers, plus there will be additional costs for Data Transfer between the two regions).此外,请查看相关成本(由于拥有多台服务器,成本可能会翻倍,另外两个区域之间的数据传输还会产生额外成本)。

Also, please note that the above capabilities will differ depending upon the database engine you choose.另外,请注意,上述功能会因您选择的数据库引擎而异。 (The above are for Amazon Aurora running MySQL.) (以上适用于运行 MySQL 的 Amazon Aurora。)

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

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