phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Taylor <>
Subject Re: multi tenancy
Date Fri, 22 Aug 2014 15:18:57 GMT
Hi Jan,
Yes, this works as designed. Would you mind filing a JIRA for us to enhance
our multi tenant docs, as it sounds like it's unclear?

Without creating a view, you won't be able to add tenant specific columns
or indexes (i.e. evolve each tenant's schema independently). You can, of
course, create indexes on your base table, though.

On Friday, August 22, 2014, Jan Van Besien <> wrote:

> Hi,
> I was experimenting with the Multi tenancy feature in the 4.0 branch.
> The documentation mentions how to create/use tenant specific views,
> which works as documented.
> However, I accidentally seemed to be able to get all the features I
> want without using views:
> // create a driver and connect with a non tenant url
> String nonTenantUrl = "jdbc:phoenix:localhost:2181";
> Driver driver = DriverManager.getDriver(nonTenantUrl);
> driver.connect(nonTenantUrl, new Properties());
> // reuse the same driver to connect to a tenant specific url
> String tenant1Url = nonTenantUrl + ";TenantId=jan";
> tenant1Conn = driver.connect(tenant1Url, new Properties());
> Doing this (in this order and reusing the same driver instance)
> results in a tenant specific connection with the following features:
> - no need to create views
> - all data is transparently filtered to only return the tenant
> specific data (excluding the tenant column)
> - full transparent select and upsert features (I can upsert new data
> through the tenant specific connection and it will automatically fill
> in the tenant column visible through the non-tenant connection)
> - changes in the underlying schema are possible and are reflected in
> the tenant specific connection (this is not true when working with
> views, I think at least the views have to be recreated)
> You can also reproduce this through squirrelSQL, it reuses driver
> instances as well.
> Actually I prefer the undocumented behavior, mostly because of the
> transparency. My question is whether this functionality is an
> (unwanted) side effect of the implementation or really a feature in
> the works? Given that I have to reuse a driver instance on which I
> first have to create a non-tenant specific connection, I assume it is
> not really how it is intended to work?
> Can anyone shed some light on this topic?
> Thanks in advance,
> Jan

View raw message