Skip to content

guluevruslan/match-maker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple match making service

Application API

By default, application is running on 8080 port

Method URL Payload Description
POST /users {
"name": "name",
"skill": 1.11,
"latency": 23.3
}
Adds specified user to match pool
POST /users/generate/{count} Adds {count} random generated users to match pool

Solution

Schema

User registration

  1. SkillBucket is calculated by user's skill. In current app SkillBucket defines range of skills. For example, from 0 to 2
  2. Latency type is calculated by user's latency.
  3. User is added to the queue (with registration time priority) that is related to bucket and latency

Match making

Schema1

For each SkillBucket and latency type in it:

  • Defining user queue size. In case when it is more than groupSize, possible groups are created from taking elements from current queue, otherwise
  • Going to next SkillBucket and taking into account the queue with the same latency type. In this case sum of queue sizes are calculated and in case it is greater than groupSize all users in queue for current bucket are taken and rest are taken from queue of next bucket, otherwise
  • Going also to prev bucket queue for the same latency and check for possibility to create group

Solution will work in cases where users amount is much more than groupSize and level difference between users

Groups are created by scheduled worker MatchScheduledWorker

To change groupSize it is necessary to update in application.yml

application:
  match:
    groupSize: 8

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages