Tech Learners : Cloud Computing - Going Serverless

in technology •  6 years ago  (edited)

The cloud computing introduced us to lot of new development and architecture patterns as well as new deployment models. It enabled us to think in terms of Virtual Machines(VMs) or IaaS, then containers, then PaaS and now the Function as a Service(FaaS) or commonly called serverless.
When using cloud services, the developer still needs to think about infrastructure like provisioning of VMs(compute units/network infra etc) and related services like storage (like EBS for AWS VMs). Serverless architecture relieves us of some of these additional configurations and are extremely useful to solve certain use-cases (discussed later).
So what is Serverless computing?

Enter Serverless

The word serverless is actually a misnomer. Serverless does not mean that no servers are required. It simply means that serverless relieves developers from the additional effort of understanding the underlying infrastructure on which the serverless service is running. So let’s compare it to a service like VM/EC2 where you need to configure the SSH details, attach storage, open ports etc for the service and so on, in FaaS, you just need to provision the service with the required code that needs to be executed by the function, rest of the stuff is automatically taken care by the service fabric of the cloud infrastructure. Hence at ease of management the FaaS stands at top of the pyramid.



As of now #AWS #Lambda, #Azure #Functions and #GCP #BigQuery, #App-Engine, #Cloud-Functions are good examples of serverless services available on public clouds.

Serverless Benefits

  • Simple Deployments/Infrastructure cost reduction – Without the infrastructure coming into picture, you pay for what you actually use. The cost of serverless is computed to nearest sub-seconds. So if your task took 17.5 seconds to complete on serverless infrastructure, you only pay for 17.5 seconds. Compare this with a VM costing where you are charged for uptime of VM irrespective of it is used or not.

  • Automatic Scaling and Fault tolerance – Services like AWS Lambda, Azure Functions or GCP Cloud Functions are always available and maintain their compute capacity across availability zones to provide a robust infrastructure. These services can create multiple instances of execution VMs as required to serve the incoming requests in parallel.

  • Operations cost reduction – By automating the repetitive tasks on serverless services, you save on operations costs and time.

  • Repeatable results – Since the serverless functions can execute on any of the pool machines without the user knowing the execution VM. The developer are forced to create self-contained functions. This leads to better repeatable results.

  • Extremely cheap – On AWS, the Lambda free tier includes 1M free requests per month and 400,000 GB-seconds of compute time per month. No other compute service is cheaper than this. Similar pricing plans exists for Azure Functions and GCP Cloud Functions.

Limitations

At first glance the Serverless architecture seems to be the silver bullet for all the problems. But it has certain restrictions too:

  • The VM capacity for functions is limited by limits/quotas set by the cloud providers. You can refer to following links to understand the quotas/limits for AWS & Azure:

o AWS Lmbda - https://docs.aws.amazon.com/lambda/latest/dg/limits.html#limits-list
o Azure Functions - https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale

  • The languages available to write serverless Functions is limited to few languages currently. For example python, powershell etc still experimental in Azure Functions. Similarly AWS lambda only supports few javascript like languages (node.js etc) , python, java and C#. They also put restriction on the version of the language. Besides while the VM spawned for Function execution might not have all the relevant libs required.

Use cases solved by Serverless Functions

Since serverless functions (AWS lambda , Azure Functions , GCP Cloud Functions can be triggered by a scheduler or an event or a Web-call (via web-hooks) we can use Serverless functions to solve many use-cases. Few are listed:

  1. To schedule background cleanup of resources – Let’s say you have some local resources on cloud that are not needed in between certain times (say 6:00 PM - 8:00 AM). You can write a serverless function that deletes the resource after a specific period and then recreates it half an hour before the usage period. Don’t forgot to use functions to backup the data too.

  2. Replacing existing batch jobs with functions - Your existing batch jobs can be replaced with serverless functions on cloud to achieve similar functionality without maintaining any additional infrastructure.

  3. Create notification system – The serverless functions can be triggered periodically to send out custom alerts.

  4. Time ranged clusters – We recently built a sophisticated system for a client to build a time ranged clusters mechanism, where clusters were created for a time duration and destroyed after a period of time with mechanisms for notification and time extension. This helped client to save at least 40% on expensive Bigdata clusters cost (based on month-on-month billing).

More use-cases can also be found at cloud providers's web-site.

Hope this gives you sufficient information to start with serverless functions available in public cloud. Do leave a comment if you want to know more or have any questions.

About me: I am an IT professional currently building capabilities around cloud migration & strategizing the cloud transition. Also investing my time on BigData and blockchain technologies. Tech learners is my attempt to introduce the technology in simple terms.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Congratulations @piyush.par! You received a personal award!

1 Year on Steemit

Click here to view your Board

Do not miss the last post from @steemitboard:

Christmas Challenge - The party continues

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @piyush.par! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!