Skip to content

Actor model with Microsoft Orleans – reservation simulation

Introduction

The actor model is a programming model that originated in the early 1970s. Each actor is by design concurrent and immutable object that has its own state and communicates with other actors using asynchronous messages. That is a brief introduction regarding the actor model – there are many great papers and documentation out there thus I encourage you to do research and read about the actor model, its principles, use cases and benefits.

Microsoft Orleans is a cross-platform framework based on the actor model. There are many other frameworks based on the actor model:

Simulator

I haven’t had a chance to use the actor model in day-to-day work, so I decided to write a simple application using one of the actor model frameworks – Orleans. I found out about the actor model during my master’s degree. I had to implement an application using one of the actor model frameworks – I chose Akka.NET and had a lot of fun discovering its potential. Anyway, I’m glad I tried out another interesting framework and got new knowledge in this field.

The application is a simulation of a simplified room reservation process. The primary purpose of the simulation was to test the suitability and ease of use of the Orleans framework. The application also presents two load balancing techniques: round robin and weighted nodes approach.

You can find the application on my GitHub. The README.md file describes the application, how to run it, its architecture and simulation results.

Conclusion

The implementation itself was not as hard as one could expect. Orleans provides all the necessary primitives to build an application. Moreover, the documentation is comprehensive and there are many code samples you can use. Long story short I recommend it!

I hope you enjoy it!

Have a nice day, bye!

Published in.NET

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *