[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wsf-java-user
Subject:    Re: [User] Multi-tenant data source in carbon application
From:       Andriy Zhdanov <azhdanov () gmail ! com>
Date:       2012-08-14 8:32:14
Message-ID: CAC-U4sNh-x053eJ=BC9MUhb1NYiGaA7Ku6Woz1jKuRctG0FWDg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Amila,

You understand me correctly. I also have doubts about my idea, though
regarding your concerns I can say:

1) authenticated subject could be provided by carbon context
2) they should have same or very similar schema

As I mentioned, I'm considering multi-tenancy with EclipseLink or
Hibernate, they both provide means to work with single table shared between
tenants, or table per tenant. It could be nice if Carbon on its turn would
provide model for accessing database per tenant.

As I understand now this could be achieved with Carbon Registry for small
data, and also with Data Service as a Service, though the latter is still
unclear to me.

Well, no clear question this time, thank you for your help, appreciate your
time, I'm really just researching.

Thank you.

On Tue, Aug 14, 2012 at 6:30 AM, Amila Maha Arachchi <amilam@wso2.com>wrote:

> Hi Andriy,
> 
> On Mon, Aug 13, 2012 at 9:44 PM, Andriy Zhdanov <azhdanov@gmail.com>wrote:
> 
> > Hi Sumedha,
> > 
> > First of all thank you for your prompt reply, it took me long to find
> > someone to answer :)
> > 
> > Let me ask further.
> > 
> > Right, we can assume stratos live. Then let's say I deploy saas enabled
> > carbon application. After it, I understand stratos live tenants login to my
> > application but I'd like them to access their data source within my
> > application. Does it make sense? Is it possible?
> > 
> 
> If I understand your requirement correctly, you want your SaaS enabled
> application to access the data sources of the tenants who log in to your
> app. IMO this does not make sense due to several reasons.
> 
> 1. Different tenants' data sources have different credentials. So you need
> to either know them or request them from the tenant (tenants do not have
> permission to access other tenants' datasources without the owners
> credentials due to the permissions)
> 2. You dont know their database schemes.
> 
> If you are talking about accessing tenants' information (is that what you
> mean by accessing other tenants datasources), I think it can be done via
> the carbon context. AFAIK, carbon context can provide you some information
> about the logged in user.
> 
> What you can do is, maintain a datasource by your own in StratosLive Data
> Service as a Service to be used in your application.
> 
> Sumedha can correct me if theres something wrong.
> 
> Regards,
> Amila.
> 
> > 
> > Thank you.
> > 
> > 
> > On Mon, Aug 13, 2012 at 2:47 AM, Sumedha Rubasinghe <sumedha@wso2.com>wrote:
> > 
> > > 
> > > 
> > > On Mon, Aug 13, 2012 at 1:24 AM, Andriy Zhdanov <azhdanov@gmail.com>wrote:
> > > 
> > > > Hi,
> > > > 
> > > > I'm interested in multi-tenant Java SaaS, and in this particular case
> > > > I'm learning possibilities with WSO2 PaaS. Could someone please help me to
> > > > get better familar with SaaS possibilities of WSO2 carbon platform?
> > > > 
> > > 
> > > You should be looking @ is http://wso2.com/cloud/stratos/ .
> > > 
> > > 
> > > > 
> > > > What I know so far, it is possible to have saas enabled carbon
> > > > application, that will allow WSO2 PaaS tenant users login to my
> > > > application. I've just learned about CarbonContext and Registry also.
> > > > 
> > > > Questions I have:
> > > > 
> > > > 1) Does CarbonContext represent context of logged in tenant user or
> > > > context of tenant service, i.e. my service, and so tenant?
> > > > 
> > > > Refer
> > > http://wso2.org/library/articles/2012/03/carbon-context-its-usages-wso2-productsfor \
> > > an example of how to use CarbonContext. 
> > > > 
> > > > 2) Is it possible to access tenant specific data source within saas
> > > > enabled carbon applcation? If so, how? E.g. with CarbonContext.
> > > > 
> > > WSO2 RSS (Relational Storage Service) is operating on this space. It
> > > allows you to create a database (and a corresponding datastore) with
> > > correct permissions, so that only tenant's users having that credential
> > > range can access databases created within their tenant. (we are using
> > > database engine's (currently MySQL) permission model for this). Read :
> > > http://wso2.org/library/articles/2011/09/wso2-unveils-its-relational-storage-solutions-wso2-stratoslive
> > >  
> > > 
> > > > 
> > > > 3) I guess Carbon itself uses shared database per tenant, I guess even
> > > > shared table. Is it so? If so, is it possible to use the same in carbon
> > > > application?
> > > > 
> > > 
> > > Carbon uses a single database to store all tenant configuration. Data is
> > > stored partitioned by tenant's Id. So achieve tenant isolation, we ensure
> > > every call to database has tenant id value set.
> > > 
> > > For user level applications, we recommend using a different database.
> > > 
> > > 
> > > > For better understanding, I'm thinking of something like EclipseLink
> > > > @Multitenant with WSO2.
> > > > 
> > > > Thank you.
> > > > 
> > > > _______________________________________________
> > > > User mailing list
> > > > User@wso2.org
> > > > http://wso2.org/cgi-bin/mailman/listinfo/user
> > > > 
> > > > 
> > > 
> > > 
> > > --
> > > /sumedha
> > > +94 773017743
> > > 
> > 
> > 
> > _______________________________________________
> > User mailing list
> > User@wso2.org
> > http://wso2.org/cgi-bin/mailman/listinfo/user
> > 
> > 
> 
> 
> --
> *Amila Maharachchi*
> Technical Lead
> Member, Management Committee - Cloud & Platform TG
> WSO2, Inc.; http://wso2.com
> 
> Blog: http://maharachchi.blogspot.com
> Mobile: +94719371446
> 
> 
> 


[Attachment #5 (text/html)]

Hi Amila,<br><br>You understand me correctly. I also have doubts about my idea, \
though regarding your concerns I can say:<br><br>1) authenticated subject could be \
provided by carbon context <br>2) they should have same or very similar schema<br> \
<br>As I mentioned, I&#39;m considering multi-tenancy with EclipseLink or Hibernate, \
they both provide means to work with single table shared between tenants, or table \
per tenant. It could be nice if Carbon on its turn would provide model for accessing \
database per tenant.<br> <br>As I understand now this could be achieved with Carbon \
Registry for small data, and also with Data Service as a Service, though the latter \
is still unclear to me.<br><br>Well, no clear question this time, thank you for your \
help, appreciate your time, I&#39;m really just researching.<br> <br>Thank you.<br> \
<br><div class="gmail_quote">On Tue, Aug 14, 2012 at 6:30 AM, Amila Maha Arachchi \
<span dir="ltr">&lt;<a href="mailto:amilam@wso2.com" \
target="_blank">amilam@wso2.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> Hi Andriy,<br><br><div class="gmail_quote"><div \
class="im">On Mon, Aug 13, 2012 at 9:44 PM, Andriy Zhdanov <span dir="ltr">&lt;<a \
href="mailto:azhdanov@gmail.com" target="_blank">azhdanov@gmail.com</a>&gt;</span> \
wrote:<br> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex">

Hi Sumedha,<br><br>First of all thank you for your prompt reply, it took me long to \
find someone to answer :)<br><br>Let me ask further.<br><br>Right, we can assume \
stratos live. Then let&#39;s say I deploy saas enabled carbon application. After it, \
I understand stratos live tenants login to my application but I&#39;d like them to \
access their data source within my application. Does it make sense? Is it \
possible?<br>


</blockquote></div><div><br>If I understand your requirement correctly, you want your \
SaaS enabled application to access the data sources of the tenants who log in to your \
app. IMO this does not make sense due to several reasons.<br>


<br>1. Different tenants&#39; data sources have different credentials. So you need to \
either know them or request them from the tenant (tenants do not have permission to \
access other tenants&#39; datasources without the owners credentials due to the \
permissions)<br>


2. You dont know their database schemes.  <br><br>If you are talking about accessing \
tenants&#39; information (is that what you mean by accessing other tenants \
datasources), I think it can be done via the carbon context. AFAIK, carbon context \
can provide you some information about the logged in user.<br>


 <br>What you can do is, maintain a datasource by your own in StratosLive Data \
Service as a Service to be used in your application.<br><br>Sumedha can correct me if \
theres something wrong.<br><br>Regards,<br>Amila.<br></div> <div><div class="h5">

<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"> <br>Thank you.<div><div><br><br><div \
class="gmail_quote">On Mon, Aug 13, 2012 at 2:47 AM, Sumedha Rubasinghe <span \
dir="ltr">&lt;<a href="mailto:sumedha@wso2.com" \
target="_blank">sumedha@wso2.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> <br><br><div class="gmail_quote"><div>On Mon, Aug 13, 2012 \
at 1:24 AM, Andriy Zhdanov <span dir="ltr">&lt;<a href="mailto:azhdanov@gmail.com" \
target="_blank">azhdanov@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">





Hi,<br><br>I&#39;m interested in multi-tenant Java SaaS, and in this particular case \
I&#39;m learning possibilities with WSO2 PaaS. Could someone please help me to get \
better familar with SaaS possibilities of WSO2 carbon platform?<br>





</blockquote></div><div><br>You should be looking @ is <a \
href="http://wso2.com/cloud/stratos/" \
target="_blank">http://wso2.com/cloud/stratos/</a> .<br> <br></div><div><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">






<br>What I know so far, it is possible to have saas enabled carbon application, that \
will allow WSO2 PaaS tenant users login to my application. I&#39;ve just learned \
about CarbonContext and Registry also.<br><br>Questions I have:<br>






<br>1) Does CarbonContext represent context of logged in tenant user or context of \
tenant service, i.e. my service, and so tenant?<br><br></blockquote></div><div>Refer \
<a href="http://wso2.org/library/articles/2012/03/carbon-context-its-usages-wso2-products" \
target="_blank">http://wso2.org/library/articles/2012/03/carbon-context-its-usages-wso2-products</a> \
for an example of how to use CarbonContext. <br>





</div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"><br>2) Is it possible to access tenant specific data \
source within saas enabled carbon applcation? If so, how? E.g. with \
CarbonContext.<br>





</blockquote></div><div>WSO2 RSS (Relational Storage Service) is operating on this \
space. It allows you to create a database (and a corresponding datastore) with \
correct permissions, so that only tenant&#39;s users having that credential range can \
access databases created within their tenant. (we are using database engine&#39;s \
(currently MySQL) permission model for this). Read : <a \
href="http://wso2.org/library/articles/2011/09/wso2-unveils-its-relational-storage-solutions-wso2-stratoslive" \
target="_blank">http://wso2.org/library/articles/2011/09/wso2-unveils-its-relational-storage-solutions-wso2-stratoslive</a><br>






 <br></div><div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex"> <br>3) I guess Carbon itself uses \
shared database per tenant, I guess even shared table. Is it so? If so, is it \
possible to use the same in carbon application?<br></blockquote></div><div><br>Carbon \
uses a single database to store all tenant configuration. Data is stored partitioned \
by tenant&#39;s Id. So achieve tenant isolation, we ensure every call to database has \
tenant id value set.<br>





<br>For user level applications, we recommend using a different \
database.<br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br>For better understanding, \
I&#39;m thinking of something like EclipseLink @Multitenant with WSO2.<br>






<br>Thank you.<br>
<br></div>_______________________________________________<br>
User mailing list<br>
<a href="mailto:User@wso2.org" target="_blank">User@wso2.org</a><br>
<a href="http://wso2.org/cgi-bin/mailman/listinfo/user" \
target="_blank">http://wso2.org/cgi-bin/mailman/listinfo/user</a><br> \
<br></blockquote></div><span><font color="#888888"><br><br clear="all"><br>-- \
<br>/sumedha<br><a href="tel:%2B94%20773017743" value="+94773017743" \
target="_blank">+94 773017743</a><br> </font></span></blockquote></div><br>
</div></div><br>_______________________________________________<br>
User mailing list<br>
<a href="mailto:User@wso2.org" target="_blank">User@wso2.org</a><br>
<a href="http://wso2.org/cgi-bin/mailman/listinfo/user" \
target="_blank">http://wso2.org/cgi-bin/mailman/listinfo/user</a><br> \
<br></blockquote></div></div></div><span class="HOEnZb"><font color="#888888"><br><br \
clear="all"><br>-- <br><font size="1"><b><font><span \
style="color:rgb(153,153,153)">Amila Maharachchi</span></font></b><br \
style="color:rgb(153,153,153)"> <span style="color:rgb(153,153,153)">Technical \
Lead<br>

Member, Management Committee - Cloud &amp; Platform TG</span></font> <br><font \
color="#888888"><font face="verdana, sans-serif"><span \
style="font-size:x-small"><span style="font-family:arial;font-size:small"><span \
style="font-size:x-small">WSO2, Inc.; </span><a href="http://wso2.com/" \
target="_blank"><span \
style="font-size:x-small">http://wso2.com</span></a></span></span></font><span \
style="font-size:x-small"><br>


<br>Blog: <a href="http://maharachchi.blogspot.com" \
target="_blank">http://maharachchi.blogspot.com</a> <br>Mobile: <a \
href="tel:%2B94719371446" value="+94719371446" \
target="_blank">+94719371446</a><br><br></span></font><br>

</font></span></blockquote></div><br>



_______________________________________________
User mailing list
User@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/user


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic