What services would i need to implement a real time matchmaking system for chat application.

0

Requirements:

  • Real time matchmaking system that matches two users based on their input keyword interest. e.g. User 1 has interests of ['AWS', 'Azure', 'GCP'] while User 2 has interests of ['AWS', 'Azure'], since there is at least 1 common interest this should be sufficient to match the two persons. Basically Omegle.

My Incomplete Solution:

  • Store users looking for a new match in a DynamoDB table. Remove them from the table when they stopped looking for a new match.

Problem:

  • Within 5 seconds, I need to look for a match for a user constantly. Given that the list of users looking for a match is stored in a DynamoDB table, is there a way I could search & filter the table in real-time constantly until 5 seconds is done?

Other Ideas:

  • AWS has GameLift which does the matchmaking but I'm not sure if this would be the best pick given that this is not a game application but rather a chat application.
Renz
asked 3 months ago165 views
1 Answer
0

Hey Renz,

Amazon GameLift's FlexMatch feature lets you fully customize your rules, so it can be as simple as you need. Additionally, they provide an intersection expression that might be what you want: set_intersection (rule expression reference).

Amazon GameLift also provides Standalone FlexMatch which allows you to use their matchmaking solution in isolation and with a different pricing model from standard GameLift making it useful even for non-game applications (check out Pricing > Amazon GameLift FlexMatch for more info).

Hope that helps!

AWS
answered 3 months ago
  • The problem I have with FlexMatch is that it would be super expensive due to Matchmaking Hours. Given that there has to be an intersection of interests between two users, I expect there would be a longer waiting time. I'm thinking of users waiting in the queue for 5 seconds before they're randomly matched to a stranger. If my understanding is correct, this 5 seconds waiting in the queue is billed as 5 seconds in matchmaking hours, if my hypothesis is correct then FlexMatch would be an expensive option.

  • Hey Renz, FlexMatch pricing can be a little confusing because it depends heavily on the traffic patterns you expect from your users. The key is that price is determined by how long matches take to complete not how long a user takes to get into a match. A single unmatchable user could be tried for 10-20 successful matches before they're matched as long as more users continue to join. If you won't have a lot of concurrent users, or the number of possible interests is high enough that users are unlikely to match quickly, it will be expensive. However, if you expect a consistent number of users and the interests are likely to overlap, you'll tend to see most matches complete quickly regardless of a player taking 5 seconds to match.

  • You might be able to get away with using SQS to trigger lambda functions with batches of users. Some articles to look into: https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html, https://aws.amazon.com/blogs/compute/understanding-how-aws-lambda-scales-when-subscribed-to-amazon-sqs-queues/

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions