Multiple sites accessing a single databse OR unique databse for each site?

Discussion in 'MySQL' started by nicedeals, Jun 23, 2006.

  1. #1
    Is it better to have say 4-5 websites accessing the same mySQL databse or would it be wiser to have a unique mysql databse for each of the 4-5 websites. Would there be more pressure on the server if there were more databses? OR would the single database have more problems if multiple sites were accessing it?
    Need some advice please
     
    nicedeals, Jun 23, 2006 IP
  2. Slapyo

    Slapyo Well-Known Member

    Messages:
    266
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #2
    It would depend on the traffic of all the sites together. One DB should be fine though if the sites are not all huge and each are causing lots of hits to the DB.
     
    Slapyo, Jun 23, 2006 IP
    nicedeals likes this.
  3. iconv

    iconv Well-Known Member

    Messages:
    189
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #3
    Assuming that the database content for each of the sites is the same, I'd say go for the one database as long as the access paterns are similar. This way the MySQL server can optimize its caching and optimization for this particular data set, and you avoid having to keep multiple instances in sync.
     
    iconv, Jun 26, 2006 IP
  4. sadcox66

    sadcox66 Spirit Walker

    Messages:
    496
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The "load" is handled by the MySql server/service/threads

    It does not care how you split up your databases - it just assigns a thread to do the query. You can query the server (or use phpMyAdmin) and you will be able to tell the load/threads on your server and various other statistics.

    To reduce load on the server - optimize your database often and better optimize your query.


    Give me some green points if this helps you.
     
    sadcox66, Jun 27, 2006 IP
  5. DanInManchester

    DanInManchester Active Member

    Messages:
    116
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #5
    The issue here is more around security. If these are distinctly different websites then ideally you should have a database for each. With users and roles defined for each website on the database.

    however if you have 4 websites that are related to the same backend data then you can (probably need to) share the database.
     
    DanInManchester, Jul 5, 2006 IP