multiple databases

Discussion in 'Databases' started by decepti0n, May 25, 2007.

  1. #1
    Is there any problems with having another database purely to keep site logs? Basically every user action will be recorded (for a game), and only inserted into db2, the only time it'll be retrieved is when I go through it (not that often, and i'll probably dump it into a txt file and parse it now and then)

    Anyway, would it be better to have one table in my main database (keeping only one db), however it could end up with millions of rows quite quickly. I can have multiple tables (say 5, all prefixed with logs_) in my main db, but that just makes it harder to make a logger (from how i see it)

    db2 would have a new record inserted almost every page load by every user, does opening that connection hurt anything? databasing isn't really my strong point

    thanks for any help!
     
    decepti0n, May 25, 2007 IP
  2. Kalyse

    Kalyse Peon

    Messages:
    1,221
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yes, dont open a new database connection again. Why not just add a new table and use that? I dont know why you are keeping all logs anyway? Pruning every so often would be good also.
     
    Kalyse, May 26, 2007 IP
  3. decepti0n

    decepti0n Peon

    Messages:
    519
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I need logs since it's a game, and I dont want anyone cheating

    The table(s)/database of logs would be backed up every day or so anyway, and at the end of the week probably backed up again and cleared.

    All i was asking was whether it would be more efficient to have a seperate database for it, or just use the one i have with extra tables
     
    decepti0n, May 28, 2007 IP