How twitter check its database for username availability.. while signup

Discussion in 'PHP' started by balaji153, Jan 3, 2010.

  1. #1
    CAn any help me ,

    I think at least 5 million people are using twitter ,so 5million record in database .

    How fast twitter checking user availability within typing password.....

    can any one teach with script

    thanks in advance
     
    balaji153, Jan 3, 2010 IP
  2. kingsoflegend

    kingsoflegend Well-Known Member

    Messages:
    202
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    108
    #2
    A fast server with an optimized database can be fast, even with so many records.

    Consider this: if twitter has instead of 1 table with 5 million records, 26 tables with 200k records each (one table for each letter of the alphabet) and a user is added to the table corresponding to the first letter of the name. This is pretty simple to do and it makes searching 26 times faster.

    That's just an example of how you can cut query times. I'm sure they use much more complex algorithms.
     
    kingsoflegend, Jan 3, 2010 IP
  3. balaji153

    balaji153 Peon

    Messages:
    96
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    that was great thank you kingsoflegend

    but can anyone explain that with php and mysql

    that may help me and other new learners

    thanks in advance
     
    balaji153, Jan 3, 2010 IP
  4. Kalyse

    Kalyse Peon

    Messages:
    1,221
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Its not just PHP and MySQL.
    You also need Ajax.

    If you don't understand the technologies required, then I don't think you will find it very easy.
     
    Kalyse, Jan 3, 2010 IP
  5. balaji153

    balaji153 Peon

    Messages:
    96
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    balaji153, Jan 3, 2010 IP