You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by vkum14 <vk...@sapient.com> on 2016/07/12 15:52:13 UTC

Configuration support for multi-tenant use cases

All there, 

We are trying to host multiple tenants on the same sling instance and trying
to figure out how we could have OOTB configuration support this model
where-in a service is not just run-mode aware but tenant aware as well since
one tenant could have different configurations than another. Has anybody
done something similar in past and how did they resolve this? 

Also I tried to use the configuration factory where-in I tried to give
unique identifier on the tenant name, supposing Sling will give me an api to
give me correct configuration after supplying tenant name as an attribute.
This was also not successful since the tenant name was converted into
something on the fly. 

Appreciate all the help here!



--
View this message in context: http://apache-sling.73963.n3.nabble.com/Configuration-support-for-multi-tenant-use-cases-tp4062451.html
Sent from the Sling - Users mailing list archive at Nabble.com.

Re: Configuration support for multi-tenant use cases

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Thu, Jul 14, 2016 at 7:21 AM, vkum14 <vk...@sapient.com> wrote:
> ...Could you please let me know the process (point me if this is documented somewhere) of
> contributing back to Sling?...

Best is to create a [PATCH] ticket at
https://issues.apache.org/jira/browse/SLING (you might need to ask for
write access here with your username first) and attach your code as an
svn patch.

Non-core contributions go under /contrib in our codebase, and we can
always adjust the location when we integrate the contribution.

It's good to file an iCLA if you expect to contribute substantial
amounts of code, see https://www.apache.org/licenses/icla.txt

-Bertrand

RE: Configuration support for multi-tenant use cases

Posted by vkum14 <vk...@sapient.com>.
Thanks Carsten, so helpful.

Could you please let me know the process (point me if this is documented somewhere) of contributing back to Sling? We might want to add this feature not in Sling core but only in Sling extensions.

Thanks,
VINEET KUMAR
Sr. Specialist
-
SapientNitro
Gurgaon Infospace Limited SEZ, Ground Floor, Tower A, Building 2,
Sector 21, Old Delhi-Gurgaon Road, Dundahera
Gurgaon 122 016
Haryana, India

desk  +91-124-676-7695
mobile  +91-88-609-99936

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

From: Carsten Ziegeler [via Apache Sling] [mailto:ml-node+s73963n4062536h48@n3.nabble.com]
Sent: Thursday, July 14, 2016 10:29 AM
To: Vineet Kumar
Subject: Re: Configuration support for multi-tenant use cases

Yes, sure feel free to open an issue and if you have some ideas or
wishes or even a patch, please add them.

Thanks
Carsten

> Thanks Carsten for the response. We had thought about the same approach but
> calculating the configuration every time using this way did not seem good to
> us and we happened to define a config node (for example config.xyz) and then
> used configadmin to pick this up. This seems easier to manage also since
> developer could easily find out configuration file and doesn't need to
> traverse so many configuration entries to first figure out which is for a
> tenant  which he was looking for. This is working well so far however IMO
> Sling should have some support for this feature too. What do you say and I
> will open a Jira?
>
>
>
> --
> View this message in context: http://apache-sling.73963.n3.nabble.com/Configuration-support-for-multi-tenant-use-cases-tp4062451p4062517.html
> Sent from the Sling - Users mailing list archive at Nabble.com.
>




--
Carsten Ziegeler
Adobe Research Switzerland
[hidden email]</user/SendEmail.jtp?type=node&node=4062536&i=0>


________________________________
If you reply to this email, your message will be added to the discussion below:
http://apache-sling.73963.n3.nabble.com/Configuration-support-for-multi-tenant-use-cases-tp4062451p4062536.html
To unsubscribe from Configuration support for multi-tenant use cases, click here<http://apache-sling.73963.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4062451&code=dmt1bWFyMTRAc2FwaWVudC5jb218NDA2MjQ1MXwyNTc5NzAxODA=>.
NAML<http://apache-sling.73963.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://apache-sling.73963.n3.nabble.com/Configuration-support-for-multi-tenant-use-cases-tp4062451p4062537.html
Sent from the Sling - Users mailing list archive at Nabble.com.

Re: Configuration support for multi-tenant use cases

Posted by Carsten Ziegeler <cz...@apache.org>.
Yes, sure feel free to open an issue and if you have some ideas or
wishes or even a patch, please add them.

Thanks
Carsten

> Thanks Carsten for the response. We had thought about the same approach but
> calculating the configuration every time using this way did not seem good to
> us and we happened to define a config node (for example config.xyz) and then
> used configadmin to pick this up. This seems easier to manage also since
> developer could easily find out configuration file and doesn't need to
> traverse so many configuration entries to first figure out which is for a
> tenant  which he was looking for. This is working well so far however IMO
> Sling should have some support for this feature too. What do you say and I
> will open a Jira?
> 
> 
> 
> --
> View this message in context: http://apache-sling.73963.n3.nabble.com/Configuration-support-for-multi-tenant-use-cases-tp4062451p4062517.html
> Sent from the Sling - Users mailing list archive at Nabble.com.
> 


 

-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org


Re: Configuration support for multi-tenant use cases

Posted by vkum14 <vk...@sapient.com>.
Thanks Carsten for the response. We had thought about the same approach but
calculating the configuration every time using this way did not seem good to
us and we happened to define a config node (for example config.xyz) and then
used configadmin to pick this up. This seems easier to manage also since
developer could easily find out configuration file and doesn't need to
traverse so many configuration entries to first figure out which is for a
tenant  which he was looking for. This is working well so far however IMO
Sling should have some support for this feature too. What do you say and I
will open a Jira?



--
View this message in context: http://apache-sling.73963.n3.nabble.com/Configuration-support-for-multi-tenant-use-cases-tp4062451p4062517.html
Sent from the Sling - Users mailing list archive at Nabble.com.

Re: Configuration support for multi-tenant use cases

Posted by Carsten Ziegeler <cz...@apache.org>.
> All there, 
> 
> We are trying to host multiple tenants on the same sling instance and trying
> to figure out how we could have OOTB configuration support this model
> where-in a service is not just run-mode aware but tenant aware as well since
> one tenant could have different configurations than another. Has anybody
> done something similar in past and how did they resolve this? 
> 
> Also I tried to use the configuration factory where-in I tried to give
> unique identifier on the tenant name, supposing Sling will give me an api to
> give me correct configuration after supplying tenant name as an attribute.
> This was also not successful since the tenant name was converted into
> something on the fly. 
> 
> Appreciate all the help here!
> 

There is no OOTB support in Sling, I think others have build something
on top of it.

For factory configurations you might add a special property, e.g. named
"tenant" with the value of the tenant in that configuration. When
getting the configuration you can use the listConfigurations method and
filter using this property.
Not sure if this is the best solution, just saying that it would work :)

Regards

 Carsten

-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org


RE: Configuration support for multi-tenant use cases

Posted by Stefan Seifert <ss...@pro-vision.de>.
please note that there is also an ongoing contribution of wcm.io Configuration [1] to Apache Sling [2].
this process has started just now, so it will take some time until it will be released.

if you are using AEM you could directly go with [1] for the time being.

stefan

[1] http://wcm.io/config/
[2] https://issues.apache.org/jira/browse/SLING-5886


>-----Original Message-----
>From: vkum14 [mailto:vkumar14@sapient.com]
>Sent: Tuesday, July 12, 2016 5:52 PM
>To: users@sling.apache.org
>Subject: Configuration support for multi-tenant use cases
>
>All there,
>
>We are trying to host multiple tenants on the same sling instance and
>trying
>to figure out how we could have OOTB configuration support this model
>where-in a service is not just run-mode aware but tenant aware as well
>since
>one tenant could have different configurations than another. Has anybody
>done something similar in past and how did they resolve this?
>
>Also I tried to use the configuration factory where-in I tried to give
>unique identifier on the tenant name, supposing Sling will give me an api
>to
>give me correct configuration after supplying tenant name as an attribute.
>This was also not successful since the tenant name was converted into
>something on the fly.
>
>Appreciate all the help here!
>
>
>
>--
>View this message in context: http://apache-
>sling.73963.n3.nabble.com/Configuration-support-for-multi-tenant-use-cases-
>tp4062451.html
>Sent from the Sling - Users mailing list archive at Nabble.com.



Re: Configuration support for multi-tenant use cases

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Tue, Jul 12, 2016 at 5:52 PM, vkum14 <vk...@sapient.com> wrote:
> ...We are trying to host multiple tenants on the same sling instance and trying
> to figure out how we could have OOTB configuration support this model
> where-in a service is not just run-mode aware but tenant aware as well since
> one tenant could have different configurations than another....

I experimented with tenant-based dynamic search paths for Sling
scripts last year at https://issues.apache.org/jira/browse/SLING-4386

This basically allows resources from different subtrees to be
processed by different versions of Sling scripts, which might in turn
select different services.

There are probably a number of unwanted side effects in this
experimental code (script caching comes to mind) but the concepts
might help for your case.

-Bertrand