Loading...
I estimate about 200 URL creations per second and about 20,000 URL accesses per second.
Since read capacity is quite high, we're going to want to go with a NoSQL database, something like DynamoDB or MongoDB. The key-value pair model will work well for our data since the key would be the shortened URL and the value would be the long form URL that we are redirecting to.
We will also want to store the creation time and last access time. This is so that we can expire dormant URLs and keep table cost lower.
flowchart TD
B["User"];
C{"API Gateway"};
E["DynamoDB"];
n0["Shortening Service"];
n1["Redirecting Service"];
B --> C;
C --> B;
C --> n0;
C --> n1;
n0 --> E;
E --> n1;
n1 --> C;
n0 --> C;