Context Aware Configuration for multi tenant site | Community
Skip to main content
Level 2
July 21, 2022
Solved

Context Aware Configuration for multi tenant site

  • July 21, 2022
  • 3 replies
  • 2500 views

Hello AEM Folks,

 

Need your suggestion whether to use Context Aware Configuration for below use case or not !

 

I have two different sites. both sites has number of configuration page i.e 1.config, 2.config and each config has different set of component containing the site specific configuration.

 

site A --> configuration Page  --> Components [1. marketo configration, 2. merchant services configuration, 3. feed configuration]

site B --> configuration Page --> Components [1. marketo configration, 2. merchant services configuration, 3. feed configuration]

please note : the configuration differs for siteA and B both.

 

Now, Do you recommend to use sling context aware configuration?

Is it advisable to use it when you have site specific configuration in large amount? Looking for your suggestion/better approach to achieve it.

 

#AEM #CAC

 

~Ravi

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by DEBAL_DAS

To deal with site specific configurations it is advisable to Context aware configuration over OSGi configurations.

OSGi configuration is runmode specific.

 

In your case , site specific configuration page is having different set of component containing the site specific configuration. If I draw a relation between configuration page and components, then it's 1:m relation. Please correct me.

 

Now my question would be, all the no components will be reading same configuration from that specific configuration page? If yes, then please create a utility context aware configuration code and it will help you to avoid code duplication.

 

 

3 replies

arunpatidar
Community Advisor
Community Advisor
July 21, 2022

Yes, you can use CAC for managing configurations.

Do not flood page properties and that can have issues with content back staging.

 

Keep configurations separately. 

Arun Patidar
sunil_kumar_
Level 5
July 21, 2022

Hi @ravijais04 , 
Yes, Use Context aware configurations. It will give you flexibility to have separate configuration for different content hierarchy within same site. Make sure you use only configurations which not dependent on runmodes. means configurations are same for all run modes.

DEBAL_DAS
DEBAL_DASAccepted solution
July 22, 2022

To deal with site specific configurations it is advisable to Context aware configuration over OSGi configurations.

OSGi configuration is runmode specific.

 

In your case , site specific configuration page is having different set of component containing the site specific configuration. If I draw a relation between configuration page and components, then it's 1:m relation. Please correct me.

 

Now my question would be, all the no components will be reading same configuration from that specific configuration page? If yes, then please create a utility context aware configuration code and it will help you to avoid code duplication.

 

 

Level 2
July 22, 2022

Thanks Debal. 

Actually, configuration is not same when 1:M.

Components will contain different meta data/details for its corresponding site, meaning different configuration for site A and different for site B.

 

my only concern is since there are number of components. Hence, configuration data will be huge for each site under /conf/content/siteA and /conf/content/siteB.

 

I am just looking to optimize it. Do you recommend redesign the configuration/metadata into properties (key value pair), instead of having them in the component. Any insight into this?

DEBAL_DAS
July 22, 2022

I was saying if you are planning to use same configurable values across multiple components with following relationship  1(configuration page):m (no. of components) for a specific site, then  create a utility context aware configuration code and it will help you to avoid code duplication.

 

Here you are having multiple configuration pages per site itself. Am I correct?

1. Could you please help me to understand the content architecture of individual site along with configuration page.

 

2. Components like marketo configration, merchant services configuration and feed configuration will be used on configuration page only. Please confirm.