select mysql database of 10 million rows with PHP

Discussion in 'PHP' started by Cinta April, Jun 30, 2008.

  1. #1
    HI I have a social network and is wondering what happens when the members increase to large size of like 10 million. Currently the members are still few but is it okay to use the normal select query on a database with 10 million rows? Does it take long? If it takes even a second, i will have to use other options.
     
    Cinta April, Jun 30, 2008 IP
  2. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #2
    i guess you will need to use other options

    for examples devide the table into multiple tables

    Or indexes

    Or seperate DB on a dedicated server fast processor huge ram

    Regards
     
    kmap, Jun 30, 2008 IP
  3. AliasXNeo

    AliasXNeo Banned

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    By the time your site does actually get that big you'll notice a huge difference in many other things and will have probably already gone to at least a dedicated server. Generally this is when multiple servers are introduced and thus multiples databases are used to reduce the processing required for searching. It's a rather complicated task to be honest.
     
    AliasXNeo, Jun 30, 2008 IP
  4. Social.Network

    Social.Network Member

    Messages:
    517
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    35
    #4
    Performance and scalability issues come in many forms, i.e. hardware, network, software, database, etc. Since you specifically inquired about the database, here are a couple items to consider: reduce or eliminate expensive joins by denormalizing the tables. Also, consider using a caching strategy for non-volatile data. This is a complex topic, so I suggest posting the question in database performance and architecture forums.
     
    Social.Network, Jul 1, 2008 IP
  5. mrphp

    mrphp Well-Known Member

    Messages:
    682
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    110
    #5
    My suggestions is use dedicated server and be sure that your queries are index based.

    At the moment, I'm managing a database that has more than 70GB now and I'm pretty sure
    that has more than 10 million of records and what I just did before was transferred our
    shared hosting server to a dedicated server and optimized all the sql queries and after that
    it works pretty good. But as we grow, we will definitely have a big problem and the only
    solution for us to do is delete the old records that aren't touch for a year. This way, we
    could save a lot of money to buy multiple servers and reduce database headache.
     
    mrphp, Jul 1, 2008 IP
  6. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #6
    It'll take over 1 second, however, instead of worrying about future database overload, get customers first.

    Chances are that you will not continue your website.

    Peace,
     
    Barti1987, Jul 1, 2008 IP
  7. mrphp

    mrphp Well-Known Member

    Messages:
    682
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    110
    #7
    agreed. you should start from the beginning. worrying future problems will make you nothing.
     
    mrphp, Jul 1, 2008 IP
  8. gezzle

    gezzle Peon

    Messages:
    108
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    cinta, don't forget this fantastic thing we call memcache ;-)
     
    gezzle, Jul 1, 2008 IP
  9. RyanDoubleyou

    RyanDoubleyou Peon

    Messages:
    86
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Need some more users to try it out? Post the link Ill take a look
     
    RyanDoubleyou, Jul 1, 2008 IP