The basic architectural design of GameStrut is that there are servers and they have rooms. These rooms try to contain a segment of the overall gameplay.
For example in a gacha style game, one room might be for the home screen so it handles inventory and character management, another might be the shop that handles transactions and another might handle the battles. So as the player is moving through the game, behind the scenes on the server, different rooms are being created for them to transfer to to continue playing. When the player starts a battle, a battle room is created with the required parameters and the client seamlessly transitions to it.
Currently these rooms are all on the same server, but once we can make rooms on other servers, we can do lots more cool stuff. Like load balancing, or gracefully moving all the players off a server so we can apply updates or turn it off entirely. And at some point we will want players who are on different servers to be able to play together, so we need a way to send users to a room on a different server.
The first step to all of this is being able to do room creation via the database. Previously we'd just new a new room of the type we want, and move the user direct to it.
Now to start creating a room, we insert a row in the Room table, with a bundle of data needed to create the room, and we return the roomId. Now when creating the room, we can fetch the data fro the database with that roomId and construct the correct kind of room on the server.
Separating these two steps means that in the future they can happen on different servers without too much trouble. But that's a future step!
Previous: Database migrations for tests