autosuggest flat file vs mysql?

Discussion in 'PHP' started by jnm, Sep 29, 2007.

  1. #1
    i set up 2 versions for an ajax autosuggest input field - one queries a mysql table and loops on each new character entered (meaning a query each time). The second version i set up a mysql loop to run on cron every so often and rewrite a txt file with the autosuggest entries as each new character is added, the php script fopens the txt file and creates an array to use.

    there will only ever be a total of 20,000 auto suggestions in the db or txt file. so, my question is...which one should i use as the scalable (and fastest) solution?

    the flat file version will have cron set up to rewrite it every 5-10 minutes (so only one query for every5-10 minutes). the mysql version will query every character entered...

    i guess it's based on how many users so i'd assume a lot just to be sure.

    any suggestions?
     
    jnm, Sep 29, 2007 IP