SimpleDS does also include a two-level Cache implementation. We are using the same approach of Hibernate: the first-level cache is bound to the current thread and will be discarded after the response is committed, and the second-level cache is relying on Memcache.
The tricky part was dealing with partial cache results when invoking a multiple get(). Feel free to inspect the code to get your own ideas: http://code.google.com/p/simpleds/source/browse/#svn/trunk/src/main/java/org/simpleds/cache On Jun 18, 10:08 am, Toby <toby.ro...@gmail.com> wrote: > Hello Ikai, > > Sorry but I might have worded my post incorrectly. I do not doubt > memcache, in fact I use it very heavily and it is great. > > On Google I/O I learned that memcache is actually hosted on another > machine and that for each request a significant network overhead is > involved. In appstats I see about 20ms for a single request. Simple > data-store requests are also between 20-50ms. So in fact memcache is > good as second level cache but shows to be a bottleneck for data that > I heavily use over and over again (plus it costs valuable API time). > > So the idea was to have some "first level" in-memory cache living on > the same machine that is holding heavily used data to prevent the > server round trip to the cache machine. Now you might tell me that my > application is designed wrong. And indeed I could just put this in by > myself. But as you also pointed out there are tricky parts like memory > boundaries and other things to take care of. This is why I started > this thread to see if someone has come up with a good solution. > > I think multiple cache layers are kind of a standard approach that has > shown its usefulness in many places. It would be good to have that as > part of GAE. Of course this is not the most urgent issue. > > Cheers, > Toby > > On Jun 17, 6:46 pm, "Ikai L (Google)" <ika...@google.com> wrote: > > > What aspect of Memcache is too slow? Have you run AppStats yet? > > > The overhead of Memcache is low enough for many of the top sites on the > > internet to use. Some sites are listed on the main page here: > > >http://memcached.org/ > > > As you move closer and closer to local memory, the volatility of your cache > > will increase, so the only items I would store in local memory are items > > that are okay to lose. If you want, you can probably layer your application > > to fetch from memcache -> fetch from authoritative source and place into > > local memory on a cache miss. Just be aware that there are process memory > > limits, and exceeding these will force a restart. > > > On Thu, Jun 17, 2010 at 2:30 AM, Toby <toby.ro...@gmail.com> wrote: > > > Hello, > > > > I wonder if there is a framework (such as Objectify) also for > > > memcache. As memcache is not on the local machine it is rather slow, > > > especially for reoccurring requests. So on Google I/O they suggested > > > to build your own in-memory layer around that. I know that is an easy > > > task, still I wonder if there might already be a framework for > > > that :-) > > > > Also I wonder if someone can give me some ideas about how to build an > > > in-memory cache. I guess it is just a static hashmap. But will it > > > survive multiple requests? How much can I put in there? > > > > As the problem of memcache is apparently the high latency for the > > > network traffic to the server I had the idea to store the in-memory > > > cache in the memcache, de-serialize it and then use it? > > > > Do you have other ideas how to speed up caching? > > > > Thank you for your advice, > > > > Toby > > > > -- > > > You received this message because you are subscribed to the Google Groups > > > "Google App Engine for Java" group. > > > To post to this group, send email to > > > google-appengine-j...@googlegroups.com. > > > To unsubscribe from this group, send email to > > > google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/google-appengine-java?hl=en. > > > -- > > Ikai Lan > > Developer Programs Engineer, Google App Engine > > Blog:http://googleappengine.blogspot.com > > Twitter:http://twitter.com/app_engine > > Reddit:http://www.reddit.com/r/appengine -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.