Service Fabric Summary continued Part
3.
Part 1 of Service Fabric Summary focuses on
the principle and the purpose behind the design decisions in Service Fabric. Part 2 focuses on usage. Part 3 in this article focuses
on efficiency.
Service Fabric provides an
infrastructure to build, deploy, and upgrade microservices efficiently with
options for auto scaling, managing state, monitoring health, and restarting
services in case of failure. It helps developers and administrators to focus on
the implementation of workloads that are scalable, reliable, and manageable by
avoiding the issues that are regularly caused by complex infrastructures. The
major benefits it provides include deploying and evolving services at very low
cost and high velocity, lowering costs to changing business requirements,
exploiting the widespread skills of developers, and decoupling packaged
applications from workflows and user interactions.
Service Fabric follows an application model where an
application is a collection of microservices. The application is described in
an application manifest file that defines the different types of service
contained in that application, and pointers to the independent service
packages. The application package also usually contains parameters that serve
as overrides for certain settings used by the services. Each service package
has a manifest file that describes the physical files and folders that are
necessary to run that service, including binaries, configuration files, and
read-only data for that service. Services and applications are independently
versioned and upgradable.
A package can deploy more than one application but if one
service fails to upgrade, the entire application is rolled back. For this
reason, the microservices architecture is best served by multiple packages. If
a set of services share the same resources and configuration or have the same
lifecycle, then those services can be placed in the same application
type.
Service Fabric programming models can be chosen whether the
services are stateful or stateless.
A
stateless service is chosen when it must scale, and the data or state can be
stored externally. There is also an option to run an existing service as
a guest executable and it can be packaged in a container will all its
dependencies. Service Fabric models are both container and executable as
stateless services.
Service Fabric is also useful for
scenarios that require low-latency reads and writes, such as in online gaming
or instant messaging. Applications can be built to be interactive and stateful
without having to create a separate store or cache. Gaming and instant
messaging are some examples of this scenario.
Applications that must reliably
process events or streams of data run well on Service Fabric with its optimized
reads and writes. Service Fabric supports application processing pipelines,
where results must be reliable and passed on to the next processing stage
without any loss. These pipelines include transactional and financial systems,
where data consistency and computation guarantees are essential.
Stateful applications that perform
intensive data computation and require the colocation of processing
(computation) and data in applications benefit from Service Fabric as well.
Stateful Service Fabric services eliminate that latency, enabling more
optimized reads and writes. As an example, real-time recommendation selections
for customers that require a round trip-time latency of less than hundred
milliseconds are handled with ease.
Service Fabric also supports highly
available services and provides fast failover by creating multiple secondary
service replicas. If a node, process, or individual service goes down due to
hardware or other failure, one of the secondary replicas is promoted to a
primary replica with minimal loss of service.
Individual services can also be
partitioned where services are hosted by different hosts. Individual services
can also be created and removed on the fly. Services can be scaled from a few
instances on a few nodes to thousands of instances on several nodes and dialed
down as well. Service Fabric helps with the complete life cycles.
Capacity and Scaling are two different
considerations for Service Fabric and must be reviewed individually. Cluster
capacity considerations include Key considerations include initial number and
properties of cluster node types, durability level of each node type, which
determines Service Fabric VM privileges within Azure infrastructure, and
reliability level of the cluster, which determines the stability of Service
Fabric system services and overall cluster function
A cluster requires a node type. A node
type defines the size, number, and properties for a set of nodes (virtual
machines) in the cluster. Every node type that is defined in a Service Fabric
cluster maps to a virtual machine scale set aka VMSS. A primary node type is
reserved to run critical system services. Non-primary node types are used for
backend and frontend services.
Node type planning considerations
depend on whether the application has multiple services or if they have
different infrastructure needs such as greater RAM or higher CPU cycles or if
any of the application services need to scale out beyond hundred nodes or if
the cluster spans availability zones.
The durability characteristics of the
cluster are offered as durability tiers. A durability level designates the
privileges that Service Fabric VMs have with the underlying Azure architecture
which can allow override of infrastructure requests such as reboot, reimage or
migration that impacts the quorum requirements.
Scalability considerations depend on
whether scaling is required for the number of nodes of each node type or if it
is required for services.
No comments:
Post a Comment