RPC vs WWW : Performance

I’m working on a multiplayer game, and I have the following question:

The multiplayer part of the game is running on an Azure VM, in a standalone unity application. In that same machine, the server communicates to a MySQL DB using the mysql connector for C#.

Now, from my clients, I need to access the db for different things: consumables sync, highscores, data, etc… In the past, what I did was have a php script hosted, and just make WWW calls to that script to interact with the DB, but now that I have the server, I’m tempted to just make an RPC call to the server and make it do whatever it is I need to do, and save me the coding in PHP.

Is this advisable? does it have any drawbacks performance wise?


Unlike WWW calls, you won’t get a response from RPCs. So for the RPC response you need the server to send another RPC back.

You will have to take care that the DB interaction is independent from your game loop and not affecting your performance. It might be easier in a separate service but a Thread Pool might do the job as well.

Most likely, the RPC will be less overhead to send.