Hey everyone! I'm in need of some advice on how to incorporate a chat feature into my app, which is primarily focused on trading goods and has a relational design. I'm currently setting up a PostgreSQL database for it. While I've managed to create a local solution with a containerized Express server handling CRUD operations and socket connections, the chat data is sent to DynamoDB, while metadata goes to PostgreSQL.
Now I'm looking to replicate this setup in AWS, but I'm a bit lost. I've heard that AppSync/GraphQL could be a good path, but I've had some rough experiences with GraphQL in the past, so I'm wanting to avoid that for now.
I'm considering two main options:
1. Setting up two API gateways—one for the primary CRUD operations and another as a WebSocket gateway, which I could modify to update PostgreSQL metadata according to this guide: [AWS WebSocket API Chat App](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-chat-app.html#websocket-api-chat-app-create-dependencies).
2. Using a single API gateway that forwards to a load balancer and then to ECS, which mirrors my local setup (1:1 API). However, I'm concerned about issues with session stickiness, connection pooling, and the potential bloat of having everything in one service despite its initial simplicity. I'd really appreciate any suggestions or insights from those who've tackled something similar!
2 Answers
You might want to check out IVS Chat! It's designed for real-time messaging and could fit your needs well. Here’s a link for the getting started guide: [AWS IVS Chat](https://docs.aws.amazon.com/ivs/latest/ChatUserGuide/getting-started-chat.html). It’s worth a look!
Setting up a dedicated websocket API for chat could streamline things. It would help you separate the chat functionality from other operations and simplify your architecture.

How did I not know about this already?! Checking it out now. Thanks dude!