A simple, scalable and most economical URL Shortener for Web
The Url Shortener is modeled after the existing free tools with extended funtionality to allow the endpoint url to be changed even afterwards. This is really helpful in situations like:
- There is new content that you want your users to see with the same URL
- Recalling an email is not that easy but recalling a short link sent in URL is made possible using this.
Stack:
- The application is written in Java with Spring boot
- It uses AWS S3 for storage
Scalability & Performance:
- Scalablity and Performance is directly derrived from AWS S3
- The S3 bucket could be fronted by Cloudfront for better performance
Cost: Couple of $$ at the most for regular use cases. The redirect requests hit the S3 bucket directly. This application can be easily converted to lambda function to make it serverless.
Pre-requisite:
- Install gradle (if you do not have it already)
- Install Java SDK (minimum Java 8)(if you do not have it already)
- Aws Account, create one if you do not have it already
SetUp:
-
Create a bucket in S3 where you want the links to be stored.
-
Create another bucket with the similar name but "-dummy" at the end
-
Create AWS access credentials which have permission to read and write those buckets
-
Open the application.properties file and add the above information AWS_ACCESS_KEY= AWS_SECRET_KEY= AWS_REGION= AWS_S3_BUCKET=
-
Run the Application.java if you are using IDE or execute gradle bootrun in the project folder from command line
-
The application should be up and accessible at http://localhost:8090/swagger-ui.html