Logic flow for using caching with SimpleDB
Here is the flow of logic when we use memcached with SimpleDB:
- When you need to retrieve data from SimpleDB, first query memcached server to see if the data is currently available in the cache.
- If the data is in the cache, then simply return the data, and do not make a request to SimpleDB.
- If the data is not in the cache, retrieve it from SimpleDB, and store it in the cache before returning the results back, so it is available next time you need it in the cache.
- If you are updating the data, all you have to do is update SimpleDB and also delete the data from the cache. This will ensure that the next request from the data will get the latest information from SimpleDB and not outdated information from the ...