What if we lived in a world so advanced, where the development of market-ready software was easy, low-cost, and efficient? What if we lived in a world, where the businesses and developers could focus on just the front-end and the code that would run in the back-end (servers), without giving any thought to or putting any effort into setting-up, running and managing servers?
Actually, we live in that world. The ‘thing’, that has enabled us to achieve the above-mentioned feats is called Serverless-Computing or Function-as-a-service (FaaS). Let’s learn more about it.
What is Serverless-Computing/ Faas?
Before starting, let’s be clear about one thing, serverless doesn’t mean that there are no servers involved. It’s just that businesses and developers don’t have to worry about them by delegating the server-side components to service providers. Well, if we simply delegate this task to someone else, isn’t the cost overhead going to increase anyway? The short answer is, absolutely not.
Why use Serverless-Computing/ FaaS?
In a traditional server setup, either you or someone else has to do the following:
- Servers have to be created and setup.
- Appropriate Operating System and software have to be installed on them.
- After that, they have to be configured to fit the needs of the client and the applications reside in RAM idly, 24 x 7, whether they are used or not.
- Servers have to be maintained, by updating the software and upgrading the hardware, continuously.
- Scaling is inherently difficult, and we must anticipate it and prepare accordingly.
- It has to be ensured that the applications are highly available and fault-tolerant.
- In order to optimize the resources, load balancers have to be used.
- Last but not the least, one has to ensure that proper security protocols and rules are employed.
Imagine the cost of big applications taking up huge memory, with multiple redundant servers and being online 24 x 7. All that cost, year after year keeps adding up, and nothing could be done about it, until the advent of cloud computing. With cloud-computing, by utilizing the scale of economies and other things, the cost of the server-side components are brought down tremendously.
One such model of cloud-computing is serverless-computing, in which the following things happen:
- Application to be run on the server is broken down into tiny functions, which are called and run on demand, rather than running the whole application.
- A business or a developer does not have to think about a single thing on the server side like processing power, memory capacity, etc. at all. Why? Because all that is taken care of by the service providers.
All this bestows certain benefits upon us, such as:
- Once deployed, the application, along with its functions can be easily scaled up or down as needed without much effort, as multiple, small functions are more scalable than
giant, single applications.
- The applications once deployed, are time and again loaded and released from the server as needed. No idle-capacity and the cost that comes with it.
- Having freed cost and manpower from
server-sidearea, businesses can focus on developing applications better which leads to faster time-to-market and better efficiency.
- The applications on serverless platforms are by-default highly available and fault-tolerant.
- Payment is done on the basis of resources consumed (usually compute-time), rather than in terms of predefined capacity. This, combined with other factors, makes serverless-computing cost staggeringly less.
- All those points of traditional server setup, they simply vanish.
What is it for?
- Static websites
- Event-driven systems
- Background services like sending emails, SMS etc.
- Injecting data into databases for analytics purpose
Where it lags behind?
- Managing the complexity of a single, big application is pretty easy compared to managing an application made up of multiple, tiny functions.
- Due to constant loading and releasing
offunctions on demand, latency tends to be a bit high. One may face problems like cold start with less used functions.
Serverless-computing has revolutionized the server component of a software stack by bringing down the cost and improving the efficiency tremendously. It has many advantages but some disadvantages as well. But as with all technologies,