Skip to content

adcaes/Wrpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

=============
URL-shortener
=============
A scalable URL shortening web application using Twisted.

=============
Architecture
=============

The Application consists of three main elements, the Load Balancer, the Application Server and the Data Base Managment System.

The Load Balancer, that receives all the incoming requests and forwards them to the correct Application server.

The Application server, that handles three kinds of requests:
	- Empty request: Returns the base form with a field to introduce a URL to be shortended.
	- Shorten a URL: Revecies a long URL an returns a short one. The mapping between the long and the short URL is stored both in memory and in the DB.
	- Redirect to the original URL given the short one: Recevies a short url and finds the associated long URL. First searches for the URL in memory, and if not found, it is fetched from the DB and cached in memory.
	
The used Data Base Managment System is MemcacheDb, a NoSql Key-Value storage.

Each Application Server has an assigned prefix, that is added to all the short URLs generated by the server. 
Using this prefix, the Load Balancer routes each redirect request to the Application Server that generated the short url. In this way, each Application Server is responsible of handling an independent subset of short URLs.
This allows to have completly independent memory and Data Bases for each Application server, improving performance and scalability.

==========
Deployment
==========

The Application can be deployed to an arbitrary number of machines, the only element that has to be unique is the Load Balancer.
There can be an arbitrary number of running instances of Application Servers and Data Bases.


=============
Prerequisites
=============

Download Twisted, Memcachedb and Memcache client library for Python
In Ubuntu/Debian packages: python-twisted, memcachedb and python-memcache.

========
Settings
========

All the settings are stored in the file config.py. 

=======
Running
=======

runner.sh is a very primitive running script configured to create two App Servers, a Load Balancer and two DB instances, one for each App Server. 
All the elements will be created in the machine where the script is executed.

About

URL Shortener

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published