In just three short years, Amazon DynamoDB has emerged as the backbone for many powerful Internet applications such asadroll.,德鲁瓦,DeviceScape,和Battlecamp.。许多快乐的开发人员正在必威体育精装版app官网使用DynamoDB每天处理万亿的请求。我很高兴与您分享,今天我们正在通过流,跨区域复制和数据库触发来扩展DynamoDB。在此博客文章中,我将解释这三种新功能如何授权使用分布式系统架构构建应用程序,并使用任何刻度工作的DynamoDB创建响应性,可靠性和高性能应用程序。

DynamoDB Streams使您的应用程序能够获得表的项目级别更改的实时通知。Streams为您提供底层基础架构来创建新的应用程序,例如连续更新的自由文本搜索索引,缓存或需要最新表更改的其他创意扩展。DynamoDB Streams是今天宣布的另外两个功能背后的启用技术:跨区域复制在带有按钮的AWS区域对DynamoDB表的相同副本,并且触发器在流上执行AWS Lambda函数,允许您响应更改数据条件。让我扩展他们的每一个。

DynamoDB Streams.

DynamoDB Streams.provides you with a time-ordered sequence, or change log, of all item-level changes made to any DynamoDB table. The stream is exposed via the familiarAmazon Kinesisinterface. Using streams, you can apply the changes to a full-text search data store such as Elasticsearch, push incremental backups to Amazon S3, or maintain an up-to-date read cache.

I have heard from many of you that one of the common challenges you have is keeping DynamoDB data in sync with other data sources, such as search indexes or data warehouses. In traditional database architectures, database engines often run a small search engine or data warehouse engines on the same hardware as the database. However, the model of collocating all engines in a single database turns out to be cumbersome because the scaling characteristics of a transactional database are different from those of a search index or data warehouse. A more scalable option is to decouple these systems and build a pipe that connects these engines and feeds all change records from the source database to the data warehouse (e.g., Amazon Redshift) and Elasticsearch machines.

The velocity and variety of data that you are managing continues to increase, making your task of keeping up with the change more challenging as you want to manage the systems and applications in real time and respond to changing conditions. A common design pattern is to capture transactional and operational data (such as logs) that require high throughput and performance in DynamoDB, and provide periodic updates to search clusters and data warehouses. However, in the past, you had to write code to manage the data changes and deal with keeping the search engine and data warehousing engines in sync. For cost and manageability reasons, some developers have collocated the extract job, the search cluster, and data warehouses on the same box, leading to performance and scalability compromises. DynamoDB Streams simplifies and improves this design pattern with a distributed systems approach.

You can enable the DynamoDB Streams feature for a table with just a few clicks using the AWS Management Console, or you can use the DynamoDB API. Once configured, you can use an Amazon EC2 instance to read the stream using the亚马逊kinesis界面,并将更改与搜索群集,数据仓库和任何数量的数据消费者并行应用。您可以根据您的要求读取它们实时发生或批处理的更改。在启动时,在创建它的流中可以在Stream中提供项目的更改记录。一个AWS Lambda功能is a simpler option that you can use, as it only requires you to code the logic, set it, and forget it.

无论您选择哪种机制使用,我们都会立即可用的流数据(以毫秒为单位),您想要应用更改的速度取决于您。此外,您可以选择编程后发后操作,例如运行聚合分析功能或更新其他依赖表。这种新的设计模式允许您将远程数据消费者的电流以您想要的频率驻留在DynamoDB中的核心交易数据,从而可以更好地提供可用性,可扩展性和性能。Amazon Kinesis API模型为您提供为为Amazon Kinesis和DynamoDB Streams编写的流式应用程序之间提供统一的编程体验。

DynamoDB Cross-region Replication

许多现代数据库应用程序依赖于灾难恢复的跨区域复制,最大限度地减少读取延迟(通过在本地提供数据),易于迁移。今天,我们正在为DynamoDB启动跨域复制支持,使您可以在几下点击即可维护AWS区域的DynamoDB表的相同副本。我们为您提供了一个具有简单UI的应用程序来设置和管理跨区域复制组并轻松构建全局分布式应用程序。设置复制组时,DynamoDB会自动在表之间配置流,将原始数据从源引导到目标,并将两个同步在数据变化时保持同步。我们公开分享源代码跨区域复制实用程序, which you can extend to build your own versions of data replication, search, or monitoring applications.

应用此跨区域复制功能的一个很好的示例是Mapbox.是一个流行的映射平台,使开发人员能够将位置信息集成到他们的移动或在线应用程序中。必威体育精装版app官网MapBox优惠来自全球各地的位置数据及其关键焦点区域的供货情况和性能。Mapbox的软件开发人员Jake Pruitt的一部分是预览程序,Software Developer告诉我们,“必威体育精装版app官网DynamoDB Streams解锁跨区域复制 - 一个关键的功能,使我们能够完全迁移到DynamoDB。跨区域复制允许我们在全球分发数据以进行冗余和速度。“新功能使它们能够提供更好的可用性并提高性能,因为它们可以从最近的数据中心访问所有所需数据。

DynamoDB触发了

从数据库的曙光,拉动方法是与数据库交互的首选模型。要检索数据,预计应用程序会使API调用并读取数据。要从表中获取更新,客户必须与另一个API调用不断调用数据库。关系数据库使用触发器作为启用应用程序响应数据更改的机制。但是,触发器的执行发生在同一台计算机上,作为运行数据库的那个,错误的触发器可以在整个数据库上肆虐。此外,这种机制对快速移动的数据集和大型数据库不符号。

为实现真正可扩展,高性能和灵活的系统,我们需要将触发器的执行从数据库中解脱出来,并在发生时将数据更改变为应用程序。输入dynamodb触发器 - 一种事件驱动的机制,使开发人员能够在响应DynamoDB表中的特定数据更改时定义在数据库外部运必威体育精装版app官网行的Java或JavaScript函数。具体而言,这些功能被配置和执行,如AWS Lambda函数,从而为您提供缩放的能力,只需支付所消耗的计算秒的分数。所有你需要做的就是注册AWS Lambda功能需要响应于DynamoDB表中的特定数据更改来执行。lambda和dynamodb照顾其余的。DynamoDB创建流并将数据推到触发器代码。Lambda自动创建并管理处理触发器所需的资源。由于Lambda函数在与DynamoDB表的主机上执行,因此DynamoDB表和Lambda函数独立缩放,因此隔离错误触发的风险。

触发器是强大的机制,可动态和实时对事件做出反应。这是一个实用的真实界限,触发器对企业非常有用:Tokyu手是一个快速增长的业务,拥有70多家商店。他们的云架构有两个主要组成部分:销售点系统和商品传销系统。销售点系统记录了所有购买的变化,并将其存储在DynamoDB中。商品系统用于管理库存并确定用于重新填充库存的正确时序和数量。它们的主要挑战一直在不断保持这些系统。在预览DynamoDB触发器后,Naoyuki Yamazaki,云建筑师告诉我们,“Tokyu手is running in-store point-of-sales system backed by DynamoDB and various AWS services. We really like the full-managed service aspect of DynamoDB. With DynamoDB Streams and DynamoDB Triggers, we would now make our systems more connected and automated to respond faster to changing data such as inventory.” This new feature will help them manage inventory better to deliver a good customer experience while gaining more business efficiency.

您还可以使用触发器来电源许多现代的东西(物联网)用例。例如,您可以将家庭传感器编程,将温度,水,气体和电力直接写入DynamoDB。然后,您可以设置Lambda函数来侦听DynamoDB表上的更新,并在检测到特定的更改级别时,通过移动设备自动通知用户。

Summing It All Up

如果您正在构建移动,Ad-Tech,Gaming,Web或IoT应用程序,则可以使用DynamoDB构建全局分布式应用程序,以任何刻度提供一致和快速性能。通过我提到的三个新功能,您现在可以丰富这些应用程序来消耗高速数据的变化,并在接近实时更新。这对您来说意味着什么,使用DynamoDB,您现在可以授权创建困难和昂贵以前构建和管理的独特应用程序。让我用一个例子来说明。

让我们说,您正在管理全球供应商的供应链系统。我们都知道实时库存管理可以为这种系统提供的优势。然而,以低成本建立提供速度,可扩展性和可靠性的这样的系统并不容易。在此之上,添加了库存管理的实时更新或使用您自己的IT基础架构的自定义业务逻辑扩展系统的实时更新是复杂且昂贵的。

This is where AWS and DynamoDB with cross-region replication, DynamoDB Triggers, and DynamoDB Streams can serve as a one-stop solution that handles all your requirements of scale, performance, and manageability, leaving you to focus on your business logic. All you need to do is to write the data from your products into DynamoDB. As illustrated in this example, if you use RFID tags on your products, you can directly feed the data from the scanners into DynamoDB. Then, you can use cross-region replication to sync the data across multiple AWS regions and bring the data close to your supply base. You can use triggers to monitor for inventory changes and send notifications in real time. To top it all off, you will have the flexibility to extend the DynamoDB Streams functionality for your custom business requirements. For example, you can feed the updates from the stream into a search index and use it for a custom search solution, thereby enabling your internal systems to locate the updates to inventory based on text searches. When you put it all together, you have a powerful business solution that scales to your needs, lets you pay only for what you provision, and helps you differentiate your offerings in the market and drive your business forward faster than before.

DynamoDB流,跨区域复制和DynamoDB触发器的组合肯定提供了巨大的潜力,以实现新的和有趣的用户场景,其努力显着更少。您可以了解有关这些功能的更多信息杰夫·巴尔的博客。我肯定渴望听到每个人将如何使用Streams为您的企业提供更多价值。随意添加以下评论并分享您的想法。

评论