Posts

Showing posts with the label Distributed System

REST - Representational State Transfer

REST - Representational State Transfer Since the past 5 years, there has been an increasing demand to know how to build RESTful Web Services. Never had a job interview for Software Engineering failed to include at least one question about REST or RESTful Web Services and never a week passed with at least hearing one comment like “if we do x, it will not be RESTful” . Everyone seems to be on top of it, know everything about REST. But is it true? Do they really know REST? How certain can one be that her system is RESTful? Today I would like to share my point of view about REST by going through three points: 1. Overview 2. How does REST link with HTTP protocol 3. What have we learnt 1. Overview Countless time, I have seen the following: A: Do you know REST? B: Yes A: Can you write the URLs for a REST API for a user profile? B: Ok, there; GET /profiles GET /profiles/123 POST /profiles PUT /profiles/123 PATCH /profiles/123 DELETE /profiles/123 A: P...

Silo configuration and Cluster management in Microsoft Orleans

Silo configuration and Cluster management in Microsoft Orleans Few weeks ago we saw how to create a Silo and how to implement grains. We also saw how we could create an ASP NET Core web app to talk to the Silo. We discovered the benefits of the single threaded model in grains. Today we will see one of the other major feature of Orleans, cluster management. This post will be composed by 3 parts: 1. Build a silo 2. Form a cluster with multiple silos 3. Cluster management with membership All the source code can be found on my GitHub. https://github.com/Kimserey/orleans-sample 1. Build a silo Let’s start first by implementing a Silo. We will be using the example we used in the past post. public class Program { public static void Main(string[] args) { var silo = new SiloHost("main"); silo.InitializeOrleansSilo(); var success = silo.StartOrleansSilo(); if (!success) { throw new Exception("Failed to start silo...

Microsoft Orleans Grains Concurrency Handling

Microsoft Orleans Grains Concurrency Handling Few weeks ago I explained the benefits of using Microsoft Orleans . One of them was the implementation of the actor pattern. Today I will dig deeper into it by revisiting a common scenario present in today systems and how it can be solved with Orleans grains. This post will be composed by 3 parts: 1 - Traditional system 2 - The problems 3 - Grain solution 1. Traditional system In a traditional system, we can often see a N-tier architecture (usually 3-tier) composed by the following: Front end -> Service tier -> Database The front end being the webserver like ASP NET. The service tier being a set of stateless services containing business logic. They ensure the consistency of the system by extracting the latest state of business object from the database, validate business rules and write back to database ~ the last tier. In this sort of architecture, the database is the source of truth. This can be illustrated with the following...

A first look at Microsoft Orleans

A first look at Microsoft Orleans Microsoft Orleans is a framework used to build scalable distributed systems. It reduces the complexity of distributed system by abstracting away concurrency issues together with state management. Processes can then be run on multiple instances and form a cluster, they can be hosted on different environment and be scaled up and down on demand. Today I will give a broad overview of the concepts utilized and developed by the team behind Orleans. This post will be compose by 3 parts: 1. Motivations 2. Definitions 3. How does it work? 1. Motivations The two main benefits of Orleans is that it: reduces the complexity of coding applications by providing a simpler model to maintain object oriented codebase. Orleans moves away from the N-tier type of architecture where business logic is held in stateless services and state is persisted in database by providing its own implementation of the actor pattern where the actor is a stateful unit of work where co...