Azure & Cloud
My Introduction into Azure Service Fabric
As a monolithic application developer, I was challenged by my CEO to learn something more about an Azure Service Fabric technology. I would like to share with you what I have learned in the last few weeks.
Azure Service Fabric is a platform created by Microsoft that facilitates creating and deploying microservice-based architecture systems. It provides scalability, reliability, and availability for your system.
If you are not familiar with Cloud Computing, here is my Introduction to Cloud Computing:
Introduction to Cloud Computing
Cloud computing is the present and future of software utilization, development and hosting. Let me introduce you its…levelup.gitconnected.com
Microservice architecture
If you want to use Azure Service Fabric, first you must understand what microservice architecture represents.
Microservice architecture is based on multiple independent applications(services), which are communicating mostly via their public API. Service should not see implementation details of other services and vice versa. Microservices provide scalability by design because the system load is divided into more “subsystems”.
Systems like these are harder to maintain than monolithic based systems because the developer must think a little bit differently than he was used to. Every service is a self-based system that should run by itself without relying on other systems.
Cluster
Every Azure Service Fabric project is made of things called Cluster. Cluster is a bulk of resources (Load balancer, applications, IP addresses) needed for the correct functioning of an application. Cluster is made of so-called Nodes.
Node
Nodes are nothing more than usual computers or virtual machines. They use an operating system such as Windows or Linux and have installed an Azure Service Fabric Runtime. The cluster can contain 1:N nodes. These nodes are connected to each other in a network-based communication.
The main purpose of the node is to host your application. One node could host multiple applications which means every cluster can host unlimited amounts of application, as long as there are physical resources up to it.
Application
The result of Azure Service Fabric solution is an application. An application is nothing more than a declaration what does solution contains. An application describes which services it contains.
Stateful and Stateless service
Stateless service is, as title hints, a service without any state. Simply speaking, stateless service does not have any storage to save the state of data. As a stateless service can be also understood a project with database connection. How is it possible?
A project with a database connection is not storing data. The database is storing data. Storing data means saving the state.
On the other hand, Stateful service can store data in special so-called Reliable Collections. I will provide more information about the reliable collection in the next article.
Actor service
As a special kind of Stateful service performs Actor service. Actor service is service based on the Actor Model. The Actor Model is not a product of Azure Fabric Service and it is not invented by Microsoft either. The Actor Model Theory is a simplification of multithreading programming. You can find detailed information about the Actor Model here.
How I think about Actor service is that there are multiple instances of service with own storage per unit that you desire. For example, one user of your application can have his instance of Actor service.
Every Actor service must be provided with identification. It may be string, it may be guid, etc. If it can be string, it can be mostly every casted primitive type of variable you want to use.
If you think about it you can find out, that it can nicely handle one to many relationships between entities. If there is always one instance of service per user ID, there is also dedicated storage for one user. It is one to many relationships solved at the virtual or physical machine level.
So instead of creating queries using where clause with user ID condition you just create an instance of the whole service. And that is what I find very powerful as a developer.
Every month I will send you an email about with list of my newest articles. It will be ofcourse the friendly links…www.danielrusnok.com
Related Reading
- [LINK PLACEHOLDER - https://medium.com/@danielrusnok/introduction-to-cloud-computing-235e530b9fe0] — _Introduction to Cloud Computing_
- [LINK PLACEHOLDER - https://medium.com/@danielrusnok/from-monolith-to-microservices-in-5-minutes-83069677d021] — _From Monolith to Microservices in 5 Minutes_
- [LINK PLACEHOLDER - https://medium.com/@danielrusnok/how-to-implement-azure-functions-in-any-language-with-custom-handlers-78e627264ccb] — _How to Implement Azure Functions in any Language with Custom Handlers_
- [LINK PLACEHOLDER - https://medium.com/@danielrusnok/understanding-the-azure-resource-groups-and-azure-resources-d89ce92d25a6] — _Understanding the Azure Resource Groups and Azure Resources_



Top comments (0)