I’m developing a pagerank checker widget. and i want to cache ranks. because on every page send a request to google takes takes a lot of seconds.
the general question:
cache (store, save!) rank of each url (and get it afterward) in a database is faster and optimizer or in files? (1 file for all, or 1 file for each)
sorry for my terrible english
Thanks
It depends.
Have a read through this article by Chris Davis – particularly section 7.10. You should also have a think about the differences between speed and scalability.
While, in theory, the file based approach (using the directory hierarchy for indexing and one URL per file) will be faster, PHP does not have good facilities for managing concurrent file access. OTOH this is a key feature of a DBMS (be it relational or nosql). Another consideration is how you will be interacting with the data – you may not be retrieving it using the same indexing path as you stored it in (you can still implement multiple indexes with files, but its a lot easier in a database).