cloudnative / lambda-chat

A chat application without servers - using only AWS Lambda, S3, DynamoDB and SNS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why is polling used?

bbottema opened this issue · comments

Isn't it possible to subscribe to push notification without the need of polling S3 for updates?

S3 notifications can go to SNS, which can be consumed by something server-side. This is updating entirely on the client-side.

To update the client side properly would require a websocket for each client, something Lambda doesn't support as it has a max 5 minute operating window.

@pas256 I was intrigued by this idea too.

BTW I've just come across your project, glad I did because I was just about to code it myself!

I had a nearly-identitical architecture in mind, differing only by storing messages in SQS. Which may not be a good idea if your chat supports >2 chatters (mine doesn't).

I've seen references to SQS supporting long-polling JS clients, such as here: https://github.com/lg/lambda-job

Just a thought!

Nice. I didn't know about that project. Thanks.