HSG-MCS-HS21_tapas/TAPAS-Final/doc/architecture/decisions/0005-separate-service-for-the-executor-pool.md

27 lines
2.2 KiB
Markdown
Raw Permalink Normal View History

2021-12-23 07:15:07 +00:00
# 5. Separate service for the Executor Pool
Date: 2021-11-21
## Status
Accepted
## Context
The Executor Pool has to keep track of which Executors are online and what task types they can execute. The Roster keeps track of tasks that need to be executed and assigns Executors to tasks. The Executor Pool functionality could be implemented in a separate service or as a part of the Roster.
## Decision
The executor pool will be implemented as a separate service.
Most importantly, the Executor Pool and the Roster need to scale differently. The Roster needs to scale depending on the number of tasks in the system while the Executor Pool needs to scale based on the number of Executors in the system. As the number of tasks is likely to far exceed the number of Executors, the two services should scale differently.
Another reason why the two should be separate services is that they have quite different responsibilities and reasons to change. On one hand, the Executor Pool manages the Executors, and therefore it will change if we want to add functionality that impacts how Executors log onto the system and how we keep track of them. For example, if we want to check if an executor fulfills some requirements before logging on. On the other hand, the Roster manages the internal execution of tasks.
Lastly, separating the two will improve the fault tolerance of the system. If the Executor Pool goes down then the Roster will keep being able to delegate tasks to internal executors, although the Roster will not be notified about added/removed executors while the Executor Pool is down. This should however not be a problem if the Executor Pool is only down for a short amount of time. Similarly, the Executor Pool can continue to keep track of added and removed executors while the Roster is down.
## Consequences
Having the services separate will add latency between an executor being added to the Executor Pool and the Roster being notified about it. However, it is only really critical that the Roster is notified about new Executors that execute a new Task Type, which should happen relatively rarely. Therefore, a small increase in latency to this workflow should not have a large effect on the overall operation of the system.