I'm busy developing an API that needs standard Authentication/Authorization. My users would be identified by their email (as a unique key on the User node). Which approach would be better?
- Index the user emails and query the user via their email on every call OR
- Query the user once against their email, save the node ID client side, and use the ID for remaining queries.
Note: my question has nothing to do with authentication and authorization. Simply around best practice for repetitive queries. In other words: is a query against a node id faster than a query against an indexed field on a node?
The performance concern comes in that this query would have to run for virtually every api request.