简体   繁体   English

DynamoDB 单活跨区域复制

[英]DynamoDB single-active cross region replication

I'm trying to understand DynamoDB replication & failover strategies but do not find any articles on the web which clarifies them.我试图了解 DynamoDB 复制和故障转移策略,但在 web 上找不到任何阐明它们的文章。 I understand cross-region replication can be achieved by DynamoDB with Global Tables but I also understand this is a multi-active table setup, meaning there are multiple active tables and multiple replica table.我知道跨区域复制可以通过带有全局表的 DynamoDB 实现,但我也知道这是一个多活动表设置,这意味着有多个活动表和多个副本表。 Is there a setup with single-active table and multiple replicas?是否有单活动表和多个副本的设置? I briefly read about this in this article but do not find any mentions anywhere else including AWS documentation.我在这篇文章中简要地读到了这一点,但没有在其他任何地方找到任何提及,包括 AWS 文档。

I'm also trying to understand failover strategies for both cases - Is there a DynamoDB Java Client which can failover across AZs in case of issues in one AZ for both reads & writes?我也在尝试了解这两种情况的故障转移策略——是否有一个 DynamoDB Java 客户端可以在一个 AZ 中出现读写问题时跨 AZ 进行故障转移?

DynamoDB Global Tables are always active-active but you can treat it as active-passive if you prefer. DynamoDB 全局表始终是主动-主动的,但您可以根据需要将其视为主动-被动。 Many people do.很多人都这样做。 That's useful if you want to use features like condition expressions, transactions, or do any non-idempotent wheres where you could have the same item being written around the same time in both regions with the second write happening before the first replicates, because this would cause the first write to be effectively lost.如果你想使用条件表达式、事务等特性,或者做任何非幂等的地方,你可以在两个区域大约同时写入相同的项目,第二次写入发生在第一次复制之前,这将很有用,因为这会导致第一个写入有效地丢失。

To do this you just route your write traffic to one region, and to failover you decide when it's time to write to another.要做到这一点,您只需将写入流量路由到一个区域,而要进行故障转移,您可以决定何时写入另一个区域。 The failover region is always happy to be an active region if you'll let it.如果您愿意,故障转移区域总是很乐意成为活动区域。

As for AZs, DynamoDB is a regional service meaning it crosses at least 3 AZs always and would keep operating fine even if a full AZ were to be down.至于可用区,DynamoDB 是一项区域服务,这意味着它始终跨越至少 3 个可用区,并且即使整个可用区宕机也能保持正常运行。 You don't have to worry about that.你不必为此担心。

Is there a setup with single-active table and multiple replicas是否有单活动表和多个副本的设置

Unfortunately there is no such single active and multiple replica setup for cross region in dynamodb using global tables, so failover strategy will be for multiple active tables and multiple replica tables!不幸的是,在使用全局表的 dynamodb 中没有跨区域的单活动和多副本设置,因此故障转移策略将针对多个活动表和多个副本表! - Source - docs - 来源 -文档

Fro failover strategies来回故障转移策略

According to docs根据文档

If a single AWS Region becomes isolated or degraded, your application can redirect to a different Region and perform reads and writes against a different replica table.如果单个 AWS 区域变得孤立或降级,您的应用程序可以重定向到不同的区域并对不同的副本表执行读取和写入。

This means this is seamingless smooth process which happends by default ofcourse you can add custom logic when to redirect这意味着这是默认情况下发生的无缝平滑过程当然您可以在重定向时添加自定义逻辑

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

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