Creating a Web Application Contents
Total Page:16
File Type:pdf, Size:1020Kb
Creating a Web Application Jesse Young Chief Technology Officer, Envaya [email protected] For the COSTECH Teknohama Incubator in Dar es Salaam August 2011 Contents Overview ............................................................................................................................................. 2 About the Author ................................................................................................................................ 2 Pre‐Existing Software Packages and Services ..................................................................................... 2 Hosting ................................................................................................................................................ 3 Domain Name Registration ................................................................................................................. 7 Programming Languages and Frameworks ......................................................................................... 8 Server Operating Systems ................................................................................................................. 12 HTTP Server Software ....................................................................................................................... 13 Data Storage...................................................................................................................................... 15 Development Tools ........................................................................................................................... 15 Source Control .................................................................................................................................. 15 Testing ............................................................................................................................................... 15 Deployment Tools ............................................................................................................................. 15 Data Backup ...................................................................................................................................... 15 Security ............................................................................................................................................. 15 Service Monitoring ............................................................................................................................ 15 Performance ..................................................................................................................................... 15 Scaling ............................................................................................................................................... 15 Email on your Domain ....................................................................................................................... 15 SMS and Email Integration ................................................................................................................ 15 1 Overview This paper is intended for anyone seeking to create a web‐based software application. It introduces the basic considerations involved in creating a web application, discusses various choices that you will have to make, and lists the major benefits and drawbacks of different options. By summarizing the most important common knowledge and best practices of web application development in one place, it is intended to help you make informed decisions when creating a web application under constraints such as time, money, and available technical capacity. Although parts of this paper assume knowledge of certain technology concepts and terminology, it is intended to be accessible to non‐technical readers as well. Note that this paper is not a detailed “how‐to” guide; instead, this paper introduces the broad concepts and terminology, so that you can easily conduct further research online and learn from the numerous other resources that are already available. In particular, this paper does not provide training on how to actually program a web application. Most programming frameworks used in web development already have many tutorials and resources readily available on the web. About the Author Jesse has over 12 years of experience in developing large real‐world web applications, using a variety of programming languages including Perl, C#, Python, and PHP. Jesse has a B.S. in Electrical Engineering and an M.S. in Computer Science from Stanford University, and has previously worked as a software engineer at Microsoft, VMWare, and Apture. Currently Jesse is the Chief Technology Officer at Envaya, a technology platform for civil society organizations in East Africa. Pre‐Existing Software Packages and Services Before deciding to create a web application from scratch, it is important to research existing software or services that are similar to what you want to build. This could include: • software that you could use without any modifications • open‐source software that you could modify to fit your needs • services where you could register as a customer For example, if the primary purpose for your web application is publishing content on the web, then open‐source content management system (CMS) software such as Wordpress or Drupal will typically be a good place to start. Or, you could use a hosted web‐publishing service (e.g. Weebly) that requires no technical expertise, though at the expense of not allowing you to make changes to the software. By researching existing software and services, you may find that you do not really need to develop your own software at all. 2 Hosting All web applications must contain, at the very least, a server (also known as a host) located at some IP address that responds to requests over HTTP. An HTTP server can take a wide range of forms: • A regular laptop connected to a wireless or wired network • A dedicated desktop computer plugged into broadband internet in your office • A physical server that you rent inside a data center somewhere • A physical server where the operating system is shared with many other users • A virtual server where you have the operating system to yourself, but the physical machine is shared with other users • A virtual server that is automatically provisioned as necessary by a “cloud” provider Each of these methods for setting up an HTTP server has different tradeoffs. Criteria for evaluating hosting methods and providers include: • Price: setup costs, monthly fees, bandwidth/CPU usage costs • How reliable is the method in keeping your site online • Support for your programming languages, software tools, and libraries • Application performance / number of users that can be supported per server • How easily you can scale to multiple servers when your traffic increases • How easily can you switch to a different hosting method if necessary • Network bandwidth and latency • Setup time • Required technical knowledge The best choice for hosting your application will depend on your own needs and constraints. Option 1: A regular laptop connected to a wireless network Almost any internet‐connected computer, regardless of whether it’s running Windows, Mac, or Linux, can become a web server simply by installing HTTP server software. Apache HTTP Server is a popular server that can be installed on any of these operating systems, although there are many others (discussed in the HTTP Server Software section on page 13). In most cases when your laptop is connected to the internet, your router or internet service provider will assign it a “private” IP address (commonly 192.168.x.x or 10.0.x.x)1. These IP addresses are only accessible within your network, so any computer outside your network will be unable to reach the HTTP server on your laptop. Advantages Disadvantages • Easy to set up • Can’t use it to deploy web applications • Most HTTP server software is free because not connected to internet with • Good for testing your applications on consistent public IP address your own computer or within a home/office network 1 From a command prompt, you can determine your IP address using ipconfig (Windows) or ifconfig (Mac/Linux) 3 Option 2: A dedicated desktop computer plugged into broadband internet in your office For some purposes, a regular desktop computer may be sufficient to host a web application. Simply connect a desktop computer to a network that assigns it a consistent public IP address (such as the COSTECH building), and make sure it stays powered on all the time. However, this is easier said than done. Advantages Disadvantages • Full control over hardware • Electricity and internet connection • No cost for hosting provider probably less reliable than data center • Internet connection may be slower than a data center • May require a lot of work to make sure it stays online • Cost of computer, electricity Option 3: Managed or Colocation Hosting Service Another option is to delegate the task of managing the physical server to a dedicated hosting service (also known as a managed hosting service), where you have full control over the software, but they do all the work to make sure it stays online 24/7. (Managed hosting is very similar to “colocation” hosting, where you own the hardware and store it in the provider’s data center.) Companies that provide hosting in this way include Rackspace, Contegix, Simbanet, habari.co.tz, and many others. However, these hosting services typically cost around $250 to $500/month per server, which is expensive relative