Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 985
sam Avatar asked May 09 '26 05:05

sam


1 Answers

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.

like image 134
Nick Johnson Avatar answered May 12 '26 10:05

Nick Johnson