Memcache quotas are so high that you're unlikely to hit them. You may get *latency* benefits from having your own first-level cache in memory, but bear in mind that you don't have a whole lot of space to work with, and the hit rates will decrease significantly as your traffic increases (unlike memcache).
I would recommend only doing caching in memory only for the scope of a single request (i.e. don't request the same data from memcache more than once per request), and using the bulk memcache APIs wherever possible (e.g. getAll and putAll()). On Wed, Dec 2, 2009 at 8:00 AM, jay <[email protected]> wrote: > Hi Ikai, > > Thanks your reply. Got it. > > Because the GAE memcache has quota limitation, should I use my own > cache(singleton in my WebApp) as first level, and use memcache as > second level, then I save my quota? > > On 11月12日, 上午10时37分, "Ikai L (Google)" <[email protected]> wrote: > > Jay, > > > > It's not necessary to create a Map of caches. The Cache object represents > a > > single Memcache client talking to a distributed, in-memory store. There's > no > > gain for creating separate cache client instances. > > > > > > > > On Tue, Nov 10, 2009 at 8:38 PM, jay <[email protected]> wrote: > > > > > Hi friends, > > > > > I want to use different cache save different sorts of Objects, so I > > > create several caches in a HashMap. > > > > > But when I debug my program, I realize only one cache in the lower > > > layer... > > > > > Is it true? > > > > > private Map<String, Cache> caches = new HashMap<String, > > > Cache>(); > > > > > .... > > > > > cacheFactory = CacheManager.getInstance > > > ().getCacheFactory(); > > > > > caches.put(Account.class.getSimpleName(), > > > cacheFactory.createCache > > > (Collections.emptyMap())); > > > caches.put(AddressBook.class.getSimpleName(), > > > cacheFactory.createCache(Collections.emptyMap())); > > > > -- > > Ikai Lan > > Developer Programs Engineer, Google App Engine > > -- > > 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 > [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-appengine-java%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine-java?hl=en. > > > -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
