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
  • 2523 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
New Member
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.

 

 

Debal Das, Senior AEM Consultant
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
New Member
July 25, 2022

Hi Debal,

 

please note the following :

 

1. component configuration is not same for both site.

2. Yes, multiple configuration pages per site.

3. site structure will be like for SiteA :

            /content/siteA/siteconfiguration/confiurationPage1

            /content/siteA/siteconfiguration/confiurationPage2

            .

            .

            /content/siteA/siteconfiguration/confiurationPage8

 

the same structure will be for siteB as well i.e.

          

            /content/siteB/siteconfiguration/confiurationPage1

            /content/siteB/siteconfiguration/confiurationPage2

            .

            .

            /content/siteB/siteconfiguration/confiurationPage8

 

4. Yes, you are right. components like marketo configrationmerchant services configuration and feed configuration will be used on configuration page only.

 

~Ravi

 

                       


Hi @ravijais04 ,

 

Before finalize the optimize solution, I would like to ask below questions -

 

1. Who will be responsible to add configurable values on those configuration page? Will it be content authors?

 

2. You want to read those configurable values using following components  marketo configrationmerchant services configuration and feed configuration right?

Debal Das, Senior AEM Consultant