Ideas for scaling chat in AWS?

前端 未结 6 2307
温柔的废话
温柔的废话 2020-12-13 10:29

I\'m trying to come up with the best solution for scaling a chat service in AWS. I\'ve come up with a couple potential solutions:

  1. Redis Pub/Sub - When a use

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-13 11:01

    the way i would implement such a thing (if not using some framework) is the following:

    have a webserver (on ec2) which accepts the msgs from the user. use Autoscalling group on this webserver. the webserver can update any DB on amazon RDS which can scale easily.

    if you are using your own db, you might consider to decouple the db from the webserver using the sqs (by sending all requests the same queue), and then u can have a consumer which consume the queue. this consumer can also be placed behind an autoscalling group, so that if the queue is larger than X msgs, it will scale (u can set it up with alarms)

    sqs normally updates pretty fast i.e less than one second. (from the moment u sent it, to the moment it appears on the on the queue), and rarely more than that.

提交回复
热议问题