Nope, this is cheap. Do it as many times as you need. You're not
instantiating a Memcache instance. You're instantiating a client instance.

On Wed, Feb 24, 2010 at 3:24 PM, Mouseclicker <[email protected]>wrote:

> The memcache is a really important feature to increase performance.
> However I am not sure how to design my application in regards of how
> to use memcache in the best way to cache various kinds of objects.
> Often you have the need to cache different types of objects in an
> application. It would be most convenient to create one memcache
> instance for each kind. However I am not sure what happens in the
> background if I create multiple instances using
> CacheManager.getInstance().getCacheFactory().createCache().
> Is this an expensive operation?
>
> To clarify here an example: Lets assume I have a web shop. Probably I
> would like to put the shopping carts in the cache but also maybe the
> most frequently bought articles. The most easy way would be to have
> one memcache instance for the shopping carts and a separate one for
> the articles. So I don't have to deal with potential conflicts for the
> keys and the cast of object types I get back. But would it we
> advisable to use only one cache instance in this case to save
> resources? I can imagine that for larger application you end up with a
> whole bunch of cache instances.
>
> Thanks for any hint. I believe that the answer is useful for many
> other developers.
>
> --
> 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.
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
http://googleappengine.blogspot.com | http://twitter.com/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].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to