I have two microservices/modules on the backend:
- ugc
- utilities
ugc is the core microservice that contains all the data and has a database attached.
utilities is a separate tool that has no database of its own and takes care of the resource and time-intensive jobs like attaching watermark to video, extract thumbnail from video, etc.
For watermark video processing, we have a queue whose publisher end is at ugc module and the consumer end is at utilities to actually process the video.
Now, whenever a user uploads a video, an API is hit in the ugc module from the client side and it stores details in DB and pushes the video to queue to produce watermarked video.
Now, the utilities module picks each item from the queue and processes it, and once done, we need to store the updated video URL in the ugc database. Now to update the database from the utilities module, we have two options:
- Make an API in the ugc module to receive the watermark video URL and hit it from the utilities
- Connect ugc DB in utilities module using DB creds and update the model object directly using object id.
What do you think is the right way?
Is the first option an over-engineering step?