No Comments | ADD

When creating a web application, there are six factors to consider for determining the server environment that’s best for your needs: availability, performance, reliability, scalability, manageability and cost. When increasing any of the first four, you are likely going to be increasing the cost and manageability (depending on the situation) as well, so it’s important to find a balance that fits your application. Don’t worry, we’re here to help. Discover some of the common server architectures and their benefits below:

Single Server Setup

A single server setup contains everything for your website on just one server. This is going to be the least expensive option available, and is most suitable for low traffic/low resource web applications. Typically, if an application is suitable for a single server setup, you can get by with a low or medium power server. If you feel the need to get a high power server to run your application, you may benefit from other setups. Using page caching or a content delivery network (CDN) will help reduce the resource requirements for the application to help improve the performance of server.

08122015-Jordan-ServerEnvironment-764x310

Pros

Cost: One server will always cost less than multiple servers.

Manageability: A single server is simple to set up, update and diagnose when an error occurs.

Reliability: With a single server, data will always be up-to-date since there is no necessary synchronization between servers.

Cons

Scalability: The only way to scale a single server is to upgrade it, which can result in downtime for your web application.

Availability: If anything happens with the server, your application will no longer work until it’s fixed.

Performance: The database and application will share resources, which can lower performance if the server isn’t powerful enough to handle it.

Separate Database Server

A separate database server utilizes two servers, one for the application and one for the database. This setup can improve the performance and scalability of a single server setup, while having little effect on the cost. A more powerful server can be used for the database or application server depending on how resource demanding each are for that application. Personally, I feel that if an application requires more than one server, you will get more benefit from another setup.

08122015-Jordan-ServerEnvironment-764x310-2

Pros

Cost: This is still an affordable option when only two servers are required.

Manageability: The manageability of a separate database server is just as simple as a single server setup.

Performance: The database and application will no longer share resources, which can improve performance.

Reliability: As with the single server setup, data will always be up-to-date since there is no necessary synchronization between servers.

Cons

Scalability: While you’re able to upgrade the servers individually, there is still no horizontal scaling (adding additional servers), so there will be downtime if either need to be upgraded.

Availability: If anything happens to either server, the application will stop working.

Layer 4 Load Balancing

Layer 4 load balancing uses a minimum of four servers: one load balancer, one database server and at least two application servers. The load balancer will distribute traffic to the different application servers to keep the load evenly distributed. This setup will greatly improve the scalability, availability and performance of an application. If your application receives too much traffic or requires too many resources for a single server setup, this is what I recommend using.

08122015-Jordan-ServerEnvironment-764x310-3

Pros

Performance: Since the database is separate from the application servers and the traffic is distributed amongst multiple servers, this will keep the application running smoothly.

Scalability: Layer 4 load balancing allows for horizontal scaling. So, any time the application needs to boost its resources (temporarily or permanently), additional servers can be added without bringing the application down.

Availability: With the application existing on multiple servers, if one application server fails, there will be at least one other server to keep it running until the other server is fixed. However, if the database or load balancer fail, the site will still go offline.

Cons

Cost: The price is going to be more expensive than a single server or separate database server setup, but if your application requires load balancing the additional cost is well worth it.

Manageability: The initial setup takes longer, and testing, updating and diagnosing server errors can be more difficult.

Reliability: This is only really a con in the event of a server synchronization failing or when it is running too slowly, as the data could temporarily be different on each server.

Layer 7 Load Balancing

Layer 7 load balancing is similar to layer 4 load balancing in that it has one database server, one load balancer and multiple application servers. The main difference is that application servers will be put into multiple clusters, with each one set up to distribute different content. For example, you may have one cluster handle a blog and another cluster handle the rest of the website. This setup is most useful for large applications, where different areas of the application get various amounts of traffic.

08122015-Jordan-ServerEnvironment-764x310-4

Pros

Performance: Different areas of the application now have their own resources, increasing performance even further than layer 4 load balancing.

Scalability: Each area of the application can be scaled individually since they are set up with different clusters of servers.

Availability: As with the layer 4 load balancing, if one application server fails, there will be other servers to keep the site running until it’s fixed. Only the cluster that had the server fail will have any kind of temporary performance reduction.

Cons

Cost: The price of setting up layer 7 load balancing is quite high.

Manageability: The manageability of layer 7 load balancing is similar to that of the layer 4 load balancing due to the setup and error diagnosing.

Reliability: The reliability of layer 7 load balancing only suffers with poor or failed synchronization.

In addition to some of the common server environment setups, there are a few additions that can be used for improved performance.

Backups

It’s important to have backups of your application in case of a catastrophic situation, so you can restore the application. Many hosting providers offer regular server backups for an additional cost, while many content management systems (CMS) such as WordPress and Drupal have free plugins that can create remote backups of your application. Of anything that could be added to an application, this one is the most important.

Pros

Availability: Backups will dramatically reduce the downtime of an application after a catastrophic event.

Cons

Cost: Full server backups will incur additional costs. However, the use of free remote backup plugins on a CMS eliminates this problem.

Caching

Caching can be done using a caching server, temporarily storing frequently accessed data in a file to reduce the amount of resources necessary to make the same request in the future. Using an accelerator server will usually increase costs, but the performance boost can be significant. However, if caching is used on things that are not frequently accessed, it can actually slightly reduce performance.

Pros

Performance: Caching reduces the amount of processing an application will need to do by storing the results for later, resulting in increased performance.

Cons

Cost: An accelerator server will increase the cost of your environment, but building cache into your application that is stored on the application server or using server caching such as varnish or memcache will incur no additional costs.

Reliability: The biggest downside to caching data is that it takes time to update. If an image or page is cached and then it is updated, it could continue to show the old data until it has been cleared from the cache.

Content Delivery Network

A CDN is used to deliver static files such as images, css and JavaScript from a separate server. They are optimized to handle these requests, and will make it so the application server no longer handles them.

Pros

Performance: The files will no longer be requested from the application server, increasing performance.

Cons

Cost: A CDN will increase the cost of your server environment, but it’s usually directly related to how much content is being delivered from it.

Database Replication

Database replication is similar to that of load balancing. Instead of having a single database for your environment, you have multiple databases that are synchronized with each other. You can also set up the database servers to work in multiple clusters, as you would with layer 7 load balancing setup. Depending on the setup though, the application has to be built to distribute its requests to multiple databases.

Pros

Performance: The database will exist across multiple servers to evenly distribute requests.

Scalability: You can easily scale your database by adding new database servers.

Availability: This eliminates the single point of failure on the database server by allowing other database servers to continue handling requests if one of them fails.

Cons

Cost: More servers mean more money.

Reliability: Since the databases need to sync, it’s possible that the data in them will not match at all times.

Manageability: As with load balancing, the setup time for this is increased along with diagnosing issues.

Multiple Load Balancers

With multiple load balancers, all traffic for the site no longer goes through the single load balancer to distribute traffic to the application servers. Traffic will be distributed to each load balancer, which will then distribute the traffic to the application servers.

Pros

Availability: This eliminates the single point of failure for the load balancer, so in case one fails, other load balancers will still be in place to direct the traffic.

Performance: This can increase the performance by having load balancers and servers set up in different parts of the world, so traffic from those regions access servers closer to them to increase response time.

Cons

Cost: Adding load balancers will increase the number of necessary servers, resulting in a higher cost.

Manageability: Setting up multiple load balancers can take time and often requires an IP address that can switch between multiple servers, which is not offered by many hosting providers.

As with most applications, the key aspects to keep in mind for a website are availability and performance. If users can’t access the application quickly, you could be losing business. This is why it’s important to determine the best environment possible within your budget. Knowing how much traffic is expected and what will be going into the application will help determine the best setup possible.