0

I'm trying to use AppSync for chatting application. I'm able to reproduce the AWS tutorial (https://aws.amazon.com/blogs/mobile/building-a-serverless-real-time-chat-application-with-aws-appsync/)

However, I'm still not sure if AppSync can handle a production environment for chatting application. Will it be expensive because of the DynamoDB part?

Moreover, if I'm subscribing each conversation, will there be a performance issues for the users in the front-end if I have like 1000 conversations / user?

kkesley
  • 3,258
  • 1
  • 28
  • 55

1 Answers1

2

Using AppSync and DynamoDB no doubt will suit a production environment handling 1000 conversations and is able to scale much further. However, the cost can get higher both for AppSync and DynamoDB at scale.

While saying that, its a tradeoff when considering the total cost of ownership since the development and management effort is significantly less since these are fully managed services.

It is also subjective considering, against what technology you are comparing with. So what I would suggest is to do a rough capacity planning and come up with an estimation to compare against few other technologies (Even within AWS, e.g; You can also consider AWS IOT Websockets, AWS Message MQ to build real-time chat applications).

Ashan
  • 18,898
  • 4
  • 47
  • 67
  • by 1000 conversations, do you mean each user has 1000 conversations or the entire applications have 1000 conversations? Because I meant 1000 conversations for each user. Now they have to subscribe to those 1000 conversations in the front-end right? Will it affect the performance in the front-end? – kkesley Oct 04 '18 at 05:21
  • Yes from the frontend there will be an issue if you have 1000 connections. Still, you can design the application in a way that 1000 conversations happen through single or few channels (WebSockets). – Ashan Oct 04 '18 at 05:24
  • Ah I see.. That's what I'm thinking to just subscribe users to itself and do the pushing via a server (maybe lambda?) But then the lambda needs to read list of users for each message sent. Is this design viable? – kkesley Oct 04 '18 at 05:29
  • 1
    If this is group messaging, yes you will need to broadcast the message to each user channel (Where you will need to look up who are the participants of the group and send). If these are individual messages, you can include the recipient ID within the message so that the Lambda can directly publish to the relevant channel (Still you will need to validate whether the sender can send the message to the particular recipient). – Ashan Oct 04 '18 at 08:04
  • @Ashan If you setup subscriptions then Appsync uses either pure WebSockets or MQTT over WebSockets as the network protocol between the client and service. The protocol depends on the version of the client you’re using. – user3376065 Dec 17 '19 at 17:50