可以使用dynamodb流具有诸如firebase的实时触发器吗? [英] can you use dynamodb streams to have realtime triggers like firebase?

查看:84
本文介绍了可以使用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连接到运动学流以使其实时推送,而不是通过

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

再以聊天室为例,是否可以通过过滤子句调用dynamodb流api GetRecords,以便仅获取特定哈希的记录或范围?

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流与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 + clouds方法处理数据库触发器。

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

可以使用DynamoDB + DynamoDB流+ 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天全站免登陆