sam
sam

Reputation: 1241

Google AppEngine authentication

I'm developing a Google AppEngine application and trying to figure out what is the best way to check whether an user is authenticated. I use standard authentication mechanism provided by AppEngine, but in the context of my app the user is authenticated only if he/she is already registered within the app. So I need to check if there is a record in the datastore for the user for every request. But I'm a bit concerned about performance.

Is there a better way to deal with this problem? I know it could be improved keeping user records in memcache. But I wonder if there is a better approach?

Upvotes: 3

Views: 295

Answers (1)

Nick Johnson
Nick Johnson

Reputation: 101139

There's no magic bullet solution like you seem to be wanting. You'll need to do a datastore get on every request (a get, not a query, if you store your user data record with the key name equal to the user's user_id). You can use memcache, as you suggest, to reduce the cost of this by storing the user's record there in addition to the datastore.

Upvotes: 2

Related Questions