I am having trouble understanding if a microservice can contain multiple applications.
Looking at Microsoft’s example, the Ordering Microservice contains 2 applications.
- The API
- Background tasks
Looking at blog posts and other posts on this site, it seems that having multiple applications interacting with the same database is incorrect, however, I can understand that it can be useful.
Let’s take an example I am thinking of implementing for my work where we read emails and each attachment needs to be processed differently:
- Read emails from an inbox
- Save email attachments to a database for processing
- Publish "X" attachment received event
- "X" attachment service process the attachment and marks the attachment as processed.
This would violate the single per service because all of the "Attachment Services" would be interacting with the same database. Is this ok because its working within the same domain?