Loading...
Read heavy database and no strong joins required.
Select document DB such as dynamoDB or D1. This allows for ease of scaling.
URLs
{
short: string - primary,
url: string,
created_at: int64,
expires_at: int64,
user_id: int
}
User
{
user_id: int,
...
}
We might want to encode the short url to contain partitioning logic so that we can distribute read loads using the short url directly without additional hashing. This would improve read throughput.
To handle hotspots - i.e. links with exceptionally heavy traffic. We could do a round-robin distribution to balance loads across read replicas.