Skip to content

This repo contains the code for URL Shortner Service. This repo also contains utility functions for DynamoDB in Python

Notifications You must be signed in to change notification settings

Rashu99/NewsBytesUrlShortner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NewsBytes Backend Assignment | UrlShortner

# Problem Statement

Write a URL Shortener Service which provides below functionalities
1. Get Short Url from Long Url
2. Get Long Url from Short Url

This Project also contains the utility functions for DynamoDB CRUD operation in Python

Note:- This Project only handles the url having BASE URL = https://www.newsbytesapp.com/

# Tech / Framework Used

  • Python (Django)
  • DynamoDB

# APIs Details

1. Get Shorl Url

{{host}}/api/v1/urlShortner/tiny-url?long_url=https://www.newsbytesapp.com/......

2. Get Original Url

{{host}}/api/v1/urlShortner/long-url?short_url=https://www.newsbytesapp.com/......

# Approach used in the Project

  • I have used md5 hash to generate unique identifoer for each url, chances of collision of md5 hash is approximately: 1.47*10-29
  • Used DynamoDB to store tiny_url and long_url
  • DynamoDB ---- primary_key -- tiny_url
  • Used NoSQL DB for scalability and as no SQL operations are required

# Example :-

Long URL ---

http://127.0.0.1:8000/api/v1/urlShortner/tiny-url?long_url=https://www.newsbytesapp.com/communication/advisoryCards/103566021?referrer=utm_source%3Dadvisory%26utm_medium%3Demail%26utm_campaign%3DVGQMStockRecommendation&utm_source=advisory&utm_medium=email&utm_campaign=VGQMStockRecommendation&dynamo_id=2021-01-06%3A19%3A09%3A25%231063%23%23%23258385

Short URL ---

https://www.newsbytesapp.com/7add93bc704563c3e246393c9b22351e

About

This repo contains the code for URL Shortner Service. This repo also contains utility functions for DynamoDB in Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages