I have two schemas for my application. One for regular customer data and another for analytics purpose.
I want to use one data source for customer data related domain objects & other data source for analytics related domain objects.
I am new to micronaut. I see micronaut application.yml file supports multiple data sources to configure. Micronuat uses default data source by default.
Is there a way to configure datasource at a domain level like grails entity.
I'm using frontier schema for Person domain.
class Person {
String guid
String name
static mapping = {
datasource 'frontier'
table 'person'
}
}
Using analytics schema for Event domain.
class Event {
String guid
String action
static mapping = {
datasource 'analytics'
table 'person_event'
}
}
In Grails, operations on each domain are happened based on the given datasource.
How to achieve the same functionality in micronaut using multiple data sources ?