ServerlessArchitecture#02 Serverless vs Microservices Architecture

ServerlessArchitecture#02 Serverless vs Microservices Architecture

The future business computing needs

Software giants like Google, Microsoft, IBM and Amazon already offer the customers to migrate all the local business operational efficiencies to be hosted on their flagship serverless platforms like AWS Lambda and Azure Functions. So we need to understand what is serverless/ serverless computing and serverless architecture.

To summarize, I would simply put, serverless architecture is an event- and request-driven tech solution allowing application developers to create actionable working environments in the cloud that have all the necessary computational resources needed for a smooth coding flow.

while opting for serverless services to streamline your application development processes, you can drastically improve your other business optimization initiatives along the way – like DevOps and Agile practices.

image.png


To summarize, the blog Use-Cases are:

  1. Microservices Model Vs Serverless : SImilarities and Differences
  2. Drawbacks of Microservice architecture {i.e.. sitting idle, pay for host servers capacities on a daily/monthly basis}
  3. Serverless: a real on-demand app development environment
  4. Traditional Vs. Serverless Architecture
  5. When to use what? - Microservice Vs Serverless
  6. How Serverless Works (BaaS U Faas)
  7. Backend as a Service (BaaS)/ Mobile Backend as a Service (MBaaS) and Top providers of MBaaS
  8. Function as a Service (FaaS): on the fly and Top FaaS Providers
  9. Selection Criteria When Choosing a FaaS Offering
  10. How BaaS and FaaS models help developers to handle complex resource-intensive tasks that involve hosting of your data, infrastructure as well as business logic elements.

Selection_026.png

1.1 Microservices Model Vs Serverless

These two architectures possess similar functional properties – that is,

  • they can minimize operational costs
  • as well as minizmize the application deployment cycle,
  • handle ever-altering development requirements, and
  • optimize everyday time- and resource-sensitive tasks.

image.png

image.png

But, there are some striking differences between microservices and serverless models you should definitely get to know.


Microservices Microservice architecture (smaller type of SOA- service-oriented architecture) is a set of self-sustained small services, running on their own machines using lightweight mechanisms (usually REST APIs’ or JSON, AMQP, SOAP etc) to allow inter-module communication of the underlying application.

Lets have a look at the Monolithic Vs Microservice based architecture. I am not going through details of this as it is out of my blog scope .

image.png

image.png

As a rule, the microservice architecture enables data containerization through software executable packages like Docker, with all the necessary data getting unpacked on demand as developers access a given API. Numerous microservices patterns ensure the continuous deployment of applications via operations run on the cloud platform.

Major Drawback: Utilizing microservice architecture may turn out to be quite pricey for business owners, since even sitting idle microservices are, in fact, active – therefore, you’ll have to pay for host servers capacities on a daily/monthly basis.

Serverless The serverless architecture is way more promising for application developers as it provides the execution of cloud-based working environments on demand. It means that

  • serverless functions are triggered only when a certain event is getting set.
  • This done, the functions execute a sequence of operations depending on the commands that users have input.
  • then the serverless platform applies a set of preconditioned algorithms and rules to process computations
  • and come up with actionable results.

After all the operations are through, the environment you’ve been working in folds up at once until the next task is requested, which apparently gives us the right to call the serverless architecture a real on-demand app development environment.

Lets have a look at Traditional vs Serverless architecture. I have avoided the details here due to the scope of my blog.

image.png

What to use When !!!

  • the microservices are way better to be employed for such use cases as eCommerce websites, where the containerization of various large-scale data sets is a priority.
  • Serverless showcases its great potential when it comes to optimizing development costs and time.

1.2 How Serverless works

Serverless as a development model driven by preconfigured events, utilize a number of distributed cloud-based services to streamline the software deployment workflow. Usually, it embodies two complementary service models:

  • Backend as a Service (BaaS)
  • Function as a Service (FaaS)

image.png


Backend as a Service BaaS is a previously famous cloud-based computing model, that automates and manages the backend side of a web or mobile application development.

Now, mainly known as its latest approach – Mobile Backend as a Service (MBaaS), it helps developers with data and files storage, messaging and push notifications, a social networking integration, and their configuration and supervision.

MBaaS is an exercise of employing service providers to work on the backend services for all the technical infrastructure essential for a stable application development via custom SDKs and APIs.

List of Top BaaS Providers
KumulosParse
FirebaseHasura
Back4appKinvey
AzureLinx
Leancloud

Function as a Service (FaaS) FaaS or Function as a Service is a platform that lets you run self-contained functions (code snippets) in the cloud.

  • It offers users to execute already designed codes when triggered. It is popularly being used for its real-time processing of data.

  • This helps developers in creating or updating codes on the fly that could be executed with any interaction with its element on the page.

  • The apps and services run on a select type of temporarily running containers (ephemeral containers) in the existing pod. A pod consists of multiple running containers that share the same resources and network.

  • They exist to provide smooth user integrations and to accomplish a variety of workloads and troubleshooting without disturbing anything else in the process.

List of Top FaaS Providers
AWS LambdaCloud Functions- Google Cloud
IBM OpenWhiskIronWorker
Joyent Manta FunctionsMicrosoft Azure functions
PubNub BLOCKSServerless Docker

So, In FaaS, custom codes run in ephemeral containers. FaaS is meant to manage and regulate microservices in an optimum manner. Hence, it is an event-based model, to monitor and execute the hosted code bits, without bothering the user with the code execution.

image.png

In a simple way, BaaS handles and backend functionality and FaaS helps developers to implement micro services in a better way.


1.2 Selection Criteria When Choosing a FaaS Offering

The main criteria programmers are paying attention to when choosing a FaaS solution are the simplicity of development and support by the cloud provider. These and other factors of importance are presented on the graphics below.

image.png

When working in duo, the BaaS and FaaS models can help developers to handle complex resource-intensive tasks that involve hosting of your data, infrastructure as well as business logic elements. This said, serverless comprises both of these two approaches, thus giving users a wide scope of functional benefits. The scheme below is to clarify the difference between serverless and other popular cloud-based service solutions.

image.png