Friday, March 21, 2008

Persistence Layer to SimpleDB

How would this layer cache?

Should it cache by query? The answer is no.
The grand idea is that we only store documents (thanks couchDB). Anything else it extraneous. So all we need is to cache by document ID (key).

So when asked for a document, given a key.
1. Check cache if the key is in the cache, if yes return the the document.
2. No? Get it from SimpleDB
3. Cache it and return the document.

When asked to run a query given a simpleDB query:
1. pass it to simpleDB.
2. return the data.
No caching!

How about invalidation?
Hmm.. this is a tough one.

1 comment:

Travis said...

There's a persistence layer project for SimpleDB at http://code.google.com/p/simplejpa/