2 Java Programs Interacting Same Computer
Okay so I'll ATTEMPT to explain this thoroughly because I desperately need help!
I have an online game running on Java on a server with many players on it, and I want to have HighScores for the game using MySQL. When I run a query to connect to the MySQL, it temporarily 'lags' (delays) the server for roughly 5 seconds while it connects. It connects about once every minute or two. This is a BIG deal for my game. It can't do that.
So, what I thought of doing, is having a slave Java program to do all the MySQL work, so it will only delay the slave and not the master server. They will both be running on the same computer, though.
Does anyone have any idea how I'd go about doing this?
I don't even need to return the variable to the master server, just have the master server send a command to the slave to do the MySQL. This is because I want to have the player's stats on the online game uploaded to the MySQL data table so it can be displayed on the website.
Any help is appreciated, thanks in advance.
Edit: Am I thinking too hard? For MySQL can I just use http post..? I just read about and it seems I can just be like, example pseudo: connect(website.com/sql.php?hs1=1&hs2=1) or something along those lines then have it add it to the database and that will not cause any lag?