打开 关闭

Microservices query across multiple databases #5276


User avatar
0
rogercprops 创建

We've developed a solution using the microservices template.

We have 2 services with their own database. We need to create a query using the Abp libraries that joins results from queries from each of the databases.

Use case:

The client microservices manages clients. The programs service manages programs that are assigned to clients.

We want to have one query that gets all of the programs of a given type. We want to have a second query that returns all of the clients associated with those programs.

How do we do that using the microservices template? Has anyone done this before and if so is there a sample we can follow?


1 答案
  • User Avatar
    0
    Anjali_Musmade 创建
    支持团队 Support Team Member

    Hi,

    Please check interservice communication https://docs.abp.io/en/commercial/latest/startup-templates/microservice/interservice-communication

    Also you can synchronize entity across service to do the query. you can see the cmskit module have synchronized identity users using event bus https://docs.abp.io/en/abp/latest/Distributed-Event-Bus

    https://github.com/abpframework/abp/blob/dev/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Users/CmsUser.cs https://github.com/abpframework/abp/blob/dev/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Users/CmsUserSynchronizer.cs

Made with ❤️ on ABP v8.2.0-preview Updated on 三月 25, 2024, 15:11