mardi 6 avril 2021

How to design REST API and a scheduled job that connects to same database

I have a service that exposes APIs for a small database. I also need a new scheduled job that fetches large set of data from the same database and creates a report from it.

If I create a separate codebase for the scheduled job, its going to create duplicate code, which needs to be maintained, if there is some changes to the database schema. This is also against the concept of one database per service concept that we follow.

I cant use or create a new API to fetch this data, as this is a huge data and API is going to timeout.

What's the ideal approach here?

Aucun commentaire:

Enregistrer un commentaire