WEB XML vs MySql speed...

Discussion in 'OT Technology' started by Drowned, Jan 21, 2009.

  1. Drowned

    Drowned NameThatPornstar.com

    Joined:
    Mar 26, 2001
    Messages:
    8,534
    Likes Received:
    2
    I'm working on a site and need to keep a few variables in memory The problem is that the variables will be changing often, so often that I will have to check them every time the page loads. I guess I would have keep those variables in a table so the table gets updated when they change and everybody can get the new variables a soon as they change.

    I'm not sure if there's a way to update php sessions when the variable has changed? I don't think something like that exists... so I'm going to use a mysql table to store them but I was thinking perhaps I can store them on an XML file and open up the XML file every time the page loads instead of adding an extra mysql query to every page load? The site gets million of page views every month so an extra query means millions of new queries for the server to handle :wtc:

    Which one would be faster or more efficient? :x:
     
  2. Karnejj

    Karnejj “A true conservative is one who can't see any diff OT Supporter

    Joined:
    Jan 9, 2008
    Messages:
    35,585
    Likes Received:
    0
    Location:
    UPGRADED USA Shutdown Today:8 derps
    Local database > local XML


    If you've got a networked database then whether
    "local XML > networked database"
    depends on your setup.
     
  3. Karnejj

    Karnejj “A true conservative is one who can't see any diff OT Supporter

    Joined:
    Jan 9, 2008
    Messages:
    35,585
    Likes Received:
    0
    Location:
    UPGRADED USA Shutdown Today:8 derps
    If you describe the variables more, we might be able to suggest other ways to handle it.
     
  4. whup

    whup I wish you had children and.. so that I could step

    Joined:
    Feb 12, 2007
    Messages:
    1,603
    Likes Received:
    0
    You can actually write your own session handler, but usually that's done to serialize the session to the database (which allows you to scale your session across multiple application hosts)

    Just go with the database. I don't know why you would think XML is faster or better.

    If you really start running into performance problems, you can start looking at optimizing queries, doing RAM caching and of course just throwing more hardware at things.
     
  5. 2ofdem

    2ofdem OT Supporter

    Joined:
    Jun 17, 2003
    Messages:
    114,854
    Likes Received:
    8
    Location:
    aus.vic.mel
    Database for sure, this is what they are designed to do.
     

Share This Page