适用于AWS DynamoDB流的挂钩 [英] Hooks for AWS DynamoDB streams

查看:93
本文介绍了适用于AWS DynamoDB流的挂钩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AWS DynamoDB提供,可帮助捕获表活动。据我了解,捕获梦中变化的流程是 Stream ARN->;碎片-> shardIterator->记录。为了使应用程序监视Dynamo表上的更改,它必须继续执行上述周期。我想知道是否可以通过可以监视那些更改并触发应用程序可以监听的钩子来简化此流程。我知道有一个可以执行上述周期和警报的AWS Lambda集成,但是我想知道应用程序是否可以侦听AWS Lambda警报

AWS DynamoDB provides streams which helps in capturing the table activity. To my understanding the flow of capturing changes in the dream is Stream ARN -> Shards -> shardIterator -> Records. In order for an application to monitor changes on a Dynamo table, it will have to keep on performing the above cycle. I was wondering if this flow can be simplified by hooks that can monitor those changes and trigger, which my application can listen to. I'm aware that there is a AWS Lambda integration which can perform the above cycle and alert, but I was wondering if it can be possible for an application to listen on AWS lambda alerts

npm软件包 dynamodb-stream 确实使使用更改更容易,但是如果需要尽可能快地捕获所有表活动,则轮询机制似乎并不是最有效的

The npm package dynamodb-stream does make it easier to consume the changes, but the polling mechanism doesn't seem to be the most efficient, if all table activity needs to be captured as fast as possible

推荐答案

我不确定该npm软件包的用途是什么,您可以将事件触发的Lambda与DynamoDB流一起使用。基本上,Lambda服务(而非您的单个羔羊)将轮询Stream以查找更改,并在找到它们时执行您的羔羊。比使用基于某种荒谬的计时器的废话要干净得多。 此处是文档。

I'm not sure what the purpose of that npm package is, you can just use an event triggered Lambda with DynamoDB Streams. Basically, the Lambda service (not your individual lamb) will poll the Stream for changes and execute your lamb when it finds them. Much cleaner than using some kind of ridiculous timer based nonsense. Here are the docs on it.


Amazon DynamoDB与AWS Lambda集成在一起,因此您可以创建触发器,即自动响应DynamoDB Streams中事件的代码段。使用触发器,您可以构建对DynamoDB表中的数据修改做出反应的应用程序。

Amazon DynamoDB is integrated with AWS Lambda so that you can create triggers—pieces of code that automatically respond to events in DynamoDB Streams. With triggers, you can build applications that react to data modifications in DynamoDB tables.

如果在表上启用DynamoDB流,则可以将流ARN与Lambda函数相关联。你写的修改表格中的项目后,表格流中会立即出现一条新记录。 AWS Lambda轮询流并在检测到新的流记录时同步调用Lambda函数。

If you enable DynamoDB Streams on a table, you can associate the stream ARN with a Lambda function that you write. Immediately after an item in the table is modified, a new record appears in the table's stream. AWS Lambda polls the stream and invokes your Lambda function synchronously when it detects new stream records.

这篇关于适用于AWS DynamoDB流的挂钩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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