Web applications are part of web technology. There are many ways to develop a scalable web application. Google app engine is a product of google which enables us to build powerful web applications. I created a web application to shortening the urls using Google app engine. We can easily create and maintain our application in app engine and there is no need of any other server. With app engine we can build web application using languages such as java ,python ,Go. I selected python for my application because it provide many libraries , tools and frameworks. When we use python a fast Python 2.5 interpreter needed. A Python web app interacts with the App Engine web server using the CGI protocol. Google app engine is reliable because our application run in a secure environment.
First download and install software development kit from http://code.google.com/appengine/downloads.html. Then create a folder that contain our application . I called mine application as ‘ urlshorten-neethu’. To develop application our folder contain following files
- app.yaml – basic settings for application
- index.html – contain our application’s home page
- index.yaml – generate automatically
- main.py – main python program contain main functions for application
please visit my bitbucket account to see the codes contain above files , its url is https://bitbucket.org/neethuedappal/url-shortener
app.yaml contain name of our application , version,runtime and api_version .’Handlers’ are way of handling urls, script is our main python program. After creating app.yaml we can start like this.
dev_appserver.py ~/full/path/to/urlshorten-neethu
The web server listens on port 8080 by default. You can visit the application at this URL: http://localhost:8080/. And when we make changes to our app, the server will automatically load them, so we don’t need to worry about restarting it for changes.
The main program main.py contain all url shortening functions and datastore models . Our application is to short the long urls into tiny url, so we can use datastore property of google app engine. App engine datastore provide scalable storage of web application also provide replication of data. Datastore saves data objects known as entities and entities have one or more properties. For our application we create a object and its two properties are original url which we enter and short url which we make. When we enter a url ,then first check whether it already present in datastore, If already presents then fetch its short url from datastore. Otherwise create object and its propertis as entering url and short url and save object.
To redirecting our short url we create another class and check short url present in database using query and if present fetch and redirect its original url. After creating our application uploading it in google app engine.To upload our finished applicaton,run the following command
‘appcfg.py update urlshorten-neethu’
Now i can provide my url shortening service to every one. please visit my application here http://urlshorten-neethu.appspot.com/ and short your urls…..




