GET /redirect/{Randomstring}
POST /createmapping
PUT /updatemapping
DELETE /mapping/{id}
GET /mappingDetails/id
From the browser we call a service redirect/randomstring
we basically return a permanent redirect response
we first check if the mapping exists if yes we check if its present in cache else fetch from db and return
and all of this can be behind a load balancer
From the browser we call a service redirect/randomstring
we basically return a permanent redirect response
when we get the Given url to shorten we basically can check if this was shortened previously using a bloom filter
if not we can go ahed with creation of new mapping
in case it exits we return the existing one either from cache or DB
we can have a cache key with TTL of 10 min and LRU policy
and we can use redis for this
as this would be a high throughput service we can use Scylla or Cassandra
and all of this can be behind a load balancer