I am building an MMO and someone told me I should never have my application interfacing directly with the net, and that I should have a local proxy. This makes sense, with security issues and scaling simplicity (add more servers behind proxy). But I'm not sure of the best way to implement this.
My gameserver is written in java, and I'd like to write my proxy in Python.
These are the methods I can think of to communicate between proxy and server:
A) Game Client <-> UDP Protocol
<-> Python Proxy <-> MySql Database
<-> Java Server
I like this because it would force me to constantly save and store game server information (player and npc position, rotation, and health, item's and backpacks...). I would need to do this anyway, but maybe not every time I get a packet. Only issue I can see is performance with making all the database queries on both proxy and server.
B) Client <-> UDP Protocol
<-> Python Proxy <-> TCP Protocol
<-> Java Server
I don't want to use UDP locally because UDP has packet loss and it's not worth doing locally
*
. TCP would work and be easy to implement but may have performance issues since TCP has a lot of overhead.
*
not entirely sure if true.
I plan to go with option A)
but would like to know what you guys think, and if there are any other viable options to look into. So what do you think A, B or something else?
Thanks in advance.