Udit Panchal
Udit Panchal

Reputation: 11

Microservice Decomposition for Batch Job

I am reading different posts and books on Microservice Architecture in the hunt to answer my question which is related to the Decomposition Strategies. The question is, should we create a new microservice specifically to handle the batch job?

To my context, the nature of the batch job is to read the data from the database and make REST calls to external system if the data is in the particular state. Additionally, the batch job is suppose to run only once a day.

My questions related to this are

  1. Is this an industry norm/practice that when we have to run BATCH job, it should be a new microservice because batch job consumes resources which can hinder the incoming traffic and increases latency.
  2. Does running a batch job effect the latency of the APIs exposed towards client?

Upvotes: 0

Views: 1061

Answers (1)

Igor Konoplyanko
Igor Konoplyanko

Reputation: 9374

I would say yes, it makes sense. Usually batch jobs have very different development lifecycle and deployment frequency.

I've done something similar by myself and I'm totally sure it's worth it.

Also It would then possible to spin instance to run job once a day - which can save money in cloud environments.

Latency: it depends on that other system. You might want to come with throttling your requests to other system, to not put it down under the heavy load.

Upvotes: 1

Related Questions