Username Lookup Service

  • Global Load Balancer decides Region
  • Local Load balancer routes to the application server
  • Application server has in-memory data structure for bloom filter
  • If bloom filter says username exists (Maybe-Yes)
    • Check the Redis Cache
    • If Cache hit
      • save to bloom filter
      • Respond with Yes
    • else
      • Go to Distributed DB like Cassandra or Amazon DynamoDB
      • Return DB Response
  • else (Firm-No)
    • Respond with a firm No

Strategies compared

StrategyMemoryTimeBenefits
Redis HashMapHighO(1)Exact Match
TrieModerateO(m),
m = longest word length
Prefix matching
B/B+ TreeModerateO(logm)Range based queries
Bloom FilterLowO(k),
k = bit array size
Exact Match