×

Search anything:

Guide through Serverless architecture

Binary Tree book by OpenGenus

Open-Source Internship opportunity by OpenGenus for programmers. Apply now.

Introduction

In this OpenGenus article, we will present to you serverless architecture and its different aspects.

Table of Contents

  1. Introduction
  2. What is it
  3. How it works
  4. It’s history
  5. What problem is it answering
  6. When is it used
  7. Real life examples of the architectures being used
  8. The negatives
  9. Improvement on serverless
  10. Key-takeaways
  11. Conclusion
  12. References

What is it

Serverless architecture is a system comprised of cloud infrastructure and an application.

How it works

There are different definitions depending on the type of serverless architecture.
BaaS - (Mobile) Backend as a Service – is a form of the architecture where an application is able to use APIs provide by the third-party service to add back-end functionality and host the program in the cloud. Some examples of BaaS providers are: Back4App, Backendless, etc.

The other type of serverless architecture is called FaaS - Functions as a Service. Each section of the code is divided and run when an event happens. Each function is managed by the cloud provider. They usually offer authentication with database services among other capabilities. Some examples of FaaS providers are: AWS Lambdas, Cloudflare Workers, Iron.io, Alibaba Functions, etc.

PaaS, Platform-as-a-Service, is a form of serverless architecture that is more centred on developing the program than taking care of the underlying Infrastructure. The system manager would have to manage how the application scales but on the other hand they would be able to run, manage and make applications. Some examples of PaaS providers are: Apache Stratos, OpenShift, Google App Engine, Adobe Magento Commerce Cloud, etc.

IaaS, Infrastructure as a Service, offers cloud-infrastructure that the customer buys a fixed amount of capacity through an API or GUI. Examples of that they offer are: a server with the characteristics desired. The server being rented is a VM. It is the system developer’s job to maintain the server and the application. Some examples of IaaS providers are: Amazon EC2, SAP Business Technology Platform, VMware Cloud Foundation, Fujitsu, etc.

The last one I want to discuss is SaaS, Software as a Service, works by using a subscription to access software being hosted on the platform. Some examples of SaaS providers are: ZenDesk, Slack, DocuSign, Dropbox, etc.

It’s history

It began with systems administrators would use physical servers for software. Some of the things that they would have to do is making sure that there is enough memory left, make sure that the drivers work, update the hardware, etc. there was a high dependence between the hardware and the software.

The creation on virtual machines made it possible to deploy programs on simulated servers making it possible to run the programs on different physical servers. The introduction of the new technology made it easier to upgrade parts and move the software. Virtual machines began the decoupling of hardware and software.

What came after is containerized deployment. It works by separating the OS from its applications and run them independently from the OS. It gave fruition to containers (“A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another” from Docker).

Note: Just to clarify, the main difference between containers and VMs is that VMs virtualize the whole machine including the hardware layers with a hypervisor, but containers only virtualize software layers on top of the OS level.

Then came the server which allowed the developer to not have to bother themselves with where the code is hosted.

What problem is it answering

Compared to containerized deployment, Serverless Computing is better at the following:

  • Easier to use via abstraction.
  • Cheaper to use serverless architecture because the use of the program is dependent on events.
  • It does not take a long time to run.
  • It uses a small amount of memory.
  • It has better statistical multiplexing.
  • Easier to change instruction sets.
  • Encourages architectural innovations
  • Compared to VMs, serverless computing is better at the following:
  • GB-second prices are always constant
  • Software that is deployed serverless architecture can be released to different locations with no increase to payments.
  • When using VMs you need to pay by fixed capacity, e.i. no matter whether the capacity is enough or not you pay for a fixed amount of it
  • The user of VMs would have to manage them unlike with serverless architecture

When is it used

Serverless architecture is used for:

  • Web and API serving
  • Data processing
  • 3rd party services
  • Chat bots
  • Internet of Things

Real life examples of the architectures being used

Let’s use a food delivery app to understand all the types serverless architecture.
With BaaS the cloud provider would provide the backend of the delivery app, e.g.: security, updating, database management, user authentication, etc. while the developer would just have to take care of the client-side like the user interface.

With FaaS the developer would divide the food delivery app into functions, e.g. cart, user authentication, delivery driver tracker, etc., and the cloud provider would manage those functions.

With PaaS the cloud provider would manage the hosting but the owner of the software would have to manage the updates to the scaling of the platform. The user would have access to the online platform but not the software, e.i. the apk and not the website.

With IaaS the cloud provider would give access daily for the app except when the orders are higher to the capacity agreed in the subscription. The developer would not be able to manage the back-end.

With SaaS the cloud provider would give access to the software via the users’ web
browser instead of having the ability to choose the hardware. The cloud provider usually has APIs and software that the developer would be able to integrate if they wish. In this case they might not need to write the add to cart functionality or the reviews section or manage the front-end and the back end.

The negatives

  • There is less control over the server.
  • The security of server is dependent on what the provider considers a priority
  • There it is hard to find what you would have to pay.
  • It is hard to test the software in the developer’s machine.
  • It is best to not use it for software that has fine-grained state sharing capabilities.
  • Some applications will have slow start times compared to them being hosted on a VM.

Improvement on serverless

  • The cloud provider should estimate the resource needed because the developers would not be able to decide on the number of CPUs, etc when deciding on the memory size and time limit for execution.
  • Build a distributed in-memory service that has a better network stack because some applications are affected by the latency caused by storage when transferring states.
  • Unikernels should be used to reduce the startup time since the choices it makes are preconfigured.

Key-takeaways

  • Serverless architecture is the most popular way of releasing software but containers and VMs are still being used
  • Serverless architecture is not perfect
  • There is not a fixed definition for serverless architecture
  • There are four types of serverless architecture for different needs
  • Serverless architecture is the biggest decoupling between software and hardware

Conclusion

In this OpenGenus article it was discussed what serverless architecture, the types, its history, etc. With this knowledge the reader will be able to have a better understanding on the topic.

Guide through Serverless architecture
Share this