Requirements
Functional Requirements:
- Create a short URL for a given long URL.
- Return the long URL associated with a given short URL.
Non-Functional Requirements:
- List the key non-functional requirements (eg low latency, scalability, reliability, etc.)...
API Design
POST create_short_url/{url}
GET get_long_url/{url}
High-Level Design
Load Balancer to route API requests between multiple backend service containers.
Scaleable backend service to handle generation of the short URL from the long URL and then sends the request to the database for storage and sends the short URL back to the client.
Handle fetching the long url back from the short url in the backend.
Load Balancer infront of database to handle distributed load of the database.
Detailed Component Design
Load Balancer
Handle the request from client and ensure requests are distributed evenly to healthy nodes on the backend service
Backend Service
Database
Storage combination of short URL and long URL in the backend index the table on the long url to enable faster lookups of the long URL. Have multiple database nodes