There were times (late 90s - early 2000s) when having a page on the internet was not only a matter of uploading files to a server. Most of the time, you would need to physically put a computer somewhere, connect it to the web, manage its uptime, and pay the electricity bills.
Today, lots of providers are happy to offer you their hosting services, thanks to the evolution of new technologies. Along with this evolution, new IT terminology was coined: the words “cloud” and “CDN” are often heard when talking about hosting. Let’s find out what they are and look at some use cases. And is CDN vs. cloud a confrontation or a cooperation?
Also referred to as “cloud computing” or “cloud services.” In a nutshell, something becomes a “cloud” when it is physically moved away from its user. Cloud hosting is no exception. What problems does cloud solve?
Let’s say you’re a company that’s growing rapidly. Your website gets more visitors, and your revenue increases—but so does the price of mistakes. Having an individual physical server (or multiple servers, which is also called a “server farm”) in the next room would be too much of a risk.
Instead, the modern approach involves innovative methods for hosting your website in a safe manner.
A typical cloud doesn’t only offer you disk space somewhere—it supports the whole infrastructure. Using cloud services, you can concentrate your efforts on product or website development. Configuration and maintenance is usually a job for the provider.
Another reason why cloud services have become popular is the billing model. While you can have a fixed plan where you pay for a certain amount of transferred data or monthly visitors, “elastic” plans can be more efficient for a growing business.
With this model, you pay only for certain billable resources like memory usage and processor time. This way, you don’t have to break the bank by spending money in advance for an enormous amount of resources—just pay as you go, only for the resources you use.
Clouds are used not only in web development. Let’s look at a couple of examples:
- Cloud computing. “Move it to the cloud” is a popular saying related to processor-heavy tasks. Routine tasks that can be distributed over several computing units are often moved to cloud services. Popular uses of cloud computing include video rendering, machine learning and artificial intelligence, and data processing.
- Website hosting. One of the most popular use cases. A good provider of cloud website hosting services doesn’t just have servers and infrastructure. Most of them also offer tools for convenient website management. This includes (but is not limited to):
- Apache and Nginx graphical user interfaces
- Database tools like phpMyAdmin
- Backup tools
- Firewalls and antivirus software
Because of the wide variety of technologies, programming languages and platforms used for website development, there are providers who offer technology-specific services. For example, some companies position themselves as Wordpress hosting services only. That way it’s possible for them to focus on platform-specific optimizations.
A content delivery network, or CDN, is a distributed network of servers that delivers content from websites to end users. Before we get into the purpose of a CDN, it might be worth taking a closer look at the functioning of a website.
Generally speaking, a website is an information system. At the top level, information systems can be split into two parts:
- The information itself (i.e., content) that needs to be displayed
- Rules and methods of information processing
When this terminology is applied to a website, the content (text, images, audio, video, etc.) is the “information.” Database procedures, server scripts and routing rules, handling requests—all of these are methods of information processing.
When a visitor clicks a link or types a website address, a request is sent to the web server. The server starts handling the request, running scripts, and making database connections. All of these are dynamic processes, and the result of the operations needs to be literally calculated—this is where the cloud really shines.
But what about, say, images? To display those, a request still needs to be sent. And the server would need to do some computations in order to deliver the file to you.
Images are static files, so they don’t generally need to be manipulated via scripts. Since that’s the case, wouldn’t it be better for a hosting service to store images elsewhere and let its main web server focus on processing requests, scripts, and database connections?
It would. And that’s where a CDN comes in.
What metrics can be improved by using a CDN? Here are a few:
- Content delivery time. The “N” in CDN stands for “network.” CDNs are not centralized. They are distributed systems with servers (also called “nodes”) spread all over the world. When a visitor requests an image, the CDN provides a copy of the file from the closest location. The less distance a signal has to travel, the faster the data is transmitted.
- Faster page loading. Since the web server is not handling image delivery anymore, the free processor time can be used to work on other requests, e.g. PHP, Java, and Node.js.
- Context-specific delivery. When delivering images, it’s important to keep the user’s context in mind. For example, an image should not always be delivered in its full size—a 4K background image would be overkill for a budget mobile device. A CDN can automatically transform and compress an image, then send an altered version to the user. This will also make the page much lighter, hence faster.
- Cost. Cloud pricing can differ from CDN pricing. Chances are that performing automatic image transformations, for example, could cost more on a cloud service than a fully equipped CDN. Plus, the cost of custom feature development (or the time spent on manual tweaking) could be higher.
This may seem like a tough choice, but there’s no need to choose only one or the other.
When you opt for a web hosting service (i.e., instead of maintaining a server on-premises), you automatically become a cloud user. What you should do though is research as many providers as possible, and choose the best one based on your project’s specific needs and your preferences—there are many good ones out there.
This, however, doesn’t prevent you from also using a CDN. If you’d like to optimize your page loading times and take the image delivery routine off your web server (whether local or remote), you may want to consider using a CDN for that purpose. While you still have the freedom to choose regular hosting over a CDN for your static content delivery, using a specialized CDN will make a positive impact on your website’s performance.
Speaking of speed and performance, Uploadcare Image CDN is a battle-tested delivery infrastructure. With its AI-powered image transformations, well-documented API, and integrations with 30+ modern frameworks, your website and images could benefit a lot from using these features.
To see the magic in action, feel free to sign up for a free Uploadcare account where you can explore all the capabilities and decide whether the Uploadcare CDN is the right fit for your needs.