wojciech.kapcia@tigase.net opened 4 years ago
|
|||||||
@andrzej.wojcik Could you confirm, that the last option doesn't require additional, dedicated configuration apart for data-sources? (It's not entirely clear what's the default UserRepositories mapping to data-source - user-repository for every data-source or user-repository for data-source that matches configured VHost or only manually configured repositories in UserRepository bean in TDSL)? |
|||||||
I think it is for each |
|||||||
I was pondering the issue some more: we were discussing that it's not possible to distinguish if the particular dataSource is "vhost" or not without actually having access to some "main" configuration repository, which then yielded conclusion, that |
|||||||
I think that we have 2 issues here.
Moreover, Kernel is prepared to inject what is needed and it is very difficult (or impossible) to initialize single user repository without initializing the rest of them. |
|||||||
OK, my understanding is as follows:
If so, then there shouldn't be any significant difference between specifying named repository under repository (which may or may not match the vhost) and indicating that the data-source should be used as vhost repository. For example, currently you have to configure explicitly dataSources and userRespository
Which, with additional dataSource parameter could be translated to
(this is just an idea and possible improvement, if this is unfeasible then we can stick with using |
|||||||
@wojtek A few comments:
We always initialize all registered repositories.
How that would happen? We need user repository to get vhosts, so you would need to register (an unregister) new beans dynamically based on existing data sources and vhosts. To make this work, you would need to:
NOTE: Changes done in points 3-4 are "similar" to changes done by hot reload of a configuration (which you worry that will crash a server) and may interact with changes applied by hot reload of the configuration when we will have it (adding a bean of repository is just change in the configuration but done on the fly).
This is done in the same way as it was done before. There is a map and in which key is a domain name and the value is a repository to use. I do not want to add a new config field to data source to mark it as vhost data source. This is something which should be simple and generic. We may want to have a data source ie. for counter data logger and why it should be marked (or even has a field to be marked) as vhost data source? Also, how will you solve an issue when user repository named ie. How about auth repository? by default they are using user repository implementations, but not always. Would you manually configure them? or would you just "generate" them as with user repositories? If so, how will you tackle usage of LDAP for authentication? What if I would like to have authentication for all domains in a single "credentials" repository while the rest of a data in a separate repositories? would that still be possible? |
|||||||
I was referring to the current case: if you specify repository in userRepo (or any component that uses repository actually) then appropriate repositories are be created. I think we are considering slightly different cases here...
That would be a somewhat different use cases where it would be more dynamic. It could be extended even to automatic database/schema creation when vhost is created (which would be interesting, but it's completely out of scope here)
Valid point. But we still have a case where we somewhat "mark" data-sources as special (by listing them in userRepo). And based on that we would create other respective repositories in other components. And while "marking" dataSource could feel wrong, using userRepo as indication that other beans should also have same set of repositories as user repo feels unintuitive. Having this information in dataSource seems more direct/cleaner. Maybe to make it saner we could add filed/set "data-source-features" which could contain additional "capabilities" of the data-source, one of which would be "domain source"?
First of all - I don't want to eliminate current mechanism - if someone desire to have such configuration then go ahead. I only want to simplify (default) configuration. Second thing - such configuration is quite unusual in itself. Yes, we do have it on tigase.im but only because previously two domains were sharing one database, which is just weird if you are going for per-domain database...
Same as currently or when using
Well, I'd say that with using What I'm proposing with additional configuration in data-source is the same as listing domain/repositories under userRepo and using (I think we need BeagleTime tomorrow ;-) ) |
|||||||
That feels like a good solution. I would just want to keep being able to user "current" version, so we would create an extension (ie. DataSourceFeatureAware) which would provide this feature-set configuration option and would make it a default bean for
Valid point. I agree. We need to discuss during a call. |
|||||||
Some conclusions from the call:
|
|||||||
wojciech.kapcia@tigase.net batch edited 7 months ago
|
Type |
Task
|
Priority |
Normal
|
Assignee | |
Version |
tigase-server-9.0.0
|
Spent time |
2h
|
-
tigase-server-9.0.0 Open
As a result of discussion in #tigaseim-90 we should change the default behaviour of
MDRepositoryBean*
so that all components will prefer using domain repository if it's present - you suggested changingtigase.db.beans.MDRepositoryBean.SelectorType
toEveryUserRepository
. We have following possibilities (selectors) now:List
- Repository instances will be created for default data source and for data sources listed in configuration.EveryDataSource
- Repository instances will be created for every data source.EveryUserRepository
- Repository instances will be created for every data source for which user repository exists.to-do:
optionally: 4) add automatic configuration updater (configure use of old selector)