pramananda sarkar
pramananda sarkar

Reputation: 1

How to Implement a Multiplayer Matchmaking Server Without Persistent Sockets?

I am building a multiplayer matchmaking game server using Express.js where:

Possible Approaches I Considered:

  1. WebSockets: Clients connect to the server, and the server keeps them connected until matchmaking completes. (Not scalable for large numbers of clients.)
  2. Client Polling: Clients repeatedly ask the server if they have been matched. (May cause unnecessary server load.)
  3. Background Matchmaking Process:
    • Clients send a request to join the queue.
    • A background worker runs periodically and matches players.
    • Once a match is found, the server notifies clients (either via polling or webhooks).
    • Clients then connect to a game server instance to start the game.

I want to implement approach #3 where:

My Questions:

  1. What tools or libraries should I use to handle matchmaking efficiently?
  2. How can I notify clients when a match is found without using WebSockets?
  3. Is Redis + BullMQ a good choice for queue management?

Any guidance or better approaches would be appreciated. Thanks!

Upvotes: -4

Views: 29

Answers (0)

Related Questions