Matching Algorithm for two random users who are searching for a match - Mongo, Redis, NodeJs

Viewed 175

Application : Random Video Calling Application

Architecture : NodeJs, MongoDb, Android

Current Flow : 1. We are making a TTL Database Collection for those user who are currently searching for a match.

  1. Searching the TTL collection for other users and getting an filtered array

  2. using Math.Random() for the match finding & connecting both usrs

Problem : Even when we have users on array, Matching is not happening sometimes (10%),. seems buggy.

Requirement : 1. What will be better for performance for matching- algorithm changes

  1. Do we need to change to in-memory Database like Redis ??

  2. Any other suggestions ?

0 Answers
Related