This project is meant to be a usability test of Continuous Event Stream Processing in a realtime environment. It represents an Agar.io clone based on Continuous Event Streams and Microservices. The Services are based on Node.js and GraphQL. The communication between these services is realized in a loosely coupled way with the help of Apache Kafka.
Event based architectures are a common way of realizing projects. They enable the distribution of logic to different processes and whole services. This distribution reduces the load of each component and therefore has the potential to acclerate tasks. A loosely coupled architecture also allows for rapid changes and an easy addition of new components. Microservice architectures are therefore a frequently used approach. Furthermore, there are a lot of newly released tools to ease the implementation of such services. One of these is Apollo Gateway / Apollo Federation, which provides ways of connecting different GraphQL based services and automatically generates an appropriate Gateway.
When using Microservices it is recommended to also make use of loosely coupled and asynchronous communication styles, so that an event based communication is often preferred. Apache Kafka is therefore a perfect fit for this project, in that it is one of the most used and refined tools for implementing communication channels in the form of continuous event streams.
Lastly, in realtime environments components need to process high loads in short periods of time. Even small delays might aggrevate the usability of a product / service. One reason for those delays is the time needed for service communication. To negate / minimize such a time loss monolithic architectures are used. In contrast to distributed architectures, they represent a bottle neck because of limited ressources. It needs to be tested, if a combination of Microservices and Event Stream Processing can overcome previous hurdles and acclerate the procession of tasks to allow for distributed realtime applications and how this needs to be done.
The objective is to create a simple copy of the massive multiplayer online game Agar.io with the help of Apache Kafka, Node.js and GraphQL-Services. The main game principles are simple:
Even though there are additional rules and possibilities, these are the ones that form the basis for this project. Each seperate task will be handled by one service. There might be services for movement, collision, food operations, statistics and so on. Services communicate via Apache Kafka channels and client-server communications are done via GraphQL and an API-Gateway. The synchronization of all the clients / players is another important task, assigned to a seperate service. This service will collect all the needed informations to update the map. It will also distribute this synchronized map-data to all the clients, so that these only need to update their current view without the need of implementing any other logic.
Focus points for this project are:
All installation hints are provided by the README-file of the dub.io-folder.
More informations about the research and development process are documented in the projects Wiki.