I am caching data in an application I am currently writing and was wondering which would be better to use a regular text file or a sqlite database to hold the cached data? Thanks.
EDIT:
I am using Zend_Cache so relationships are handled without the need of database. What I am caching is xml strings if saved as regular files can be as big as 60kBs.
Depends on the kind of data you’re planning on storing.
If the data is related, and you’d want to retrieve the data based on those relationships…then use SQLite.
If the data is completely unrelated and you’re just looking for a way to store a retreive plain text…then use a plain text file. It won’t have the added overhead of calling in to SQLite.
If you don’t need to persist the data in a file for any reason, and the data lends itself to key/value pair storage…you should look in to something like memcached so you don’t have to deal with file IO.