Loading...
We would want a couple different API endpoints for this system
Now we can also think about security for each short code, collision handling so that each short code is unique, expiration of each short code, rate limiting for the service and analytics.
Core Entities:
Relationships;
Index:
Scalability:
DB Schema:
CREATE TABLE url_mapping (
id SERIAL PRIMARY KEY,
short_code VARCHAR(10) UNIQUE NOT NULL,
long_code TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
expiration_date TIMESTAMP
)
Explain any trade offs you have made and why you made certain tech choices...
Try to discuss as many failure scenarios/bottlenecks as possible.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?