23

Survival guide to Serverless and FaaS (Function-as-a-Service)

 3 years ago
source link: http://blog.altabel.com/2019/11/19/survival-guide-to-serverless-and-faas-function-as-a-service/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Survival guide to Serverless and FaaS (Function-as-a-Service)

pic.png

Serverless technology and Function-as-a-Service are definitely a new trend in the IT, but what’s interesting is that they have much less press coverage than other cloud technologies like IaaS (Infrastructure as a Service), DBaaS (Database as a Service) and Paas (Platform as a Service).
Let’s then check what these terms mean and how you may apply them in your business:

‘Serverless is the evolution of cloud platforms in the direction of pure cloud-native code’.

“Serverless” may look like you don’t need your servers any more. However, the real meaning behind it is that you just use off-site servers for coding similarly to cloud services stored in DWH outside your workplace.

The architecture is built in such a way here that the functions perform a specific task and are run in logical containers that you don’t see. It means that you can write and deploy your code without worrying about the underlying physical or virtual infrastructure. What is more, your spending is based on the usage of the server e.g. computation, memory, service execution time, etc., and only that amount of bandwidth or number of servers that you are actually using.

Understanding serverless and FaaS deeper

To cut it short, serverless computing can be of two types – BaaS (Backend-as-a-Service) and FaaS (Funstion-as-a-Service). BaaS relates to the applications that use 3rd party cloud-hosted services to manage server-side logic and state. Such apps generally use a vast ecosystem of databases and authentication services that rely on the cloud.

Instead, in FaaS the developer himself is responsible for the server-side logic, similarly to traditional architectures, with the exception that this logic actually runs in stateless compute containers which are invoked due to specific event and die once the specific task is finished. These containers are managed fully by a 3rd party vendor.

What makes it so convenient is that developers can now focus more on the design and managing app’s functionalities without spending too much time on building and maintaining backend infrastructure. Perhaps this is the biggest advantage of FaaS making it more and more popular among tech specialists. Your core focus is on the end product and less on infrastructure setup, as it was in traditional app design.

Plus, using FaaS allows developers not to code to a specific framework or library, as the 3rd party service takes care of that. Deployment in FaaS differs from other traditional architectures as well – instead of running server apps, frontend codebase uploads to the service and the provider is responsible for backend, provisioning resources, instantiating virtual machines, and managing processes.

Still FaaS and serverless are not quite the same thing. You may be surprised to find out that your dev team may be using FaaS without serverless architecture. Actually surveys and polls show that that more than half of the companies use FaaS but do not embrace serverless computing.

FaaS may give you more narrow solutions, so that you can replace part or all of an app with a FaaS functionality that runs within an event-driven or HTTP context. This ease of deployment and agility means you can leverage the benefits of FaaS, particularly in specific use cases or test environments, without the entire overhaul that may accompany a truly serverless approach. On the other hand, FaaS can increase computing costs when you scale up for larger tasks like production.

Serverless computing offers far greater functionality than smaller, pay-per-use FaaS options, particularly because it can encompass a variety of technologies. Cost-wise, serverless options may offer some savings, though it’s not guaranteed.

So as you see, serverless seems more complicated than FaaS, as most probably you are running more components at a larger scale. If you give up some of this control, it might give you more time and energy for other things, but you still have to monitor carefully all those microservices aligning unlike in the traditional monolithic systems. Anyway, if you understand what serverless and FaaS are, you can choose the right solution, get more flexibility and cut costs and still build great products that everyone loves.

Computing Platforms to Run Your Application Code:

If you have finally decided to check what FaaS and serverless computing are, you may consider the following platforms for your first try:

AWS Lambda. Initially, it was supporting only Node.js, but nowadays you may run Python, Go, Java, C#. Here you may upload the code either manually or automate it by triggering through AWS services or web application.

AWS Lambda can be helpful in many real-time scenarios like file processing, streaming, data validation, data transformations, handling API requests, etc. Some of its features include:

  • Seamless integration with other AWS products
  • Stateless Lambda functions
  • High-available and fault-tolerant infrastructure
  • Extensive logging and monitoring
  • Automatic scaling and many more…

Important notice that AWS Lambda is HIPPA, PCI, ISO and SOC compliant!

Cloudflare Workers allow you running JavaScript at their more than 150 data centers around the world using the V8 JS engine. You can get it started from as low as $5 per month.

Now by Zeit – supports Node.js, PHP, Go, React and many more. A good advantage of it is that it re-builds only the changes instead of the whole application repository. Once you push the code changes, deployment is visible in seconds. You can get it started in FREE and scale as your application grows.

Azure Functions – event-driven computing which supports a large number of programming languages: JavaScript, C#, F#, Java, Python, PHP, TypeScript, Bash, PowerShell etc. Azure functions allow you to trigger a function from a web application, HTTP API from a mobile application, blob storage, streaming, webhooks and a lot more. Pricing is based on the total time it takes.

Google Cloud offers several serverless computing solutions:

a) App Engine – a fully managed platform for web and mobile applications. You can deploy your application built in PHP, Python, C#, Node.js, Ruby, Go, etc. You pay for what resources your application consume and scale based on the demand.
b) Cloud Functions – an event-driven platform to run Node.js and Python application in the cloud. You can use Functions to build IoT backends, API processing, chatbots, sentiment analysis, stream processing and more.
c) There are more – Storage, Firestore, BigQuery, Dataflow, Pub/Sub, ML engine. Probably, everything you need to build an enterprise-ready serverless application architecture.

IBM Cloud Functions is based on Apache OpenWhisk to develop application action which executes on an event trigger quickly.

EdgeEngine by StackPath deploy serverless functions written in JS, Perl, Rust, Go, C++, PHP, etc. The latency of EdgeEngine is as low as 50ms. Pricing starts from $10 per month which includes 15 million requests and unlimited scripts. And, without doubt, you can scale up.

Sum up:

As you see there are lots of options to choose if you think about going serverless. No doubts, serverless is a promising architecture for saving time and money when deploying applications, but your businesses shouldn’t limit you to thinking about serverless just in the cloud. On-premises platforms have a great deal of potential, depending on the company, industry and workload, among other considerations. Choose what is right for you and enjoy getting things done.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK