Hi,
is there a noticeable speed performance difference when you cache the data which you retrieve from the database to a file on the filesystem (eg.: htdocs/cache/cachefile) rather than grabbing it directy from the MySQL DB?
Thanks a lot!
Hi,
is there a noticeable speed performance difference when you cache the data which you retrieve from the database to a file on the filesystem (eg.: htdocs/cache/cachefile) rather than grabbing it directy from the MySQL DB?
Thanks a lot!
Yes. What you are describing is a common method of speeding up web applications.
This highly depends on your disk IO, the size of your database, the database configuration, the link to your database, the optimization of the database, etc, etc. So there is no definitive answer to that.
You might want to consider memcached for your caching problem you have. Since you provided no information about the actual issue i'm in doubt you'll get good answers to resolve your problem. Or do you just want to know if disk-io is faster than mysql? ;-)
The noticeable speedup question does also depend on the types of queries and frequency. If it is a once-a-day query, probably not so much. If it is the same query over and over again then probably more so.
If you want to use the database just for caching mysql memory tables might be a good alternative. This should give you the benefits of an sql database without having to use the harddisk. If you don't need a sql-database in general memcached is a great solution.