highly available
low latency in generating the link
2million per daily request 2 * 10 **6 / 24 * 60 * 60 = 2 * 10** 6 / 24 * 36 * 10 ** 2 = 10 ** 4 / 12 * ~ 4 = 100 / 4.8 = ~ 20 request per second
I am a bit confused here, because if we will have a load balancer and a micro services server which will get requests and then respond back it should be at least 20 micro services which can generate link in one second or less.... no idea if that fine, I don' see if we can queue or anything
one api endpoint:
20 microservices will need to somehow go to db and generate a unique link, but that's will be hard right. because if it's a random string for link some day it can match. so we need a really some counter in db of different string. something like aaaaaaaaa in db which will update to z. like aaaaa baaaa caaaa(some also here). also we will need then to create an api endpoint for this link on our dns, I guess it should be different dns and different nib from the above service, which will go domain.com/string id db generated and this string should query db for this string and get the longer link to redirect user if hit this edpoint. Db should be huge with readers and writers.... and I think it should be SQL db to store hashes right? or nosql possible?
[Client[ui]] -> server[generate endpoint] -> db to insert longer link and associate it with the smaller hash -> generate endpoint with string smaller hash -> return back endpoint
client -> access new link short -> db -> get longer link-> redirect person
n/a
n/a
n/a
between server and db right??
n.a