0% found this document useful (0 votes)
24 views

URL S S: Hortening Ystem

The document describes the processes involved in a URL shortening system. The system takes long URLs as input, validates them, checks for duplicates, generates short URLs, stores them in a database, and redirects users to the original long URLs. It also allows users to view analytics data and share shortened URLs on social networks. Administrative processes enable searching URLs, viewing stats, and deleting URLs from the database.

Uploaded by

Prince Bhanwra
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

URL S S: Hortening Ystem

The document describes the processes involved in a URL shortening system. The system takes long URLs as input, validates them, checks for duplicates, generates short URLs, stores them in a database, and redirects users to the original long URLs. It also allows users to view analytics data and share shortened URLs on social networks. Administrative processes enable searching URLs, viewing stats, and deleting URLs from the database.

Uploaded by

Prince Bhanwra
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

URL Shortening System

CASE STUDY

URL SHORTENING
SYSTEM

Submitted By:-
Prince Bhanwra
ME – SE (1st Year)
Thapar University, Patiala
801031024
URL Shortening System

Process Description

Process ID: 1.1

Process Name: Validate

Description: It validates the user input & makes it database safe &
database format or displays the appropriate error message. Also after
validation, it calls the appropriate function according to the type of
input.

Inbound Data Flows: LongURL, ShortURL, Alias

Outbound Data Flows: ValidLongURL, ValidShortURL, ValidAlias

Logical Flow:
1. If valid real escape strings, then
a. if valid regular expression, then
i. if ValidlongURL OR ValidAlias, then
Send data to create a shorten URL to process 1.2 (Generate
URL)
ii. else
Send as ValidShortURL data to 1.3 (Redirect) for redirection
b. else
display appropriate error message
2. else
display appropriate error message
URL Shortening System

Process ID: 1.2

Process Name: Generate URL

Description: Its goal is to return the ShortURL or ShortAliasURL(if


alias is provided as input). It could be the new ShortURL or previously
generated ShortURL(if LongURL already exists in Database). It may
display the appropriate error message; if unsuccessful for whatsoever
reason. It also updates the database(s) if new ShortURL is generated.

Inbound Data Flows: ValidLongURL, ValidAlias, TotalURLs,


DuplicateURLInfo

Outbound Data Flows: ShortURL, ShortAliasURL, ErrorMsg,


UpdateTotalURLs, ValidAlias, ValidLongURL

Logical Flow:
1. It check the Valid URL/Alias provided by process 1.1 (Validate) for the
duplicate entry in Database
2. If duplicate URL found, then
a. If Alias is NOT provided, then
return the corresponding short URL
b. else
i. If duplicate Alias found, then
Display error message
ii. else
Generate the new short URL with Alias, update to the
database and return
3. else
a. If Alias is provided
Generate new Short URL with Alias, update to the database and
return
b. else
Generate new Short URL, update to the database and return
URL Shortening System

Process ID: 1.2.1

Process Name: Check Duplicate Records

Description: It checks database if ValidLongURL & ValidAlias


already exists and sends the appropriate information to the next
process (1.2.2 - Generate NewShortURL) or to the user.

Inbound Data Flows: ValidLongURL, ValidAlias, AllShortURLs, AllAlias

Outbound Data Flows: ValidLongURLInfo, ValidAliasInfo,


ErrorMsg

Logical Flow:

1. It check the Valid URL/Alias provided by process 1.1 (Validate)


for the duplicate entry in Database
2. Supply information about duplicate URL/Alias to the next process
1.2.2 (GenerateNewShortURL) for Short URL generation.
URL Shortening System

Process ID: 1.2.2

Process Name: Generate NewShortURL

Description: It generates the new ShortURL; if it does not exist


already exists in the database or returns the pregenerated URL.

Inbound Data Flows: ValidLongURLInfo, TotalURLs

Outbound Data Flows: UpdatedTotalURLs, ShortURL, ShortURL +

UpdatedTotalURLs, ErrorMsg

Logical Flow:
1. If duplicate URL found, then
Send the corresponding short URL data to process 1.2.3 (Generate
URLAlias)
2. else
Generate the new short URL, update to the database and send new Short
URL data to process 1.2.3 (Generate URLAlias)
URL Shortening System

Process ID: 1.2.3

Process Name: Generate URLAlias

Description: If alias is provided it updates the alias to the database


(URL) and returns ShortAliasURL to the URL otherwise it returns the
Short URL to the user.

Inbound Data Flows: ValidAliasInfo, ShortURL + UpdatedTotalURLs

Outbound Data Flows: ShortURL, ShortAliasURL, ErrorMsg,


ValidAlias

Logical Summary:

1. If Alias found, then


a. Generate Alias URL
b. update to the database
c. return new short URL with alias.
2. Else

Return ShortURL

.
URL Shortening System

Process ID: 1.3

Process Name: Redirect

Description: It fetches the ValidLongURL from the database


corresponding to the ValidShortURL provided (if exists) and redirects
the user to the corresponding original/ValidLongURL.

Inbound Data Flows: ValidShortURL, ValidLongURL, URLStats

Outbound Data Flows: NewURLStats, Redirection, ShortURL

Logical Flow:

1. It takes Valid Short URL from process 1.1 (Validate)


2. Checks the Valid Short URL for the entry in database
a. If entry found, then
i. Update the stats
ii. Redirect user to corresponding Original/Long URL
b. else
Display appropriate error message

.
URL Shortening System

Process ID: 1.4

Process Name: ShareURL

Description: If user wants to share the URL; this process


accomplish the task and solicit the acknowledgement to the user.

Inbound Data Flows: ShareURL

Outbound Data Flows: ShareURLAck

Logical Summary:

1. It displays the set of websites to share URL say digg, facebook,


orkut, twitter etc.
2. User selected the interested website to share URL
3. System displays the selected website’s login page.
a. If login is authenticated, then

i. URL is shared on the particular website

ii. Shared URL acknowledgement is displayed on the

screen
b. Else

c. Display appropriate error message


URL Shortening System

Process ID: 1.5

Process Name: AdminOperations

Description: It performs all the admin operations such as


searching URLs, viewing the stats or deleting the URL.

Inbound Data Flows: DeleteURL, SearchURLs

Outbound Data Flows: DeleteAck, SearchResults

Logical Summary:

1. If search keywords are entered, then


Display appropriate search results from the database.
2. If Delete URL command is given by the user, then
a. Selected URL is deleted from the database
b. Delete URL acknowledgment is displayed
3. If Display stats option is selected by the user, then
View Stats of all the URLs

.
URL Shortening System

Process ID: 1.6

Process Name: CalculateStats

Description: It calculates the Stats and displays it to the requested


user.

Inbound Data Flows: ViewStats, URLStats

Outbound Data Flows: DisplayStats

Logical Summary:

1. It match the requested URL or all URL in the database


2. Format the output to display to the user
3. Display the requested stats.
URL Shortening System

Process Description

Data Flow Name: ErrorMsg

Description: It displays the error message to the user; if required.

From: 1.2 Generate URL

To: User, Premium User

Data Structure: ErrorMsg (String)

Data Flow Name: ShortAliasURL

Description: It is a system generated Short URL with Alias.

From Process: 1.2 Generate URL

To Process: User, Premium User

Data Structure: ShortURL (String) + Alias (String)

Data Flow Name: ShortURL

Description: It is a system generated Short URL.

From Process: 1.2 Generate URL

To Process: User, Premium User

Data Structure: ShortURL (String)

.
URL Shortening System

Data Flow Name: LongURL

Description: It is the LongURL provided by the user.

From: User, Premium User

To: 1.1 Validate

Data Structure: LongURL (String)

Data Flow Name: Alias

Description: It is the Alias/Custom name for the URL provided by


the user.

From: User, Premium User

To: 1.1 Validate

Data Structure: Alias (String)

Data Flow Name: ValidLongURL

Description: It is a validated LongURL.

From: 1.1 Validate

To: 1.2 Generate URL

Data Structure: ValidLongURL (String)


URL Shortening System

Data Flow Name: ValidAlias

Description: It is a validated Alias.

From: 1.1 Validate

To: 1.2 Generate URL

Data Structure: ValidAlias (String)

Data Flow Name: ValidShortURL

Description: It is a validated Short URL provided by the user.

From Process: 1.1 Validate

To Process: 1.3 Redirect

Data Structure: ValidShortURL (String)

Data Flow Name: Redirection

Description: It fetch the Long URL corresponding to the user


provided Short URL and redirects the user to the original/Long URL. If
short URL seems to be an invalid URL it displays error message.

From: 1.3 Redirect

To: User, Premium User

Data Structure: LongURL (String) or ErrorMsg (String)


URL Shortening System

Data Flow Name: URLStats

Description: It is the URL’s current stats

From: StatsDB

To: 1.6 Calculate Stats

Data Structure: Stat (Integer)

Data Flow Name: DisplayStats

Description: It displays the stastics of the URL to the premium


user.

From: 1.6 Calculate Stats

To: Premium User, Admin

Data Structure: ShortURL (String) + URLStats (Integer)

Data Flow Name: ViewStats

Description: It requests the system to display stats corresponding


to the provided Short URL.

From: Premium User, Admin

To: 1.6 Calculate Stats

Data Structure: ShortURL (String)


URL Shortening System

Data Flow Name: ShareURL

Description: It is the ShortURL which user wants to share.

From: User, Premium User

To: 1.4 Share URL

Data Structure: ShortURL (String)

Data Flow Name: ShareURLAck

Description: 1.4 Share URL

From: 1.4 Share URL

To: User, Premium User

Data Structure: ShareURLAck (String)

Data Flow Name: TotalURLs

Description: It is the total number of URLs available in the


database.

From: URLSettingsDB

To: 1.2 Generate URL

Data Structure: TotalURLs (Integer)


URL Shortening System

Data Flow Name: UpdatedTotalURLs

Description: It is the new value of total number of URLs available


in the database.

From: 1.2 Generate URL

To: URLSettingsDB

Data Structure: UpdatedTotalURLs (Integer)

Data Flow Name: AllAlias

Description: It is the list of all the Alias available in the database.

From: URLDB

To: 1.2 Generate URL

Data Structure: AllAlias (String)

Data Flow Name: AllShortURLs

Description: It is the list of all the short URLs available in the


database.

From: URLDB

To: 1.2 Generate URL

Data Structure: AllShortURLs (String)

.
URL Shortening System

Data Flow Name: DeleteURL

Description: It contains the URL to be deleted.

From: Admin

To: 1.5 Admin Operations

Data Structure: DeleteURL (String)

Data Flow Name: DeleteAck

Description: Its displays the acknowledgement of the deleted URL

From: 1.5 Admin Operations

To: Admin

Data Structure: DeleteAck (String)

Data Flow Name: SearchURLs

Description: It is search keywords to search URLs from the


database

From: Admin

To: 1.5 Admin Operations

Data Structure: SearchURLs (String)


URL Shortening System

Data Flow Name: SearchResults

Description: These are URLs satisfying search keywords.

From: 1.5 Admin Operations

To: Admin

Data Structure: SearchResults (String)

.
URL Shortening System

Database Description

URLDB
ID (integer)(Auto-increment)

AllShortURLs (string)

AllAlias (String)

AllURLs (String)

URLSettingsDB
TotalURLs (Integer)

StatsDB
ID (Integer)

URL (String)

URLStats (Integer)
URL Shortening System

Decision Table

1. LongURL is provided? Y Y N Y Y N N N N

2. Alias is provided? N Y N N Y N N N N

3. ShortURL is provided? N N Y N N N N N N

4. ShareURL request is given? N N N Y Y N N N N

5. Is Premium User? - - - - - N N N Y

6. URL Stats display request is given? N N N N N Y N N Y

7. Is Administrator? N N N N N Y Y Y N

8. URL delete command is given? N N N N N N Y N N

9. Search keywords are provided? N N N N N N - Y N

1. Generate Short URL X X

2. Generate Short URL with Alias X X

3. Share URL X X

4. Redirect to the original URL X

5. Delete requested URL X

6. Display search results X

7. Display Stats of the requested URL(s) X

8. Display Stats of all URLs X

9. Update URL Stats X

You might also like