URL shortening service like bit.ly or goo.gl are hugely popular. They simplify link sharing, analytics and much more. We’ll create one feature of these apps. Create a short url from the long url and returns the original url of a short url.
Designing the “right” system is hard. “Right” keeps on changing. Requirements change. Traffic pattern changes. The only thing that is constant is change.
The “right” for this service is:
- System should be able to store “enough” urls
- System should handle 10K request per second
- 90 percent of all request should respond in less than 10ms for the read request
- Save money when not receiving enough load
In the next few blog posts, We will create a system which:
- Given a long url, returns a short code for it.
- Given a short url, returns the long url if it exists or not found.
- Deploy this on AWS on a single EC2 instance.
- Auto scale the app based on the traffic.
- Load test the application.
Tech stack details:
- Node.js using Hapi server
- Postgres as database
- Sequelize as ORM
- Redis for caching
- JMeter for load testing
- AWS for hosting
The complete code can be found on Github.
This series is comprised of following parts:
- Part 1: Overview
- Part 2: Design the write API
- Part 3: Read API, Load testing and Performance improvement
- Part 4: Deploy to AWS
- Part 5: Performance testing on AWS
If you found this story interesting or useful, please support it by clapping it👏 .