Hello.
I'm developing an online card game (Heartstone like) concept.
But I have some doubts about the server structure that I'll use, I'm gonna describe the initial structure to you guys.
1- Login/Data Server (public)
2- Matchmaking Server (private)
3- Game Server ("public")
The client will connect to the Login Server using the user/password, after the success authentication a TCP/IP connection will be opened between the client/server, where the client will receive the user profile, used decks, cards, etc, where the client will be able to change the cards in the decks, the "hero" used, etc, all those requests will be handled by this Login/Data server.
After click in the "Find Battle" the Login/Data server will receive those requests and internally communicate with the Matchmaking server, that will add the client in a game search Queue.
The Matchmakign server will have this game Queue, with its own logic to find 2 clients with the "same" game power and will notify the Login server about the matchmaking result, after that the MM server will notify the Game SErver to create a new Game session related to those 2 clients. The Login server will notify the 2 clients, sending them the game server IP to connect, the game session ID, session password, etc.
The clients will send a request to the Game Server with the session ID and password so they can "authenticate" in the game server, creating a new TCP/IP connection with the game server, that will receive/send the game requests like drop X card, attack X card, skip turn, etc, when the game ends, the connection will be closed, and re-openning a connection with the Login/Data server again. (Not sure if I should close the first connection and reconnect like this, or just keep the Login/Data server connection opened while playing a game).
I kinda like this structure that I tought, this way I will be able to scale the server in case of too many users, since the connection IP's will be given based in the "Load Balancer", and internally controlled by the Matchmaking server about the Game Servers loads, that will have N active game sessions.
Keep in mind that all the servers will be writen by me, I will not use any third part servers like Photon, UNET, etc.
I would like to hear your opnions about this structure, what I could improve and/or take care.
Thank you