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.
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.
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.
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.
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.
Azure functions app can connect into azure cosmos db storage and external applications like sendgrid, dropbox etc. through connectors.
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 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.
* 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.
In Service Fabric application can be deployed in two ways.
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
* 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.
* You have to pay extra for using service fabric.
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.
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.
1. Upload the input video files to azure storage account.
2. Create a Batch pool of compute nodes in your Batch account with properties such as node size, Operating system and location of storage account.
3. Create a Batch job to run the workload on the pool of compute nodes and associate it with a Batch pool.
4. Add tasks to the job
5. As the tasks run, you can query Batch to monitor the progress of the job and its tasks.
6. 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.
7. 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.
* High performance and highly scalable
* Fully managed service
* You only pay for the resources you use
* Azure batch supports windows and linux
* Requires platform expertise in setting up tasks
* More programmatically and less tooling.
Get Updates on Tech posts, Interview & Certification questions and training schedules