MongoDB Statistics using FastAPI and Chart.JS
Game Stats Dashboard: Tracking Millions of Players
I’m excited to share my current database statistics, this database is exclusively dedicated to tracking League of Legends players and their games.
Tech Stack
This project uses Python, FastAPI, and MongoDB. I implemented sharding to distribute data across multiple servers hosted on Hetzner and other cloud providers. The database currently holds around 4TB of data, fully backed up and safe! We utilize estimated_document_count()
from PyMongo for efficient document counting.
Statistics
As of now, we have 20.6 million players and over 200.5 million games played across all servers. The page updates every 5 minutes, and there’s a force button for instant updates.
For API details, check out the example below:
This usually returns something like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
"summoners": {
"total": 20606398,
"servers": {
"br1": 1868480,
"eun1": 2246593,
"euw1": 7145067,
"jp1": 234495,
"kr": 2514089,
"la1": 915293,
"la2": 725946,
"na1": 3229214,
"oc1": 273394,
"tr1": 791623,
"ru": 238056,
"ph2": 127093,
"sg2": 46284,
"th2": 1405,
"tw2": 123908,
"vn2": 121332,
"me1": 4126
}
},
"matches": {
"total": 200554559,
"servers": {
"br1": 34243486,
"eun1": 9774655,
"euw1": 118963375,
"jp1": 72950,
"kr": 567440,
"la1": 666051,
"la2": 678671,
"na1": 32594622,
"oc1": 615946,
"tr1": 1290539,
"ru": 880649,
"ph2": 76967,
"sg2": 27864,
"th2": 6552,
"tw2": 5836,
"vn2": 72574,
"me1": 16382
}
}
}
If you’re interested in gaming stats or have questions, feel free to reach out!