URL Shortener? Use S3!
URL Shortener? Use S3! Create a URL Shortener Service is the first question most people attempt, when studying system design! and the answer usually involves load balancers, servers, NoSQL databases and more, but I created a URL shortener service without creating a single server, load balancer or database, just an S3 bucket and some clever tricks! Before starting with the design, lets first of all define what we are trying to create, clarify the functional and non-functional requirements! Functional Requirements: Allow users to generate custom short links(Aliases) for longer URLs. When users access a short link, redirect to the original link. Links should expire automatically after a period of non-use! Non-functional Requirements: The system should be highly available. This is required because, if our service is down, all the URL redirections will start failing. URL redirection should happen in real-time with minimal latency.