logo

目录

Design Leaderboard(2)

Games table

Column
Description
game_id
ID to identify the game
name
name of the game
created_at
creation timestamp

Sample data of Games table

game_id
name
created_at
1
apex legends
2019-25-03
2
minecraft
2011-16-02

Players table

Column
Description
player_id
ID to identify the player
name
name of the player
email
email of the player
created_at
timestamp of player account creation
last_login
timestamp of last login by player
profile_image
object store URL where images are stored
location
region of the player
game_id (Foreign key)
game played by the player

Sample data of Players table

player_id
name
email
created_at
last_login
profile_image
location
game_id
41
morty
2019-04-01
2019-04-01
s3://url-image
canada
1
42
rick
2019-04-01
2019-04-01
s3://url-image
canada
1

Leaderboards table

Column
Description
leaderboard_id
ID to identify the leaderboard
score
score of the player
created_at
timestamp of latest score update
game_id (Foreign key)
ID of the game
player_id (Foreign key)
ID of the player

Sample data of Leaderboards table

leaderboard_id
score
created_at
game_id
player_id
01
125
2019-04-01
1
42
01
97
2019-04-01
1
41

Friends table

Column
Description
player_id (Foreign key)
ID of the player
player_id (Foreign key)
ID of the player
created_at
timestamp

Sample data of Friends table

player_id
player_id
created_at
41
42
2019-04-01
42
41
2019-04-01

Leaderboards Sorted Set (Redis)

SQL

Structured Query Language (SQL) is a domain-specific language used for managing data stored in a relational database management system.
本章目录
    1v1免费职业咨询