lundi 26 mars 2018

Communication between microservices / responsibilities

I'm new with microservices, and after reading many documentation, I'm still having some doubts about many things. I'm putting an example of what I want to achieve now:

Scenario:

  • Microservice architecture.
  • The FileServer will store files from several sources.
  • Each microservice has its own database.

TemplateService database:

  • TemplateId (PK): guid
  • FileId (~FK): guid
  • TemplateName

FileService database:

  • FileId (PK): guid
  • FileName
  • Path

Use case: A user wants to upload a template to the application.

Questions: (and my ideas)

enter image description here

Who creates the GUID (FileId)?

  1. UI creates the GUID, and calls both, Template Service and File Service.
  2. UI calls Template Service and this service creates the GUID, and then call the File Service

Who deals with the File Server?

  1. UI sends the File directly to the FileServer (or maybe to another service such as FileManager?)
  2. UI sends the File to FileService, and this service store it in the FileServer.

Aucun commentaire:

Enregistrer un commentaire