Question about schema design for more frequently changing data
I could not find a definiteive answer in the docs. I would like to ask a schema design question. I am building a multipllier game which has 'games' table with all game information. However, in each game there is a counter that counts down and the game finishes when it reaches to zero. Currenty clients subscribe to the game and get all updates. Among all fields of the game, time is the one that changes frequently (every second). Is it better to separate it to another table with a relation and subscribe to it separately from the client in terms of performance and bandwidth considerations? Does the reactive query updates only send the "differences" compare to the last state or they send all data with each change?
2 Replies
I would not change time in a document. Instead I'd store the end_time and then show the clock ticking down purely on the client side. The clock could be slightly off, but that should be ok. Would that work?
Yes, it would work. Thank you for the suggestion. I need to update the game logic a little bit but definitely it will be more performant. Thank you. I am still curous though about my last question.