views:

34

answers:

1

I am wondering what the stats are for different ways of storing (and therefore retrieving) content. Are there any charts out there, or do you guys have any quick tests to show, the requests per second, etc., of:

  • Direct (local) database access, vs.
  • HTTP Access to cached data, vs.
  • HTTP Access to uncached data (remote database), vs.
  • Direct File access

I am wondering to judge how necessary it is to locally cache data if I'm using remote services.

Thanks!

+1  A: 

.. what the stats are ...

Although some people may have published their findings, this will not map directly to your experience - you may find the opposite of they discovered.

Sometimes it may be faster to retrieve files from a database than a file - it depends on the size of the file, the filesystem or DBMS it resides on, the other data which affects the access path (e.g. indexes, number of I/O operations to dereference the start of the file...) the underlying hardware, the amount of caching available, the presence of the data or information relating to its location in the cache and the interaction between each of these factors.

And that's before you start considering the additional variables introduced when you start talking about HTTP, which also implies remote network access.

While ultimately any file would need to be read from the filesystem at some point, this suggests that direct file access would be the fastest method (but only on the local machine) however if you consider centralized caching and concurrency this is not necessarily the case.

I am wondering to judge how necessary it is to locally cache data if I'm using remote services.

Rather hard to say. How remote? what are your bandwidth costs? Latency? What level of service do you hope to provide? Does the remote system provide caching information already? How do you deal with cache invalidations?

If we knew everything about your application, the data source, your customers and networks connecting them and your budget for implementing the service then we might hazard a guess. And, yes, caching on the MITM server probably is a good idea but only if you know that you're not breaking anything by using caching.

C.

symcbean