Blog

Server-Less Architecture In Azure

  • (5.0)
  •   |   237 Ratings

Server-less architecture are event driven stateless compute containers that are heavily relied on third party services. These third party services are known as Backend as a Service (BaaS) or Mobile Backend as a Service (MBasS) or custom code that's run in ephemeral containers (Function as a Service or "FaaS"). For example, you developed a mobile app whose backend and database system is not designed by you but you used a ready to be deployed backend system like parse or firebase.

Enthusiastic about exploring the skill set of Microsoft Azure? Then, have a look at the Microsoft Azure Training together additional knowledge. 

The term server less may be confusing. The application has server hardware and server process which running somewhere else, and managed by third party vendors. Server less in this scenario that the organization is not looking for hardware and the server side code itself.

Let's see an example of an ecommerce app. 

Traditional Azure Architecture:

Traditional ArchitectureServer-less Architecture:

 

Server-less architecture

Description:

In server less architecture instead of writing our own authentication logic and managing the data we use a third party service like Facebook or Google authentication.

Use a third-party database as a service product in cloud like firebase or amazon dynamo db or azure cosmos db to create our product database.

Use a cloud search functionality inside your application to allow users search and discover products.
An event driven purchase function that writes successful purchase to a purchase database.

Check Out Azure Tutorials

Evolution of Server less Computing:

Server-less computing supports multiple languages and abstracts the underlying infrastructure from developer so that they can focus on building the business logic and rich user experience. Resources are charged for the time they are being used. In serverless application are broken into small specific core components.

Traditional Architecture

Server-Less Architecture

Server less computing came after the penetration of cloud computing into development. Server less computing eliminate the hassle of setting up server, database and the server-side code writing. Instead we have APIs we use for interacting with database and server.

In cloud and with a third party BaaS provider we can have a lot of connectors and predefined functions so developer need not write their own code to connect with services. Instead they write functions which trigger in response to an event. 

These functions are evolved as Function as a Service (FaaS). AWS Lambda and Azure Fuctions are two top Server-less architecture.

Server-less Computing in Microsoft Azure:

Azure Functions is a server less architecture inside Microsoft azure cloud computing platform. It allows writing small piece of codes (function) in any supported programming language like PHP, JavaScript, bash, C# etc and run them inside a container.

Azure functions app can connect into azure cosmos db storage and external applications like sendgrid, dropbox etc. through connectors.

Azure Functions

Azure Server-less function app stack: 

                     Azure Server-less Functions 

In server-less stack functions are bound to specific event and triggered when necessary. Example events are

  • HTTP / HTTPS Request
  • Message Queue Trigger
  • File / Storage Trigger
  • Timer / Schedule

Azure Functions

Performance of Server-less architecture:

Server-less computing abstracts the underlying infrastructure from the developer so developer can focus on building the business logic. Performance of server-less computing depends on the configuration and client side logic and performance of third-party connectors.
 
Azure service plans and data center regions also affect the scalability of function apps.
 

Frequently asked Azure Interview Questions

Below are the performance figures of Azure Server less architecture:

  • Scalability:  Manual Scaling in App Service plan and Auto Scaling in Consumption plan
  • Maximum numbers of function:  Unlimited functions
  • Concurrent executions: No limit
  • Max Execution: 300 Seconds
  • Supported language: C#, JavaScript, F#, Python, Batch, PHP, PowerShell
  • Dependencies: Nuget, npm
  • Deployment slots: Visual Studio Team Services, OneDrive, Local Git repository, GitHub, Bitbucket, Dropbox, External repository
  • Environment variables: Appsettings and ConnectionStrings from App Services
  • Versioning: Cloud Source, Branch/Tag
  • Events: Blob, EventHub, Generic WebHook, GitHub WebHook, Queue, Http, ServiceBus Queue, Service Bus Topic, Timer triggers
  • HTTP(S) invocation: HTTP(S) Trigger
  • Orchestration logging: Azure Logic Apps
  • Monitoring: App Service Monitoring and Application Insights.

Advantage of Server-less Architecture:

Pay for what you use: in server-less computing you only pay for the runtime usage and resource consumption of your function. You do not need to pay for idle resources. 

Scalability: In server-less computing the backend service provider will scale the infrastructure according to load. Developers are no need to write code for scalability or make any provision for  resource allocation.

Rapid Development and Iteration: In server-less computing each functions are single threaded. single threaded functions make debugging easy and deployment easier. The development team are no longer dependent on IT team and deployment happens directly from codebase. CI and CD makes rapid development fast.

Less System Administration: In server-less computing servers are managed by the third party service provides. Developers need not manage and provision servers and infrastructures. No patching and server updates.

Developer Productivity: As the underlying infrastructure is abstracted from developer, they can focus on writing the efficient business logic.

Server-less computing decreases the complexity of the application thus making deployment easier.

Azure functions:

Azure Functions is a server less architecture inside Microsoft azure cloud computing platform. It allows writing small piece of codes (function) in any supported programming language like PHP, JavaScript, bash, C# etc and run them inside a container.
 
Azure functions app can connect into azure cosmos db storage and external applications like sendgrid, dropbox etc. through connectors.

Azure functions are event driven and can perform multiple tasks like

  1. Time based processing - Azure functions support event based processing. It makes time based processing easy and a function can be written to perform a job in a specific time interval.
  2. Azure service event processing - We can write a function app that detects azure service event like reading a log file in storage blog, transform it into SQL database, and send notification to user.
  3. SaaS event processing - SaaS event processing like saving a file to one drive from email attachment or sending a mail when a new file is added.
  4. Web and mobile application backend - Azure functions can power application backend based on user data and events triggered.
  5. Real time stream processing - Azure stream analytics can receive message from Internet of things devices and then process them to create records on sql azure tables. these records are used to apply analytics on internet of things data.
  6. Real time bot messaging - Azure functions can be integrated with azure bot framework to process a bot behaviour using webhook.

Related Article: Azure Stack - Cloud Services

Advantages:

  • Azure Functions are cheaper as compare to other cloud provider’s server-less stack. Azure Functions are only billed for the active consumptions of resources. Cost is based on execution time and memory usage for each function invocation.
  • Azure Functions are simpler and contains less amount of codes. These are single threaded and easy to debug.
  • Azure Functions are scalable with very minimum configuration.
  • Azure Functions have no limit on the amount of functions you can write per project and supports multiple language than other cloud.

Disadvantage:

  • Vendor lock-in is a common problem in azure functions serverless computing. The vendor will have complete control of the run time environment.
  • Migrating azure function code to another environment is difficult and often you have to write the code from scratch.
  • Testing and authoring of azure functions outside azure portal is difficult.

Logic Apps:

Logic apps are managed service that let developers create business apps without writing code. Logic apps provides a building block based on IFTTT (If this than that). Logic apps provide connectors to integrate other third party services like twitter, sendgrid, dropbox etc. It is used to automate the workflows and write custom application for business. 

Related Article:  Azure Analysis Services

Applications, data and devices can be connected in cloud or in on-premises environment with creating logic apps that perform simple automated tasks like saving an attachment to one drive from outlook or send email when a new tweet is created.

Logic apps performs action based on an event or control flow. Azure portal has thousands of predefined templates and connectors to create Logic apps.

Advantage:

  • The logic apps have no upfront or ongoing cost. Logic apps are charged for only resource consumption and hence the cheaper solution.
  • Logic apps require no coding and with lot of connectors available, it is very easy to write and deploy logic apps.
  • You can create your custom connector with REST API.
  • Logic apps provide inbuilt diagnosis and monitoring each logic app at each steps.
  • Logic apps also supports continuous integration and continuous deployment.

Disadvantage:

  • Not easy to retrieve information if something goes wrong
  • Formatting data in web viewer
  • Logic apps are still in preview mode.

Azure Service Fabric:

Azure Service Fabric is a distributed systems platform for packaging, deploying and managing microservice that are scalable and reliable. Service fabric also used for native cloud application development.

Service fabric Services includes:

  • Failover manager ensures of availability by shifting resources within the cluster including when resources are added or removed.
  • Cluster manager interacts with Failover manager to ensure application and service constraints are not violated.
  • Naming Service provides name resolution services to ensure all services within the application are accessible.  Since the workloads are dynamic, client applications are not expected to understand what underlying infrastructure is supporting a particular service.  The Naming Service will facilitate routing between clients and the underlying service.
  • File store service provides local data and assembly persistence across nodes in the service.

Azure Service Fabric

In Service Fabric application can be deployed in two ways.

  1. Stateless
  2. Statefull

Application Life Cycle Management in Service Fabric:

Service Fabric supports application life cycle management, continuous integration and continuous deployment of cloud applications and containers. 

Service Fabric can be integrated with CI/CD tools like Visual Studio Team Services, Jenkins, and Octopus Deploy.

Service Fabric enables simpler application administration, monitoring and patch update. Most applications contains both stateless and statefull microservices and service fabric enables the deployment of multiple instances of the application along with the container and run time stack.

Related Article: Azure Monitor

Benefits of Service Fabric:

  • Using service fabric, we can deploy our applications in azure or on premises data center without any code changes. 
  • Service fabric programming model and containers allow developers to write scalable apps that are composed of microservices.
  • Service fabric simplifies the application design and assures high availability
  • Manage the lifecycle of your applications without any downtime, including breaking and nonbreaking upgrades.
  • Scale out or scale in the number of nodes in a cluster. As you scale nodes, your applications automatically scale.
  • Monitor and diagnose the health of your applications and set policies for performing automatic repairs.
  • Service fabric can be run in linux and supports multiple languages.

Disadvantage:

  • You have to pay extra for using service fabric.

Azure Batch:

Azure Batch is a platform service for running large-scale parallel and high-performance computing (HPC) applications efficiently in the cloud. It schedules high compute intensive workloads to be performed on a managed collection of virtual machines. It can automatically scale up or scale down resources as required.

Azure batch automates the job. We can easily define compute resources to execute application in parallel. It is managed service for batch processing of high volume of data.

Azure Batch

Related Article: A Complete Guide On Microsoft Azure Batch

Example: Video file transcoding.

Let assume we have to transcode a large numbers of video files. We upload and configure our application in azure batch. 

  • Upload the input video files to azure storage account.
  • Create a Batch pool of compute nodes in your Batch account with properties such as node size, Operating system and location of storage account.
  • Create a Batch job to run the workload on the pool of compute nodes and associate it with a Batch pool.
  • Add tasks to the job
  • As the tasks run, you can query Batch to monitor the progress of the job and its tasks.
  • As the tasks complete, they can upload their result data to Azure Storage. You can also retrieve files directly from the file system on a compute node.
  • When your monitoring detects that the tasks in your job have completed, your client application or service can download the output data for further processing or evaluation.

Advantage:

  • High performance and highly scalable
  • Fully managed service
  • You only pay for the resources you use
  • Azure batch supports windows and linux

Disadvantage:

  • Requires platform expertise in setting up tasks
  • More programmatically and less tooling.
Explore Microsoft Azure Sample Resumes! Download & Edit, Get Noticed by Top Employers!Download Now!

 

Azure Server-Less Architecture Overview - Infographics

Azure Server-Less Architecture Overview - Infograpgics

 


Popular Courses in 2018

Get Updates on Tech posts, Interview & Certification questions and training schedules