Skip to content

cylarez/presence-service-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo

Storage

Stored in Redis using HSET

Server updates use the "server:" prefix on each field.

Client updates use the "client:" prefix on each field.

Which allows us to fetch all the players presence in one single Redis call (HMGET)

APIs

ServerUpdate will update the players in one HSET command

HSET presence server:playerId1 {data} server:playerId2 {data}

ClientUpdate will update the players in one HSET command

HSET presence client:playerId1 {data} client:playerId2 {data}

ListPlayers will fetch data with one HMGET using 2 fields per playerId:

HMGET presence client:playerId1 client:playerId2 server:playerId1 server:playerId2

Then we merge the results from client/server into one object per player.

Alternative

Simpler implementation is possible using two different HSET but ListPlayers needs to make 2 calls to Redis.

Code can be found in the branch: with-2-hset

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages