'Is it okay to accommodate cron jobs inside the library?

We’re currently splitting monolithic app into a set of microservices. This monolithic app contains certain functionality which is a good candidate to become a library. This library will be consumed by several other microservices.

Decoupled functionality also requires having cron jobs for regular monitoring.

Do you think it’s a good idea to have these cron jobs to be distributed inside the library and not in a separate repository?



Solution 1:[1]

I would think about a number of aspects before taking that decision:

  • The services where this lib will be imported, are going to benefit from those cron jobs? Or is there a chance that for some of them, the cron jobs might not be needed?
  • What is the overhead of those cron jobs? Are they likely to impact the microservice functionality in terms of resource usage?

Based on those 2 aspects, I believe you can take the decision pretty easily.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Cosmin Ioni??