Ends in:
2 DAYS
2 HRS
38 MIN
6 SEC
Ends in:
2 D
2 H
38 M
6 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 December 02, 2024, 12:35