I'm looking for alternatives to setting up a WebSocket using API Gateway and a Lambda function, as I've already seen a video on that method. What are some other effective ways to host a WebSocket on AWS? Also, what are the recommended standards or best practices for doing this?
5 Answers
Honestly, if you're okay sticking with the AWS ecosystem, using API Gateway and Lambda is a straightforward way to get started; it’s pretty much the go-to option.
If you're looking for low latency, I'd recommend setting up a WebSocket on EC2. I’ve got a t4g.micro instance running Go, and it handles a couple of hundred users smoothly. It’s pretty efficient!
You might want to consider using ECS or EC2 along with a Network Load Balancer (NLB). It can manage your WebSocket connections effectively!
Don't overlook AppSync's "Event API". It does a lot with very little custom code, which can save you time if you want to get up and running quickly!
We've had success routing through CloudFront to an Application Load Balancer (ALB) and connecting it with our WebSocket application. You could also use an NLB directly, or even combine it with Gateway API depending on your setup.
Totally agree! Building your own server with uWebSockets can really up your performance game.