Web Server Basics, Explained

Need to know more about web servers, cloud environments, and caching for your content management projects? Discover what these terms mean, and more, in this article about the building blocks that are used to get your website running.

Understanding web server: the absolute basics

How data gets from your system to a browser.

You know websites live on web servers, but what exactly does that mean? Here's a quick and easy explanation.

What is a web server?

A web server is a powerful computer dedicated to your website. At the highest level, the web server offers three services:

  • Data Storage: It stores all your website's files and information, like text, pictures, and the list of people allowed to make changes.
  • Site Security: It controls who can access what on your website, keeping your data safe.
  • Page formatting: When someone visits your website, the server quickly puts together the right page for them to see.

Why do marketers need to care?

Knowing the basics of web servers helps you understand how your website works under the hood.

You may never touch the web server or code yourself, but when agencies or developers ask you for your opinion, it helps to understand what they are asking, why they are asking, and how much your decision might change the financials.

Typically, you'll want to know more about web severs when:

  • Setting up a new website: You'll need to decide on the type and power of server needed, which can affect your costs.
  • Moving an existing site to a new platform: Sometimes, technical limits of your server or software retirement often means moving to a new server and CMS.

Key points to remember:

  • A web server is a computer dedicated to hosting websites.
  • It stores your website's files, keeps things secure, and makes sure visitors see the right pages.
  • Understanding web servers can help you make better decisions about your website.

Moving to the Cloud

CDNs, Services, and more!

How Cloud Services Help Web Hosting

In the prior section, we discussed how web servers already do a lot for us. Over the last two decades, people seeking better performance have broken down some server tasks into specialized services.

However, we had to run these services on our own hardware in a data center. This required significant effort and money, so only sites with demanding performance needs invested in them.

Then, cloud services changed everything, making these solutions accessible to everyone.

First: Content Delivery Networks (CDNs)

Cloud-based solutions have existed since the late 1990s. Services like Akamai emerged to boost web performance when desktop computers were the ONLY computers (no mobile!) and many still relied on dial-up modems.

Akamai created a Content Delivery Network (CDN). A CDN is a network of servers spread around the world that store copies of your website's files. When a visitor requests a page, the CDN can send the saved file instead of asking your main web server to create a new copy. This offers several benefits:

  • Faster load times: CDNs are designed for quick file delivery, meaning visitors see your website sooner.
  • Reduced server load: When the CDN handles some requests, your main server's workload decreases. This allows it to handle more visitors overall.

Important Note: CDNs are best for websites with lots of static content (parts that don't change often). If your site updates constantly (like an auction site), you'll need to carefully configure the CDN to avoid showing outdated information.

Then: Cloud Services and Servers

But, the early CDNs didn't let you run a web server "in the cloud" with their servers. The CDNs simply copied your web pages and saved them for re-use when people asked for the same pages a second time.

Then, Amazon decided to start making their global network of computers available to outsiders, for a fee. Their approach was called "a cloud" because while there were real servers in real datacenters, Amazon built software that let people "rent" those servers without knowing names or locations.

The datacenter model that we used for decades was abstracted away with cloud architectures. We didn't care if the server was in Iowa or Colorado as long as we could quickly connect to it and it could run our software. The benefits of the cloud were summarized like this:

  • Massive networks: Cloud providers operate huge numbers of servers worldwide. This allows them to offer resources on demand. Need more server power for a short time? You can get it almost instantly in the cloud.
  • Pay-as-you-go: Instead of buying and maintaining your own servers, you rent computing power from the cloud provider and only pay for what you use.

And this second item is important! The key differences between buying a server and using a cloud server are:

  1. We own the servers we put in our data centers, we are renting the servers that are accessed from cloud providers.
  2. We must do all the maintenance on our servers. Cloud providers do most of the maintenance for us when updates are needed.
  3. Our servers have a capacity maximum. With cloud providers, you can manually or automatically add capacity when what you're renting isn't enough.

Thus, cloud services provide great flexibility and reduce our workload (less maintenance) BUT because we are renting the long-term costs are the same or slightly higher and when we stop paying, we don't have any assets left. (And for financial folks, buying a server is typically CapEX while cloud is always OpEx.)

Server Environments for Modern Web Development

Building a World Class Site, Systematically

Understanding Server "Environments" in Web Development

A web application's success hinges on a carefully orchestrated dance between code and the environments where it lives.

From the initial scribbles of code in a development environment to the robust production setup handling live user traffic, each server environment plays a critical role in delivering a seamless web experience.

In this section, we'll delve into the common server environments used by web development teams, their specific purposes, and the inherent hierarchy of importance within the development lifecycle.

At the end, we will also cover a few notes about activities that are often overlooked or not rigorously performed that can cause the environments strategy on our team to cause more troubles than it solves.

Development Environment: The Sandbox of Innovation

The development environment serves as the digital playground where developers bring their ideas to life. It's a place for experimentation, trial and error, and the freedom to break things without impacting end users.

Typically, developers set up local development environments on their personal computers. On larger teams, code from individual developesr is then merged onto a single development server to ensure the code developers write works together once it's sharing the same space.

The key idea: Local development environments (on their desktop or laptop) allows them to rapidly develop code, test functionality, and debug issues in isolation. A dedicated development server makes sure the code then works together, in a coordinated and harmonious fashion.

Elements often found in development environments include:

  • Web Server: Software like Apache or Nginx handles HTTP requests and serves web pages.
  • Database Server: MySQL, PostgreSQL, or lighter options like SQLite store application data.
  • Programming Languages and Frameworks: Specific tools like PHP, Node.js, Python, or Ruby on Rails run the CMS. Additional tooling, like Webpack, may also be used to optimize code that is sent to the browser.

The priority in a development environment is speed and flexibility. Developers need a setup that enables a fast feedback loop, where they can write code, view changes, and iterate without significant overhead.

QA or Testing Environment: Safeguarding Quality

Once code is functional in a development environment, it graduates to the Quality Assurance (QA) or testing environment. This environment mirrors the production environment as closely as possible. The goal is to detect bugs, performance bottlenecks, and user experience issues before they reach live users. QA or testing environments generally include:

  • Staging Server: A near-identical replica of the production server for rigorous testing.
  • Testing Frameworks: Tools like Selenium or Playwright/Jest to automate browser-based testing.
  • Monitoring and Logging: Systems to track performance metrics and error logs.

The testing environment prioritizes stability and realism. It's paramount to recreate real-world usage scenarios to ensure the application performs as intended under pressure.

Load Testing Environment: Handling the Surge

A special type of testing environment, the load testing environment, is dedicated to simulating high volumes of user traffic. Its purpose is to identify how the application scales, where performance bottlenecks arise, and the point at which the system might fail under stress. Load testing tools like JMeter or Gatling generate artificial traffic to push the application to its limits.

The focus in a load testing environment is on capacity planning and optimization. It helps developers and infrastructure teams understand how to provision resources and make architectural adjustments to handle anticipated traffic spikes.

Load Testing: A Vanishing Environment (for good reason!)

However! In today's world where cloud services can ramp up automatically or with minimal effort from a development team, load testing is less and less common. Imagine load testing a site, only to have the cloud services scale up and handle greater and greater loads!

Because you are paying to use the cloud services, load testing becomes an exercise to answer the question "how much will it cost us to prove the cloud services do what they say?"

Load testing environments are vanishing as cloud hosting increases. There are certainly times when a load testing environment is required! But, those are special cases where the team is hosting critical components on physical servers so the argument for load testing is easy to make.

Production Environment: Showtime

The production environment is the grand stage where the application faces real-world users. It houses the live version of the code and serves the actual traffic that generates the website or app's functionality. Production environments are typically designed for:

  • High Availability: Redundancy is often built-in with multiple servers and failover mechanisms to minimize downtime.
  • Security: Strict security measures include firewalls, intrusion detection, and data encryption to protect sensitive user information.
  • Scalability: The ability to add or remove resources (e.g., servers, databases) dynamically to accommodate fluctuations in traffic.

The production environment reigns supreme in terms of importance. It directly impacts user experience and business success.

Every other environment exists to support the flawless operation of the production environment.

Additional Environments

Depending on the project's complexity, other environments might come into play:

  • Continuous Integration/Continuous Deployment (CI/CD): Environments dedicated to automating the process of building, testing, and deploying code changes, ensuring a smooth flow from development to production.
  • Demo Environments: Used for showcasing new features to stakeholders or potential clients.

CODA: The Importance of Environment Alignment

While each environment has a distinct purpose, maintaining consistency and parity between them is crucial.

It's essential to minimize discrepancies between development, testing, and production environments. Any surprises that surface when code moves between environments can lead to costly delays and rework.

Web development is a journey, not a destination.

Server environments are the vehicles that transport an application through this voyage. By understanding their unique roles and significance, development teams can lay the foundation for web applications that are not only functional but also reliable, scalable, and secure.

The Financials of Web Servers

Working with Our Accountants

Web Hosting, Servers, and Software: Understanding the Financial Impact

In today's digital world, the technology choices we make have a direct impact on our bottom line.

Whether we're selecting a web hosting plan, deciding where our servers should live, or choosing how to purchase software, each decision shapes the way we spend money–both upfront and over time. To make informed choices, let's break down some of the key financial concepts at play.

Capital Expenses (CapEx) vs. Operating Expenses (OpEx)

Two of the core terms we need to unpack are 'capital expenses' and 'operating expenses'. It's a little like buying vs. renting:

  • CapEx (Capital Expense): These are large, upfront investments in long-lasting assets. We make a big payment and own the asset from that point forward. In tech, that could be buying physical servers, building your own data center, or purchasing a perpetual software license.
  • OpEx (Operating Expense): These are recurring costs of doing business, like rent payments, utility bills, or subscription fees. With OpEx, we typically pay as we go, with smaller but ongoing expenses. Cloud services and software subscriptions fall under this umbrella.

On-Premise Servers: The CapEx Route

Traditionally, organizations maintained their own in-house servers – known as "on-premise" (or "on-prem"). This offers:

  • Control: We have total say over hardware and software, and how things are configured.
  • Customization: We can build bespoke systems tailored precisely to our unique needs.

However, on-prem relies heavily on CapEx:

  • Hardware Costs: We pay upfront for the physical servers, networking gear, etc.
  • Facilities: Data centers require space, power, cooling, and security – it adds up!
  • Staffing: We need an IT team to install, maintain, upgrade, and secure the infrastructure.

The Cloud: An OpEx Model

Cloud services (like Amazon Web Services, Microsoft Azure, or Google Cloud) offer an alternative. Instead of owning hardware, we essentially rent it from big cloud providers. Benefits include:

  • Scalability: If we need more storage or computing power, we can often "scale up" with the click of a button (and pay a bit more on our monthly bill).
  • Pay-As-You-Go: No large upfront hardware investments. We're shifting costs from CapEx to OpEx.
  • Less Maintenance: Cloud providers handle much of the underlying infrastructure, freeing IT staff for other tasks.

However, the cloud brings its own considerations:

  • Ongoing Costs: Monthly or yearly OpEx can sometimes add up over the long run.
  • Less Control: We're less in the driver's seat when it comes to the underlying hardware and some configuration choices.

Software: Buy or Subscribe?

Once upon a time, we bought software in a box on a store shelf– a classic CapEx purchase. It was ours forever (until an upgrade was needed), and often came with a sizable price tag. Now, the Software as a Service (SaaS) model dominates. Think of services like Salesforce, Adobe Creative Cloud, or Microsoft 365.

With SaaS, we pay an ongoing OpEx subscription fee. This offers:

  • Lower Entry Costs: No big upfront software license expense.
  • Automatic Updates: The provider keeps the software current behind the scenes.
  • Accessibility: Often works through a web browser, on any device with internet.

But subscription software has tradeoffs:

  • Predictable but Perpetual Costs: It's like a utility bill–smaller, but never truly goes away.
  • Internet Reliance: Cloud software often requires a reliable web connection.

Choosing Wisely: It's Not Just About Price

While financial considerations drive many infrastructure decisions, it's essential to consider the larger picture.

  • How much in-house technical expertise do we have?
  • How fast does our business need to scale or adapt?
  • Does our industry have strict security or compliance rules that make one solution a better fit?

The best answer is often a hybrid.

Many businesses find a mixture of on-prem and cloud solutions, along with purchased and subscription software, is the smartest way to meet their unique needs – and manage their bottom line wisely!

Just remember to look for those hidden costs - agency fees to update or maintain software, salaries for IT people to manage the servers or datacenter, and more.

A web server creates expenses every moment the site is up (even if fractions of a penny) so pay attention to this when people discuss "web servers" as if it's a one-time cost or setup event.

Web Servers: The Big Picture

Summarizing everything we learned

Key Takeaways:

  • Web servers are essential for delivering your website to visitors.
  • You have choices in how you set up your servers: purchase and manage them yourself, rent cloud servers, or use services to optimize performance.
  • Organize your servers into "environments" for different stages of development (coding, testing, and live production). Strive for consistency in code and data (page content) across these environments.
  • Every moment your site is online has a cost. Understand both the initial investment and ongoing expenses of your choices.

You don't need to be a technical expert to make informed decisions about servers and their impact on your operations.

This article introduced the basics you need to ask the right questions when setting up a new site.

Good luck!