One of the first questions to ask is how many times per second does this question need to be answered. Given that most services will not observe anything close to 1 new user registration per second, using a database and relying on indexing is the simpler and easier to maintain solution. Using a cache is an over complication that makes the service harder to understand, maintain, operate, etc. one immediate issue: cache invalidation - the cache will never be fully sync’d with the source of truth.
Another aspect is if the service is expected to experience spikes in traffic and what the requirements to deal it are. For example, it may be acceptable to drop some requests and return an error when the INSERT is attempted; or it may be that we want the service to always return an answer, in which case the cache-based solution makes more sense. However, requests per second still have a big part in dictating the suitability of the chosen solution.