you wouldn't do it on the game thread, so performance shouldnt be an issue
|
Hey there,
So I'm trying to design a logging system, which would (eventually) save to a database. However, reading and writing (to) the database everytime a player would chat, kill something or whatever would create massive performance issues.
I figured, maybe storing the data in the server, and when a command is executed it would send them to the database, or if the command isn't executed it would automaticly write the logs every 5 minutes.
This is one idea, but I'm not satisfied with it, so I was hoping someone on r-s could help me with figuring out in which way this should be done.
My partner also came up with processing a set number of queries each tick and if there are too many, put them into a queue to process next tick.
Any other ideas?
Thanks in advance,
Ruben
you wouldn't do it on the game thread, so performance shouldnt be an issue
Even though you should handle this on a separate thread to begin with, here's a side-tip: start a scheduled executor service, queue up all the chat messages and then every X amount of time (5-15 seconds seems reasonable), insert them into the database in one call.
Thanks for the feedback guys, has helped me with some ideas! Anyone with another view regarding this issue is more than welcome to post it though!
Why would you want to log such trivial things in the first place?everytime a player would chat, kill something or whatever
if you truly care about every step a player is taking in the game you would go with an event sourcing system
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |