Bitly is a link management platform that lets you harness the power of your links by shortening, sharing, managing and analyzing links to your content. Billions of links are created every year by their millions of users, from individuals to small businesses to Fortune 500 companies. This project is a cloud scale Bitly-Like Service on Amazon Cloud with the web application deployed on Heroku.
- When a user goes to the URL provided by Heroku for web application, the user could enter the long URL and get the short URL on a button click.
- Trending Data can be viewed i.e. the statistics about the links created by this application.
- Number of hits and the last accessed time for each of the links can be viewed in the "Trending Data" page.
- EC2 Instances
- VPC
- Private/Public Subnets in VPC
- Application Load Balancer
- Network Load Balancer
- Auto Scale Groups
- Launch Configurations
- Target Groups
- Kong API Gateway
-
Control Panel Servers (Private Subnet)
These are dockerhost instances running a docker container with the Control Panel API which include the creating a short link API. These servers are created by auto scale groups which are linked with a launch configuration which has a custom ami of Control Panel and t2.micro instance type. These autoscale groups are then connected to target group (control-panel-target-group) which is linked to the internal application load balancer. The control-panel-target-group is associated by path ("/create*") i.e. any API call with the path starting with create will be redirected to Control Panel Server. -
Link Redirect Servers (Private Subnet)
These are dockerhost instances running a docker container with the Link Redirect API which include the getting the long link API. These servers are created by auto scale groups which are linked with a launch configuration which has a custom ami of Link Redirect Server and t2.micro instance type. These autoscale groups are then connected to target group (link-redirect-target-group) which is linked to the internal application load balancer. The link-redirect-target-group is associated by path ("/get*") i.e. any API call with the path starting with get will be redirected to Control Panel Server. -
NoSQL DB Cluster (Private Subnet)
These are dockerhost instances running a docker container with NoSQL DB service which stores the trending data for each of the links. It consists of 5 nodes linked with each other using docker network "api_network" which is initialized as swarm and overlay. All the nodes are then registered on each of the instances so that each one knows of the instances included in the cluster. With the help of this, if a document is created on Node 1, all the other nodes are notified and respective updates are made. These 5 nodes are connected to an internal network load balancer and only the Network Load Balancer's endpoint is used in communicating with the cluster. -
MySQL Server (Private Subnet)
This is a MySQL VM Instance that stores the short and the corresponding long links in a table. All the operations in this server are done by control-panel servers only. -
RabbitMQ Server (Private Subnet)
This is an EC2 Instance running the RabbitMQ service that acts as messaging queue service which stores all the messages coming from control panel server in a channel, in a queue and that queue is subscribed by the link redirect server and it consumes the messages and performs the appropriate tasks. -
Kong API Gateway (Public Subnet)
This is the public endpoint of the entire application for the web app. This adds an authentication layer to the application along with exposing it to the public. This is connected to the internal load balancer that connects the control panel APIs and Link Redirect APIs.
- POST /create
Request body:
{
"url": "https://app.slack.com/client/T0AMW0A3S/C018XCQGGFL/thread/C018XCQGGFL-1607282036.001400"
}
Response :
{
"long_URL": "https://app.slack.com/client/T0AMW0A3S/C018XCQGGFL/thread/C018XCQGGFL-1607282036.001400",
"message": "201 Created",
"short_URL": "http://cmpe.sjsu/osp8bx"
}
- GET /getUrl Params:
{
"short_url": "http://cmpe.sjsu/osp8bx"
}
Response :
{
"hits": "2",
"last_accessed": "2020-12-10 05:31:56.171214794 +0000 UTC m=+22922.251402975",
"message": "301 Found",
"url": "https://app.slack.com/client/T0AMW0A3S/C018XCQGGFL/thread/C018XCQGGFL-1607282036.001400"
}