The
Scheduling microservice does not operate in the background, but is used by some
users who manually interact with and alter the algorithm's results.
The
challenge we face is that the scheduling microservice needs to access data
belonging to two other microservices. Normally, I would opt for reading via API
from the respective services, as it functions like a 'read model'. However, in
this case, the data are extensive, and users will experience a significant
delay when loading data for a new plan.
Some colleagues suggest creating a copy of the data in the scheduler's database. This data would be kept updated with all the update events from the other microservices. However, this approach would generate a considerable amount of traffic (especially when data are synchronized from the ERP), which is not essential for the scheduler domain. The user works with stale (in-memory) data and decides when to update the plan he is working on. Furthermore, this pattern requires maintaining all interfaces for the update events.
I am
leaning more towards using a NoSQL cache database, like a Redis cache, in the
calling service, which we can refresh occasionally. This cache would be
populated by calling the APIs of the other microservices.
Do you have
any suggestions?
Many thanks!
Fabio