Using the GAE datastore, what option below would perform the best? (Assume that memcache is not available)
Option 1:
DataModel: Entity User has some key, and an email address (the email can’t be used as the key)
a) Perform a query on User that filters for a match by email
OR Option 2:
DataModel: Entity User has some key, Entity UserLogin has email address as key, and user key
a) Perform a get on UserLogin, then
b) Perform a get on User using the user key from UserLogin
Get operations are substantially faster than queries, not to mention cheaper to execute. The sequence of two get operations is likely to be faster than a single query. For example, on the status dashboard, a get operation hovers at around 10 milliseconds, while a query operation hovers at around 80 milliseconds – but if this matters to you, I would encourage you to benchmark both and verify for yourself.