Estimate the scale of the system. Consider daily active users, read/write ratio, storage requirements, bandwidth, and any relevant QPS calculations...
Need a get API that can access the client URL and path to the website
Need an API that can convert the client URL into a shortened URL while maintaining website path
Need an API that can send that shortened URL into the database as a key value pairing with original path
You need a server to hold the information that is retrieved from the client, this is the URLs
The server will then do the conversion from the long URL to the shortened URLs
The Database should hold the converted URLs and the corresponding actual path/link to the original website
Define the data model. Identify the main entities, their attributes, and relationships. Consider the choice of database type (SQL vs NoSQL) and justify your decision based on access patterns...
The server should be an ArrayList. It can expand without needing to be reinitialized and can hold the original URLs. The original URLs can be indexed into and sent to the database after conversion.
The get API should get the client URL path and store it in to the ArrayList in the Server.
The database should store key value pairings of the long URL associated with its short URL.