Giter VIP home page Giter VIP logo

bitly-clone's Introduction

Cloud Project : Bitly Clone

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.

Screenshot from 2020-12-09 23-04-40

Functionality

  1. 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.
  2. Trending Data can be viewed i.e. the statistics about the links created by this application.
  3. Number of hits and the last accessed time for each of the links can be viewed in the "Trending Data" page.

Screenshot from 2020-12-09 23-17-10

AWS Services Used

  1. EC2 Instances
  2. VPC
  3. Private/Public Subnets in VPC
  4. Application Load Balancer
  5. Network Load Balancer
  6. Auto Scale Groups
  7. Launch Configurations
  8. Target Groups
  9. Kong API Gateway

Deployment

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

Deployment Diagram

Bitly Deployment Diagram

APIs

  1. 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"
}
  1. 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"
} 

bitly-clone's People

Contributors

kapilmulchandani avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.