I'm developing a server of chat app with random matching.
Basically, the algorithm starts when a user requests a match, finds another user for requestor, sends a push to found user, and opens a chat room when it is accepted.
Until now, since it was completely random system, server just picked one user from the entire user pool, but now I want to add filtering to it. Users can be matched among the users of the desired condition. In other word, Users can specify people who can be matched to them by setting filters, such as "Users of the same age" or "in the same region". Of course there can be multiple filters at once.
User attributes such as age and region are stored in the Database. I tried to check attributes of all users by for loop through every user whenever each user started to match, but I'm worried about server performance.
I think there are a lot of similar systems, but I can't find good information with my Googling skills. What are the effective algorithms for this situation? I would really appreciate it if you only suggest good keywords for me. Thank you.
Aucun commentaire:
Enregistrer un commentaire