你可以使用 dynamodb 流来拥有像 firebase 这样的实时触发器吗? [英] can you use dynamodb streams to have realtime triggers like firebase?

查看:15
本文介绍了你可以使用 dynamodb 流来拥有像 firebase 这样的实时触发器吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过新的 dynamodb 流功能,你能用它来做聊天室之类的实时推送场景吗?还是只能轮询流 api 以获取定期更新?

Looking through the new dynamodb streams feature, can you use it to do real-time push scenarios like a chat room? Or can you only poll the streams api to get periodic updates?

似乎仅有的示例显示 dynamodb 连接到 kinesis 流以使其实时推送而不是通过轮询.

It seems like the only examples show dynamodb connected to a kinesis stream to make it real time push rather than through polling.

进一步以聊天室为例,您能否使用过滤子句调用 dynamodb 流 APIGetRecords",以便仅获取特定哈希或范围的记录?

Taking the chat room example even further, can you call the dynamodb streams api "GetRecords" with a filter clause so that you only get the records for a specific hash or range?

什么是ShardIterator"?通读文档,不清楚它的具体用途.

What is a "ShardIterator?" Reading through the documentation, it's unclear what it's specifically used for.

推荐答案

DynamoDB Streams 与 Kinesis 非常非常相似,但在技术上有所不同.它们使用相似的 API,它们的客户端库也相关,但它们不同.

DynamoDB Streams are very, very similar to Kinesis but technically different things. They use similar APIs and their client libraries are related as well, but they are different.

听起来您正在等待在客户端上运行的客户端(例如:浏览器)接收记录实时更改的通知.这不是 DynamoDB Streams 提供的.

It sounds like you are waiting a client (ex: browser) running on a client to receive a notification that a record changed in real time. This is not what DynamoDB Streams provides.

DynamoDB Streams 更像是用于数据库触发器的 NoSQL+云方法.

DynamoDB Streams are more like the NoSQL+clouds approach to database triggers.

可以使用 DynamoDB + DynamoDB Streams + Lambda + 某种类型的 Web 套接字服务器构建类似于 Firebase 的东西.使用这种方法,您可以将写入 DynamoDB 数据库通知 Lambda 函数,该函数将通知 Web 套接字服务器客户端已实时连接.这意味着 DynamoDB Streams + Lambda 并没有为这个用例做繁重的工作,因为您需要在 EC2 上运行自己的 Web 套接字服务器.

It would be possible to build something similar to Firebase using DynamoDB + DynamoDB Streams + Lambda + some type of web socket server. Using this approach you could have writes to your DynamoDB database notify a Lambda function that would notify a web socket server that clients are connected to in real time. This means DynamoDB Streams + Lambda really isn't doing the heavy lifting for this use case as you would need to run your own web sockets server on EC2.

这篇关于你可以使用 dynamodb 流来拥有像 firebase 这样的实时触发器吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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