I watched a video explaining how to create a websocket using API Gateway and Lambda, but I'm looking for alternate methods to host a websocket on AWS. What's a good standard for hosting a websocket service in this environment?
5 Answers
Have you looked into AppSync? It offers an 'Event API' which requires minimal custom code, making it a hassle-free choice for setting up websockets.
Using API Gateway and AWS Lambda is probably the easiest way to get started. It's straightforward and doesn’t involve too much complexity.
If you're looking for low latency, deploying a websocket on EC2 can be great. I set up a t4g.micro instance using Go, and it handles a couple hundred users effortlessly. It might be worth considering based on your user load.
You could also use ECS or EC2 for your websocket setup, but don't forget to include a Network Load Balancer (NLB) for better performance.
We opted for a route through CloudFront to an Application Load Balancer and then to our websocket service. You could check out NLB options too, or pair it with an API for a smoother setup.
Related Questions
Cloudflare Origin SSL Certificate Setup Guide
How To Effectively Monetize A Site With Ads