Design a URL Shortening Service (TinyURL)
URL shortening service allows users to enter a long URL, and then it returns a shorter, unique URL. These services generate a short URL if the user gives a long URL and if the user gives a short URL then it returns the original long URL.
Things to discuss and analyze
- Given a long URL, the service should generate a shorter and unique alias for it.
- When the user hits a short link, the service should redirect to the original link.
- Consider scalability if 1000’s URL shortening requests come every second.
- Service handle redirects.
- Support for custom short URLs.
- Track click stats.
- Delete expired URLs.
- The system should be highly available.
You need to consider three things while designing this service.
- API(REST API) – Discuss how the client will follow an approach to communicate with the service along with the load balancer which is the front end of the service.
- Application Layer – Discuss how the worker thread or hosts that will take the long URL, generate the tiny URL and how it will store both of the URLs in the database.
- Persistence Layer – Database
Guide to System Design for Freshers
Starting your journey into the system design domain can be exciting and difficult, especially for freshers. In this article, we’ll provide a simplified model of system design aimed specifically at freshers/new grads. Whether you’re a new grad or transitioning into a tech career, understanding system design fundamentals is crucial for building scalable, efficient, and reliable software solutions.
So, let’s start with the guide for system design in a way that’s easy to learn and apply.
Important Topics of System Design for Freshers
- What is System Design?
- How to Design a System?
- System Design Life Cycle
- SOLID Principles
- What is Monolith Architecture?
- What is Microservices Architecture?
- Content Delivery Network (CDN)
- Object-Oriented Programming(OOP) for System Design
- Object-Oriented Analysis and Design(OOAD)
- What is High-Level Design(HLD)?
- What is Availability?
- What is Scalability?
- What is Reliability?
- CAP Theorem
- What is Latency?
- What is a Load Balancer?
- SQL vs NoSQL: Which Database to Choose in System Design?
- What is Caching?
- What is Low-Level Design(LLD)?
- Unified Modeling Language(UML)
- Structural UML Diagrams
- Behavioral UML Diagrams
- Design Patterns
- Design a URL Shortening Service (TinyURL)