What is Azure Service Fabric?
Service Fabric is a distributed systems platform used to build scalable, reliable, and easily-managed applications for the cloud. Service Fabric addresses the significant challenges in developing and managing cloud applications.
Service Fabric provides comprehensive runtime and lifecycle management capabilities to applications composed of these microservices. It hosts microservices inside containers that are deployed and activated across the Service Fabric cluster.
- Applications on service fabric are designed to be composed of microservices
- Stateless or stateful Service Fabric microservices are basic unit
- Application lifecycle management is managed by service fabric.
Azure Service Fabric addresses issues in PaaS V1 as below:
- Lack flexibility (Win Server): service fabric will support windows and Linux in future.
- Low VM resource utilization: Service Fabric will organize resource in smart unit like docker container.
- Hard to implement distributed system
- Load balancing: Service fabric manage load balancing, replication framework, leadership election (HA), partitioning (high performance), distributed collections and key/value store, etc.
Comparing PaaS V1 and PaaS V2
- PaaS V1:
- A service is designed into multi web/worker/etc. roles.
- Each role is initialized into multi instances, each instance stands for a managed virtual machine in azure datacenter.
- Each role instance exclusively use one virtual machine.
- All role instances are required to be stateless.
- Communications between instances are implemented by external queue/storage services, concurrency/transaction/consistency of the communication should be handled by developer.
- Auto healing is realized by replacing problem instance with new VM, no state consistency.
- PaaS V2:
- A service is designed into multi microservices.
- Each micro service is initialized into multi instances, each instance stands for a managed compute unit like docker container in azure machines.
- Each azure machine can be used for multi microservice instances.
- Instances of microservices can be either stateless or stateful.
- Each instance is provisioned with replicas and auto syncing channels.
- For stateless microservice instances, communications between them can also be implemented by external queue/storage services, concurrency/transaction/consistency of the communication should be handled by developer.
- For stateful microservices instances, their state info is managed/replicated/partitioned by service fabric
- Auto healing is realized by replacing problem instance with instance replica, state consistency is guaranteed.