Scaling your Squidex cluster

Sebastian Stehle
Squidex
Published in
3 min readMar 24, 2018

Scaling websites is relatively easy today: You can deploy your application to the cloud or to a docker orchestrator like kubernetes and scale up the number of instances, either manually or based on hardware usage. You also need a load balancer in front of your web servers and a database like SQL server. And because SQL server is so slow for some use cases you use a cache like Redis for some of your data to increase the performance. Basically you offload your state to other applications and hope that they will be fast enough. You can create SQL server cluster if you have performance problems, but it is a pain in the ass. You also need a worker server for long running operations and a queue to pass jobs to this worker server. Stackoverflow is very successful with this architecture and I have also used it several times: https://nickcraver.com/blog/2016/02/17/stack-overflow-the-architecture-2016-edition/.

What I don’t like is that it is not that easy to setup, you need a lot of additional services like Redis, queues and you have two deployments of your application: The worker and the web servers. Therefore we have decided to move the Orleans some months ago and this migration has finally been completed.Orleans 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.

This was the blog post, that I wrote when I started with the new architecture: https://medium.com/squidex/squidex-talks-orleans-soon-eb55608c327d. At this point of time the first beta of Orleans 2.0 has been released and unfortunately it was not ready yet. Now it is, so the time has come to also integrate it to Squidex.

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 has changed. But when you install Squidex by yourself it is easier now to setup a cluster, because 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. I am pretty sure that we have to make some minor improvements when we are facing the deployment strategies, but this will be handled over time.

--

--