Gaming, actors and microservices
When you hear microservices and actors, do you think of e-commerce? Banking? Multi-billion dollar companies? While microservices have a lot of corporate and/or serious applications, this does not always have to be the case. Anselm ‘ae play’ Eickhoff is using these scaling techniques for an often overlooked part of server systems: gaming.
Citybound is a multiplayer city building simulator. The game allows you to collaboratively plan your city, while simulating it with real people. Because of the multi-player aspect, a server-client architecture is used. Where multiple clients can connect to multiple servers. These clients are running in the browsers of the players, and seamlessly communicate with the cluster of servers. The design element that allows Eickhoff to pull this of are actors.
Actors are objects which can send each other messages, in an unsynchronised way. Because actors don’t expect a response, and messages don’t care when they are delivered, the application has a lot of flexibility in when, and how it delivers these messages. Messages can be sent over the network to other actor runtimes, and actors can run simultaneously with other actors, or even suspended to long-term storage!
This allows both the client and the server to run the same actor runtime (Kay in this case). This design is also very well suited to be able to simulate the many households, inhabitants, buildings, vehicles, … that are present in a city. If you are interested in learning more about CityBound, we refer you to their homepage.
Microservices and actors
What does this have to do with microservices? What are microservices even? Microservices are the latest trend in server architectures. By splitting a big monolithic server into several smaller containerized services, the reliability and maintainability of the software increases. While this increases resilience on the infrastructure level, by using actors Prof. Dr. Coen De Roover also added resilience and scalability on the application level. If you want to learn more about this, we refer you to his slides.
Divide and conquer
By following the practices described above the maintenance of a project can be done more efficiently and divided into specialised teams within a project. This allows resources to be used more efficiently and the most important parts will be the ones receiving the majority of the resources needed, the scalability can therefore be focused on the actors that require it. This will also mitigate the negative effect that errors from the less important aspects of an application might have on the critical components of your project. Combining this with continuous integration and continuous deployment facilitates the integration of the various components of a project.
Actors and microservices are very similar design techniques, but employed on a different scale. Using these techniques, it is not only possible to increase scalability and resilience, but it also enables a whole new set of designs and features, previously thought to be extremely hard or even impossible to implement.
Prof. Dr. Coen De Roover made these concepts clear during his lecture, which was later followed by a fun hands-on lab where we could put to practice the learned concepts by simulating the management of a greenhouse using IoT devices.