I launched my first web hosting business back in 2009. Since then, servers have become more powerful every year, and software has gradually improved with each iteration, but the core architecture and underlying technology stack have remained mostly unchanged.
In this article, I want to take a moment to discuss a major paradigm shift that is now taking place in our industry. Recent advancements in cloud technology, particularly those made possible by tools like Docker and Kubernetes, call for a new generation of solutions and services better suited for today's developers and website owners. It's time to abandon conventional hosting and embrace the future.
Why is it needed?
Traditionally, your website has always been at the mercy of the server it is hosted on. If the server goes down, so does your website. Want to make changes to your website? Upload your files to the server. And eventually, your site might get so popular that you need to upgrade or replace the server.
Each of these steps is time-consuming and involves human interaction, increasing the risk of mistakes and unexpected outages.
"The cloud" is portrayed as solving some of these issues, but as I’m sure many of you have experienced, moving services to the cloud isn't some magic pill that makes all problems go away. It rather introduces new challenges and operational overhead due to the additional layers of abstraction.
As a result, developers and website owners often end up spending too much time on tedious tasks and infrastructure management rather than working on what really matters: building and growing the business.
Moving from servers to containers
Containers, and more specifically, clusters of containers, have emerged as one of the hottest topics in tech recently. This technology has powered large-scale web applications at Google and other big players for years but has not been generally available due to the high cost and complexity.
Containers are superior to traditional hosting in many ways:
- Containers automatically move between nodes in the cluster, enabling true self-healing capabilities and more efficient resource utilization.
- Containers require fewer system resources than traditional dedicated or virtual machine environments because they don’t have the overhead of a complete operating system or hypervisor.
- Containers can scale horizontally, providing built-in load balancing and fault redundancy.
- Containers work well with DevOps and CI/CD for streamlined build and deployment workflows.
- Containers are portable images that contain all the code and dependencies needed to run the application. They are built using open standards such as Docker, making deployments consistent and predictable without having to rely on a specific configuration of the host computer.
- Containers have a smaller attack surface and are inherently more secure than traditional hosting.
Although we can easily see the benefits of containerizing our application, containers are notoriously complicated to manage in production. Different from a virtual machine, where everything runs inside the guest OS, a container should only house a single service or program. A fairly basic web application may comprise 5–10 individual containers deployed as microservices. A large cluster can easily span thousands of containers across an arbitrary number of nodes, which is obviously not humanly manageable.
This is why a container orchestration system is necessary. At ProperHost, we use Kubernetes, which is the most popular tool for this purpose. Kubernetes ensures that containers are scheduled appropriately and manages the underlying resources required by the application, such as compute and storage.
But how do you go from code on your computer to a container running inside the cluster?
First of all, the application must be packaged into a deployable image. The image contains the (compiled) code as well as any external packages or libraries required by your application. The step of building the image is typically done using a Dockerfile, which acts as a blueprint for how to prepare the application for deployment. The Dockerfile specifies which files and programs to include and certain runtime environment settings.
In addition, we must deploy containers for databases and any additional backend services on which the application depends.
And importantly, unless your application is completely stateless, you need a reliable way to store data. In a clustered environment, this is far from trivial due to the fact that data needs to be accessible regardless of where the application is running and how many instances there are. The old model of simply attaching a disk to the server no longer works in a containerized environment. Data needs to move and scale with the application, which can span across multiple physical machines. A container-aware storage layer is needed to take advantage of dynamic volume provisioning, and to ensure that the relationship between the application and its data is maintained in a secure way.
Focus on the application, not the infrastructure
Hosting providers tend to lead with hardware specifications and technical details when describing their services. While this information may appeal to certain users (mostly "sys admins"), it’s largely irrelevant to the average website owner. While compute and storage resources are important at a fundamental level, there is a lot more to consider when choosing your web hosting solution.
Instead of thinking in terms of CPU cores, RAM, and IP addresses, users should be able to focus 100% on their application or website and not have to worry about the underlying infrastructure. Removing the notion of a server and centering the platform around the application makes your job as a developer or website owner less overwhelming and more enjoyable.
There are several problems with a server-centric hosting model:
- Servers have identity and state: they have a fixed hostname and IP address, and machine-specific configurations. This makes them hard to replace or move when the application is bound to the server itself.
- For each server, you need to manage a set of login credentials per user. There is usually no centralized management panel, which means developers have to log in to each individual server to make a change.
- Hardware upgrades and OS updates are often put on the back burner due to too much hassle.
- The server is a single point of failure for your application.
- Server provisioning and maintenance add significant overhead, especially if you’re managing a fleet of websites.
Building the next-generation hosting platform
So what exactly entails a modern application hosting platform? In this section, we’ll cover six essential elements of cloud-native hosting.
1) Embrace microservices
Each logical component of the application should be compartmentalized into its own container. This allows for better separation of concerns and more granular allocation of compute resources. Small, self-contained services with clearly defined responsibilities and boundaries are easier to reason about. Additionally, services should follow the principle of least privilege to limit the impact of a security breach.
A modern web application typically consists of:
- A load balancer/reverse proxy (nginx, varnish,haproxy, …)
- One or more frontend web instances (nginx, apache, …)
- One or more backend server instances (php, python, nodejs, …)
- A database service (mysql, mongodb, …)
- A caching service (redis)
- A job scheduler (cron)
2) Containerize the application
The user shouldn’t have to deal with the nitty gritty of converting their application into a runnable container. The platform should provide automated tools and workflows that make the process simple and effortless for the user.
Normally this is done by implementing some sort of build-and-deploy pipeline like a CI/CD system. The most sophisticated setups automatically detect the type of application and programming language being used and build the correct images without any user intervention.
3) Recover from errors
The premise of truly self-healing hosting implies that node failures should have minimal impact on the application. This means that containers must move seamlessly between nodes in the cluster and that data is automatically replicated to withstand hardware crashes and outages.
To accommodate fault tolerance requirements and failure domains, critical components should be made redundant and highly available.
4) Adapt and scale
The web is a highly dynamic environment where traffic can rapidly change. The hosting platform must provide a simple (and/or automated) way to scale up and down compute resources to quickly meet this change in demand.
In a cloud environment, this is usually done by scaling out (horizontal scaling: adding more container instances), but it can also be done by increasing the limits of the container (vertical scaling) – or a combination of both.
This is typically one of the biggest challenges when it comes to deploying traditional web applications in containers. Stateful apps like WordPress or Magento weren’t designed to run in a cloud-native environment. For example, it can't easily scale beyond a single server because the architecture is largely dependent on the local file system. These issues need to be handled by custom code or by the platform itself to avoid concurrency issues, inconsistencies, and possibly data corruption.
5) Promote DevOps principles
The platform should provide best practices and workflows that facilitate developer productivity and empower cross-team communication and collaboration. At a minimum, a DevOps-ready platform should support built-in versioning, auditing, and release management features. Developers should also expect advanced deployment automation and testing tools, which can simplify day-to-day tasks significantly.
Examples are Git "push-to-deploy", integrated staging environments, and one-click version rollback.
From an administrator's perspective, multi-tenancy features such as role-based access control and centralized user management can be used to create permission boundaries between organizations, departments, and teams.
6) Provide insights
Users should be able to easily view logs and important metrics pertaining to the health of their applications. In a monolithic server environment, it’s trivial to extract a log file or debug a problem. In a container cluster, however, where you don't know (or should care) which server your application is running on, debugging and troubleshooting become much more complicated.
Typically, each container writes to its own log, possibly using its own format. In addition, we now also have to account for the potential of network errors between services.
Traditional debugging tools and methods often don't work in a containerized environment because you can't simply log into a server with SSH.
The platform needs to collect logs and statistics and present the information in a way that is easily digestible for the user. As an example, a dashboard UI could display the real-time status of each service (container), the amount of CPU and memory it’s using, and provide access to a live event stream.
Introducing ProperHost Cloud
At ProperHost, we’ve built a bespoke cloud hosting platform that incorporates all of the elements discussed above. We've made the user experience as simple as possible by integrating with the same tools and processes you’re already used to in your daily work.
You can easily deploy code using Git from the comfort of your command line or by using the integrated SFTP feature. The built-in CI/CD pipeline will automatically recognize the type of application you are building and deploy the appropriate components.
Here is an overview of what our platform offers:
- End-to-end application lifecycle management.
- Pre-configured application stacks for WordPress, Magento, Drupal, and more.
- Integrated services like Elasticsearch, Redis, and Varnish.
- High-performance hosting that scales as you grow.
- Built-in DevOps and team collaboration tools.
- Resilient, self-healing cloud infrastructure.
- A fully automated code-to-container developer workflow.
If you want to maximize your productivity and chances of succeeding with your online business, I highly encourage you to try out ProperHost Cloud today. It’s super easy to get started, and our amazing support team is always standing by.
To learn more about the benefits of our platform click here.