I'm going to encode a university project in php, which is an online turn-based game, in one part of this project there is the opportunity to play live games.
My idea is to save the last state of the board in the database, and then users will update the board every X seconds using AJAX and play the turn (if it's their turn), then the data will be sent to the server using AJAX and if it is valid, the state boards will be updated in the database, and this circle will continue until the end of the game.
My lead project professor insists that since this is a live game, the data should not be stored in the database, and it should be somehow in the server’s memory, for example, something like programming SOCKET ...
Here are my questions:
What is the right way to do what I'm going to do?
Is my lead professor's idea reasonable?
Is there a logical way not to use the method of storing a database or file on a php website with my script? (If the answer is yes, please direct me to the right library or feature set)
source
share