Have you heard of serverless architecture and wondered what it could possibly be? How could an application be deployed without a server? Here’s the secret: it can’t.
Remember a few years ago when cloud computing first came to the public, and it was common to say “There is no cloud, it’s someone else’s computer”? Now we can say, “There is no serverless; you’re just using someone else’s server”.
Serverless architecture means using a cloud provider for the server. Often the same cloud provider will also supply the database, an authentication service, and an API gateway. Examples of serverless architecture providers include AWS (Amazon Web Services), Microsoft Azure, Google Cloud, and IBM Cloud Functions.
Why would a software team want to use serverless architecture? Here are several reasons:
- You don’t have to reinvent the wheel. When you sign up to use serverless architecture, you get many features such as an authentication service, a backend database, and monitoring and logging directly in the service.
- You don’t have to purchase and maintain your own equipment. When your company owns its own servers, it’s responsible for making sure they are safely installed in a cool place. The IT team needs to make sure that all the servers are running efficiently and that they’re not running out of disk space. But when you are using a cloud provider’s servers, that responsibility falls to the provider. There’s less initial expense for you to get started, and less for you to worry about.
- The application can scale up and down as needed. Most serverless providers automatically scale the number of servers your app is running on depending on how much demand there is for your app at that moment. So if you have an e-commerce app and you are having a big sale, the provider will add more servers to your application for as long as they’re needed, then scale back down when the demand wanes.
- With many serverless providers, you only pay for what you use. So if you are a startup and have only a few users, you’ll only be paying pennies a month.
- Applications are really easy to deploy with serverless providers. They take care of most of the work for you. And because the companies that are offering cloud services are competing with each other, it’s in their best interest to make their development and deployment processes as simple as possible. So deployments will certainly get even easier in the future.
- Monitoring is usually provided automatically. It’s easy to take a look at the calls to the application and gather data about its performance, and it’s easy to set up alarms that will notify you when something’s wrong.
- There may be some things you want to do with your application that your provider won’t let you do. If you set up everything in-house, you’ll have more freedom.
- If your cloud provider goes down, taking your app with it, you are completely helpless to fix it. Recently AWS was the victim of a DDoS attack. In an effort to fight off the attack, AWS blocked traffic from many IP addresses. Unfortunately some of those addresses belonged to legitimate customers, so the IP blocking rendered their applications unusable.
- Your application might be affected by other customers. For example, a company that encodes video files for streaming received a massive upload of videos from one new customer. It swamped the encoding company, which meant that other customers had to wait hours for their videos to be processed.