Dynamic Websites Made Easy

0
23

Our requirements are very simple. Requirements

o Lets create a contact form.

o Let the user push some data via the form to a database table.

o Give a search box for users to query the already entered data.

o One DB Table to store the contact table.

o The application is published from its own domain.

o High availability application (works 24×7 with exception of small maintenance windows).

o A large number of users can access it.

Now lets see what all steps are involved in development and deployment from ground zero. I am going to use Perl CGI, feel free to use any scripting language you know.First of all, we need to set up a machine with development stack. We need a database, a web server and a programming toolkit of your choice. So you need to download mysql, Apache and Camel Pack perl. If you are on Linux boxes, most of the stack is ready there (I do most of my development on win XP box) But creating the right stack is definitely an activity that takes up some time. Even if you are on a Linux box, you may have to fetch some modules from CPAN depending on your requirements or recompile Apache to enable some modules. you may be using java and not have all the libraries you want. You may have version x when you want version y and so on. Then there is a question of using packages, libraries with right licenses also. Most of the time I do not want to shell out $$ and my only option is to look for something with an Apache style license.

After downloads, comes the configuration part. Who has run Apache or MYSQL just out of box? You do have to do configuration changes. even creating a single database, 2 users, a single table and configuring Apache to handle CGI from your directory is some work. If you are planning to a run a highly available web page then out of box configuration is definitely inadequate.

Okay, now, time to roll your sleeves and start coding. First thing you will notice about web page development is that you really need a diverse set of skills. You need to use a design tool like GIMP or Photoshop, you need to know css and javascript and You need to know a glue scripting language like PHP or perl or ruby. If you are working within the boundaries of some MVC framework then you need to know the Idiosyncracies of that framework too. Suppose you are a very smart designer who knows CSS, HTML and javascript like the back of your hand. You can create both the HTML pages very quickly in a three column layout design.

Still you need to make sure that the elements on your form are aligned. You have put the right javascript for form validations. Even with availability of excellent java script libraries like YUI and Jquery that is still some work. You need to make sure of navigation from search to input and input to search. Lets say it again that you are a very efficient glue script coder too. You can create 2 Perl CGI scripts in a jiffy. One using DBI to store data in system table and the other to read back the data using search tokens. You are a smart developer, so you get everything right in first go. Things like, checking for invalid inputs, making sure of case conversion when doing search, taking care of xss issues so people can not paste javascript URL on your form etc. But still, typing everything in an editor still takes time, is not it?

Finally, out two forms are ready to be deployed. we input some data, check up the database and see that our table is populated. Now remember that the application is out there in the wild and anyone can do anything to it. So we need to test the forms a bit with all kind of edge cases. numbers-only name, string only dates etc. All goes fine with an occasional bug here and there and we are now ready to upload. Everything is in tip top shape on development machine now. If you deploy your web pages on your own machine then the world can not access it. For this page to be accessible to anyone in the world, You need to deploy it on a public static IP. A sort of machine whose address does not change and a machine that is plugged in a high bandwidth network. If you try to run a web server on your own PC and DSL connection then chances are it can not run, it can only crawl.

Second issue is, your ISP keeps assigning you different IP every time you connect. So you need space on some static IP machine connected to a high bandwidth network. So off you purchase a hosting space and upload your code to this machine. Now your pages are accessible from an IP address.

To host your web pages from your own domain you need to perform some extra steps. You need to point your domain (your website name to the IP address that you purchased in last step). This act of pointing your domain to a particular IP is making changes to your DNS records. After modifying the DNS records you have to wait for the DNS propagation. That also takes some time. Is everything over? of course, not YET. Let 10,000 people put their data in your tables and then your searches would literally crawl! what happened here? Forgot to analyze your tables, is not it? How do you take off your site while the maintenance is going on, do you know that?

Anyone can access your application. what if some guy uses some web pager from NET-BSD machines? what happens to all the groovy ajax validation stuff? Now you see, we need to put in browser match rules in web server config as well. How about your database backups? where are you going to store them? How about high availability? what if your machine fails, will the site visitors still get your page? How can you avoid such scenarios? How about rotating web server logs, analyzing log data for analytic's, writing firewall rules, shutting down un-used ports, repelling D-DOS attacks … whew!

Visit Http://www.indigloo.com for more information related Friends website.

Source

Leave a Reply