Configuration support for multi-tenant use cases

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Configuration support for multi-tenant use cases

vkum14
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!
Reply | Threaded
Open this post in threaded view
|

Re: Configuration support for multi-tenant use cases

Carsten Ziegeler
> 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
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Configuration support for multi-tenant use cases

vkum14
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?
Reply | Threaded
Open this post in threaded view
|

Re: Configuration support for multi-tenant use cases

Carsten Ziegeler
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]

Reply | Threaded
Open this post in threaded view
|

RE: Configuration support for multi-tenant use cases

vkum14

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+[hidden email]]
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]



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.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Configuration support for multi-tenant use cases

Bertrand Delacretaz
In reply to this post by vkum14
Hi,

On Tue, Jul 12, 2016 at 5:52 PM, vkum14 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: Configuration support for multi-tenant use cases

Bertrand Delacretaz
In reply to this post by vkum14
Hi,

On Thu, Jul 14, 2016 at 7:21 AM, vkum14 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

RE: Configuration support for multi-tenant use cases

Stefan Seifert
In reply to this post by vkum14
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:[hidden email]]
>Sent: Tuesday, July 12, 2016 5:52 PM
>To: [hidden email]
>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.