Scaling websocket notifications
I'm building an e-commerce app and each and every day, we have a special offer at noon. Every customer is notified at noon and connects to the website where they are added to a queue. They open a websocket between the browser and the backend (API Gateway) and at some point they want to send a notification to all users through the websocket (via a lambda looping over all connectionId), which takes too long (around 50k users).
I had a look at different solutions (MQTT over websocket with AWS IOT, Appsync), but both need Cognito, and I already have another authentication mechanism (in-house).
I saw it is also possible to use signature v4 for MQTT over websocket, we could have an endpoint to get this temporary signature but I'm not sure that's a really good practice.
I also thought about spreading (fan out) the sending of notifications.
Am I missing a better alternative?
Broadcasting over WebSockets is built into AppSync. Some articles on the subject:
https://aws.amazon.com/blogs/mobile/aws-appsync-real-time-reference-architecture/ https://aws.amazon.com/blogs/mobile/appsync-realtime/ https://aws.amazon.com/blogs/mobile/appsync-websockets-python/
There's no looping over a list of connections. It's true brodcasting.
Relevant questions
Workspaces Image deployment - How do we preserve the user data on D drive
Accepted Answerasked 3 years agoWebsocket broadcasting messages issue
Accepted Answerasked 3 years agoEmail notifications with re:Post
Validating AMI using hash algorithm?
Accepted Answerasked 5 years agoLooking for a best-practice for building serverless application with amplify and api gateway and lambda
Accepted AnswerScaling websocket notifications
Accepted Answerasked 2 years agoPlease add support for .app and .ai TLDs
asked 3 days agoParse application logs via Athena and Glue catalog
asked 5 months agoBeanstalk randomly looses EC2 instances, scaling group, and is quite unstable
asked 4 months agoNew SES account level suppression list - lacking major simples features that make it useful
asked 4 months ago