Starts in:
1 DAY
19 HRS
56 MIN
24 SEC
Starts in:
1 D
19 H
56 M
24 S
Open Closed

Microservices query across multiple databases #5276


User avatar
0
rogercprops created

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 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team 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 v9.1.0-preview. Updated on November 20, 2024, 13:06