I am working on a multiplayer collectible card game. Server side is node.js + websocket.io. I am now considering which database to implement.
I got really intrigued by MongoDB, mostly due to the fact that I can exchange JSON between DB and my application and also because I can describe entire game state in one mongodb document. It is also supposed to read and write faster.
However, I have come across the views that MongoDB is not that great in terms of performance when it comes to updating existing records.
In my game this is a key feature, as game state would change all the time (with every player's turn).
One of the solutions I have been thinking is actually pulling current game state document, conducting all calculations necessary and then simply creating a new document in MongoDB for the same game. Effectively, I do not update an existing record, but create a new state instance which I will pull later. And this repeats onwards.
I wonder how justified such approach is and what is best practical way to implement this? I will somehow need to find the most recent document in collection filtering by gameID and then somehow utilising a document timestamp. Is there any built in functionality in MongoDB which could help me, any hints on what to explore are much appreciated!