S
S
SKEPTIC2020-07-18 14:26:00
Node.js
SKEPTIC, 2020-07-18 14:26:00

How to design a real-time table with game rooms?

For the site, you need to write one real-time service. I will write on node.js and websockets.

The bottom line is that the user enters the page and sees a table with 20 rows in front of him. Each line is, let's say, a room where users play tic-tac-toe (the functionality itself is not particularly important). The number of pages with such a table depends on the number of all rooms. For example, if there are 100 rooms, then there are 5 pages of 20 lines. The user can turn pages.

The problem is that I don't know how and where to store this table. It is necessary that the service can withstand high loads.

The options are:

1) Database - store everything stupidly in the database and pull data from there every time, but there is one problem. The DB most likely will not pull out such loading.

2) In-memory Storage - something like Redis, where you need to store a key-value of the id:json type, where id is the room ID, and json is information about the room.

Actually, I don't even know. Do you have any idea how to organize it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
index0h, 2020-07-18
@index0h

https://github.com/centrifugal/centrifugal

M
Maksim B, 2020-07-18
@Sundagy

mysql with configured indexes, and cache large calculations from the database in radish.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question