Coming Soon: Auto-scaling Squidex with virtual Actors

Sebastian Stehle
Squidex
Published in
2 min readNov 19, 2017

The Squidex architecture has evolved and improve a lot in the last month, but there was always a point I was not happy with. It was the fact that you had declare one of the servers to be the event consumer. This is the server who handles all the event and populates the read databases (which are used for querying content) and who also executes our new rules. This was hard to deploy and not very stable. When this single server goes down, a lot of features in Squidex become unavailable as well. For example rules do no work or updates will not be populated to the databases. Thank to our CQRS architecture this is only a temporary problem, because events are not lost, but nevertheless this is not what you want.

I discovered Microsoft Orleans a while ago. It is a framework to build distributed stateful applications. It introduces the concept or virtual actors, called grains. A grain is like a very small and stateful micro service that exists somewhere in the cluster. It always exists virtually and the Orleans runtime ensures that it is activated somewhere in the cluster and deactivated when it is not needed anymore. Some weeks ago the Orleans team published version 2.0.0-beta1 which also runs on .NET Core now (and docker of course). So I thought I will give it a try and it worked very well. Every app (including schemas and rules) and every event consumer is a grain.

Our contributions

Because of the new version I also had to contribute to the Open Source project:

  1. I ported the Orleans Dashboard to version 2.0: https://github.com/OrleansContrib/OrleansDashboard. The pull request is still pending but I am sure that it will be merged to the main branch (perhaps after some more modifications to my code).
  2. I also ported the MongoDB provider to version 2.0:
    https://github.com/OrleansContrib/Orleans.Providers.MongoDB. My contribution has been not merged yet, but its available in nuget: https://www.nuget.org/packages/Orleans.Providers.MongoDB/2.0.0-preview2

I am very excited about the Orleans community. There are a lot of contributors and also there are Microsoft employees that work fulltime on Orleans. And the support on Gitter is awesome.

The Orleans Dashboard

What you get

When you use our cloud solution, nothing will change. I am sure the stability will also improve. But when you install Squidex by yourself it is easier now to setup a cluster. Because as I said: Every server can have the same configuration now and you do not need Redis anymore. So there is only Squidex and MongoDB now. And of course we also integrated the Orleans dashboard.

Please check out our Orleans branch and provide feedback: https://github.com/Squidex/squidex/tree/orleans

--

--