Thread: Logging system, saving to a database?

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 Logging system, saving to a database? 
    Registered Member
    Join Date
    Oct 2015
    Posts
    136
    Thanks given
    3
    Thanks received
    7
    Rep Power
    11
    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
    Reply With Quote  
     

  2. #2  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    you wouldn't do it on the game thread, so performance shouldnt be an issue
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member
    Join Date
    Apr 2016
    Posts
    124
    Thanks given
    14
    Thanks received
    21
    Rep Power
    37
    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.
    Reply With Quote  
     

  5. #4  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    Quote Originally Posted by NeedDump View Post
    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.
    What if you have 1000 people chatting lol.
    Reply With Quote  
     

  6. #5  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    Quote Originally Posted by _Patrick_ View Post
    What if you have 1000 people chatting lol.
    a decent configured database and making use of batched queries would work fine, dont need to batch them can just put them one by one into db
    Reply With Quote  
     

  7. #6  
    Registered Member
    Join Date
    Oct 2015
    Posts
    136
    Thanks given
    3
    Thanks received
    7
    Rep Power
    11
    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!
    Reply With Quote  
     

  8. #7  
    Registered Member

    Join Date
    Sep 2008
    Posts
    4,833
    Thanks given
    894
    Thanks received
    1,439
    Rep Power
    2924
    everytime a player would chat, kill something or whatever
    Why would you want to log such trivial things in the first place?
    "Know thy self, know thy enemy. A thousand battles, a thousand victories." - Sun Tzu
    GitHub: https://github.com/Faris-Mckay
    Reply With Quote  
     

  9. #8  
    Registered Member

    Join Date
    Dec 2015
    Posts
    166
    Thanks given
    77
    Thanks received
    87
    Rep Power
    404
    if you truly care about every step a player is taking in the game you would go with an event sourcing system
    "It's all a matter of perspective. There is no single path in life that is right and fair and does no harm."
    Reply With Quote  
     

  10. #9  
    Registered Member
    Join Date
    Oct 2015
    Posts
    136
    Thanks given
    3
    Thanks received
    7
    Rep Power
    11
    Quote Originally Posted by Faris View Post
    Why would you want to log such trivial things in the first place?
    What is it you would log?
    Reply With Quote  
     

  11. #10  
    Registered Member
    Join Date
    Apr 2016
    Posts
    124
    Thanks given
    14
    Thanks received
    21
    Rep Power
    37
    Quote Originally Posted by _Patrick_ View Post
    What if you have 1000 people chatting lol.
    What about it?
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Connecting to the Database.
    By Evan in forum Application Development
    Replies: 9
    Last Post: 11-19-2008, 05:13 PM
  2. ModelLoaderV2 (now saves to cache and is faster)
    By Clienthax in forum Tutorials
    Replies: 94
    Last Post: 07-04-2008, 06:40 AM
  3. Replies: 44
    Last Post: 04-13-2008, 09:46 PM
  4. How to adds a scoring system applied to all players
    By Bulby Strife in forum Tutorials
    Replies: 12
    Last Post: 02-03-2008, 11:33 AM
  5. How to add a good logging system [CHAT,CMDS,YELL]
    By Shawn101 in forum Tutorials
    Replies: 8
    Last Post: 08-16-2007, 02:10 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •