In an environment where a keyspace per tenant setup is wanted it would be good to follow a similar approach like with AbstractRoutingDataSoure.
A possible solution would be an AbstractRoutingCassandraTemplate utilizing a CassandraAdminTemplate to retrieve metadata, and a cached list of CassandraTemplates per session, retrievable by a RoutingCassandraSessionContext.
This would allow the usage of Spring Data Cassandra in a multi-tenancy environment where data shouldn't be shared
Template and DataSource are different abstractions. We plan to tear the templates apart (Decouple CassandraTemplate and CQLTemplate from each other, move the sync and async API parts into CQLTemplate and AsyncCQLTemplate, respective CassandraTemplate and {{AsyncCassandraTemplate}, see DATACASS-292)
How about routing on com.datastax.driver.core.Session level? I'm thinking about something that compares to a DataSource, maybe a SessionFactory that is used by our Cassandra/CQL templates. The default returns just the default Session. The routing version would be a AbstractRoutingSessionFactory following the concepts of AbstractRoutingDataSource.
spring-projects-issues commentedAug 8, 2016
Markus Geiß opened DATACASS-330 and commented
In an environment where a keyspace per tenant setup is wanted it would be good to follow a similar approach like with
AbstractRoutingDataSoure
.A possible solution would be an
AbstractRoutingCassandraTemplate
utilizing aCassandraAdminTemplate
to retrieve metadata, and a cached list ofCassandraTemplates
per session, retrievable by aRoutingCassandraSessionContext
.This would allow the usage of Spring Data Cassandra in a multi-tenancy environment where data shouldn't be shared
Referenced from: pull request #93
The text was updated successfully, but these errors were encountered: