Loading...
Reliability:
Performance:
Latency:
Scalability:
High availability:
get - /{code}
302 - redirect to URL belonging to that code
404 - if that code cannot be found
put- /api/v1/urls/{code}
body - long url
201 - successfully created redirect
200 - if it already existed
409 - conflict when there is already such a url with that short code
response: code and url
post - /api/v1/urls
body - long url
201 - successfully created redirect
response: code andurl
code (unique index). If we scale 100×, shard by hash(code) across 100 logical partitions, assigning partitions to physical shards so a redirect routes to exactly one shard — no scatter.