Need suggestion about connection flow between client, server and database for online game

Hi, I’m developing an online game for iOS. It’s not an MMORPG. It’s just that player data and progress has to be saved to server database. I don’t have experience developing an online game. So, I want to ask what’s the appropriate way to design communication between client, server and database. These are my current ideas. I’m not sure if they are suitable or not or which is better. I use uLink in this project.

  1. When client login to the server, server will create new gameobject to handle that player data. Server will read data for that player from database and copy it to that gameobject. This way, the server will have to handle important data (some data is saved on the client side) for each online player and write those data to database periodically.
  2. Server doesn’t create gameobject to handle each player data. When client has sent request about data changing, server will read/write those data from/to database directly. In this case, server is acting like a relay message between client and database. Server will , of course, have method to check the validity of data before writing it to database and response accordingly but I will not mention it.

I really need a suggestion from experienced developer about this. Thank you very much.

Caveat:I’m not a unity or ulink expert.

For this problem, as a first cut, I’d follow the KISS principle and just pass the object data through to be saved as an atomic chunk.

Multi-player is going to be more complex. Everything I’ve seen says that you should be doing message passing of input events to do it right. It’s possible that a small team on Unity may be able to take some shortcuts, but I don’t know what those might be.