Reputation: 4746
I am working on a web service servlet running on Google App Engine using Spring 3.1, and since I'm pretty new to this game, I simply don't know how I should be caching things. It seems like there are a number of places I can put things to be maintained during the lifetime of my servlet:
setAttribute()
.The specific case I'm curious about is for creating user accounts. I want to keep a HashSet of all user IDs so that I can check if the requested user ID is already in use.
Beyond the specific case above, including cases for using each of the different technologies would be appreciated.
Upvotes: 0
Views: 554
Reputation: 8209
In your specific case I recommend you to use a persistent storage, like the datastore or cloud sql (you can see all alternatives here).
Memcache is not an option, since you can't control how many elements are stored. And any application context is not a solution either, since the instances are in practice being loaded and reloaded many times in different datacenters.
Note also that AppEngine provides support for using Google Accounts or OpenId via the Users Service.
Upvotes: 2