For the same reason you use a database for any application, to persist data for future use.
What if I want to know how many games are being played, what % of those are being completed, etc.? What if I wanted to implement an "Undo" capability in a more complicated game? What if I wanted to allow players to save their game and come back later? I would need to store all that info somewhere.
I would need to pair socket.io with a database. If the DB offers streaming with it's own client, why would I add socket.io?
Why would you need a database for a rock paper scissors game? The server can process the data in real time.
For the same reason you use a database for any application, to persist data for future use.
What if I want to know how many games are being played, what % of those are being completed, etc.? What if I wanted to implement an "Undo" capability in a more complicated game? What if I wanted to allow players to save their game and come back later? I would need to store all that info somewhere.
Very true but in your article it didn't mention that's why I was asking.
To go well with socket.io you can easily use sequelize or keyv.
Socket.io also has native support for rooms and broadcasts if you are thinking of expansion. it also supports high data flows.