D
D
dfhkjhg2021-02-25 21:15:24
PostgreSQL
dfhkjhg, 2021-02-25 21:15:24

Is 5 requests for one action bad?

Is it normal that when I send a request (for example, go to the lobby).
1) I check if this player is in the lobby
2) I check if the game has started
3) I check if there are places in the team
4) I add a user.
5) I check whether it is possible to start the game (whether the required number of players has accumulated.
And it turns out 5 requests. Is this normal or is it better to avoid such moments?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dr. Bacon, 2021-02-25
@dfhkjhg

Fine. The overall execution time is important, one request can be longer than dozens of others combined.

R
rPman, 2021-02-26
@rPman

If we are talking about a 'highly loaded' service, then it is still better to collect the request into one, especially with the help of, for example, union, you can do this without adding overhead
Each request is a bunch of gestures and expectations that immediately come out when there are hundreds and thousands of requests within one nodes, why lay it out from the very beginning when optimization costs nothing. Yes, I know about premature optimization, but...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question