Understanding serverless computing can be confusing enough. Determining whether or not it’s a good development solution for you gets even more complicated, as there are many pros and cons to consider.
In this article, we’ll break down the basics of serverless computing for WordPress developers. Then we’ll discuss some of the factors you should consider when deciding if this technology is right for you.
Let’s jump in!
An Introduction to Serverless Computing for WordPress Users
Serverless computing can be tricky to make sense of at first, especially because its name is misleading. While it implies that you may be able to develop a website or application without a server, that’s not the case.
Instead, the term “serverless” means that the job of setting up and maintaining the servers needed to develop your project is left to a cloud services provider. This gives you, the developer, more time to commit to actually creating your website or application.
The cloud services provider handles all your back-end processes on a pay-per-use basis. Meanwhile, your website or application is built on highly-scalable architecture. To break all of this down a little further, serverless computing consists of three key features:
- Cloud-based servers that are managed entirely by cloud services providers, also sometimes called “vendors”. The developer does not have to do any server maintenance or worry about the underlying infrastructure of their project.
- Costs that are determined by usage, rather than pre-paid storage that you may or may not use to its fullest extent. With serverless computing, you pay only for the executions of your site or app’s functions, which scale automatically based on how often its code is run.
- An architecture that breaks a website or application down into individual functions. This is also known as Function as a Service (FaaS), in which code is executed in response to specific events.
In many situations, this provides a way for developers to get their projects up and running faster, as they don’t have to worry about server maintenance. It also reduces costs while increasing scalability, and in some cases, speed. However, serverless technology isn’t right for every project.
How to Decide If Serverless Computing Is Right for You (5 Key Factors)
If you’re trying to decide whether or not serverless computing is a strong choice for your next project, there are several considerations to keep in mind. While this method of developing sites and applications can offer many benefits, it’s dependent on the specific qualities of your project. Let’s explore what that means in more detail.
1. Consider the Size of Your Project and Its Potential Latency
To start with, serverless computing is most successful when it’s used to create static websites or simple applications. Static files and a small number of simple functions are easy for a serverless architecture to serve to end users.
However, very large dynamic sites and applications with a lot of more complex functions won’t necessarily fare as well. With bigger projects, your code’s run time will likely be longer, which could have negative effects on your project’s speed and the cost of running it.
A related consideration is the frequency with which each of the functions that make up your website or application will be used. When a function on a serverless architecture hasn’t been called in a while, its code is not constantly running. If a user calls an infrequently-requested function, it will require a “cold start“. This will result in latency and could impact your User Experience (UX), as it will take a while for the code to “warm up” again.
2. Decide How Much Time You Can Dedicate to Maintenance
One of the primary advantages to going serverless is the amount of time you can save. For example, you don’t have to build the infrastructure on which your website or application will run. You can focus exclusively on the code that’s specific to your project.
However, an even more appealing time-saver is the fact that you won’t have to worry about server maintenance. Your cloud services provider handles all of that for you, saving you time not only during development, but over the course of your site or application’s lifetime.
That said, if you’re already maintaining a server for another project, taking on a little additional maintenance may not be much of a problem for you. When you consider the fact that it can be extremely difficult to move a project from a traditional architecture to a serverless one, sticking with what you know isn’t necessarily a bad idea.
3. Determine Your Budget and Compare Costs
The serverless pay-as-you-go financing structure certainly has its appeals. When compared with the traditional method of paying for server space upfront, it seems like the wisest option. After all, you’ll never have to pay for space you haven’t used, like you might when you’re pre-paying.
However, that doesn’t mean serverless computing is always a low-cost proposition. As we mentioned earlier, functions with long run times could greatly increase your costs. A large website or a complex application is still going to run up a pretty high bill.
Additionally, situations where a huge number of requests are made all at once could end up costing you more than you might anticipate. This could include a simple traffic spike, or a less pleasant event such as a Denial of Service (DoS) attack. Either way, you’re the one who will pay for all those requests.
In short, don’t just assume that serverless architecture will be less expensive that the more traditional alternative of managing your own server and pre-paying for storage. Consider your traffic levels and the complexity of your project, and then compare the potential costs before committing to one or the other.
4. Figure Out How Important Scalability Is to Your Project
Handling the growth of a website or application is an ongoing and not always simple task. If you don’t account for potential growth, your project may crash and burn. However, overestimating could result in you paying for costly server space that you don’t need.
Serverless computing takes the question of scalability off your plate, and makes it on your provider’s responsibility. A serverless site or application is highly scalable and adapts instantly to your users’ needs. You’ll no longer have to worry about overloading your server, or other negative side effects to huge traffic spikes.
That said, there are plenty of ways to make your project scalable, especially when you’re working with WordPress. If there are more reasons to choose a traditional setup, scalability probably shouldn’t be the sole factor that tips the scale towards going serverless.
5. Account for a Lack of Control Over Your Server
One of the biggest concerns when it comes to serverless computing is the lack of control you’ll have over your server. While it’s convenient that your cloud services provider handles so many tedious details for you, it also restricts your access to some of your project’s features.
With no access to your server, you’re entirely dependent upon a third party for your website or application to work properly. You also won’t be able to see your back-end processes, which will make debugging and troubleshooting much more difficult than with a traditional project.
Additionally, you’ll have no way to vet your vendor’s security upfront. If you handle user data or other sensitive information, this could become risky. You’ll have no control over whether your project shares server space with other projects, which could result in data exposure. These risks can be mitigated, of course, but they’re still worth considering.
Serverless computing isn’t the most straightforward concept. While you’ll hear a lot about its many benefits, there are also key drawbacks to consider. In other words, deciding if serverless technology is right for your project is no small task.
To help you get started, here are five factors you’ll want to think about when deciding if you should go serverless:
- Consider the size of your project and its potential latency.
- Decide how much time you can dedicate to maintenance.
- Determine your budget and compare costs.
- Figure out how important scalability is to your project.
- Account for a lack of control over your server.
Do you have any additional questions about serverless computing? Let us know in the comments section below!
Article Thumbnail Image jkcDesign / shutterstock.com