Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting multiple mongo backends #42

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open

Supporting multiple mongo backends #42

wants to merge 26 commits into from

Conversation

dbusch
Copy link

@dbusch dbusch commented Oct 15, 2011

I've modified the plugin so that it can support configuring multiple mongo backends. You can now annotate your model classes to declare in which backend the collection lives. The value given in the annotation matches up with a set of configuration settings in the application.conf file.

Issues:

  1. Even with my testing, I'm not 100% certain I haven't broken some key assumptions about what the plugin is supposed to do.
  2. I had to modify the public api of the plugin. The behavior and method signature of some public static methods were change so its very likely this version is not backwards compatible for some users
    • public static Datastore ds(String name) in MorphiaPlugin was rewritten
  3. The plugin has support for using GridFS, mongo's blob storage mechanism. Due to how this feature was implemented, blob storage can only be supported on a single mongo backend even though multiple instances may be configured.

@greenlaw110
Copy link
Collaborator

The biggest concern is every requests will go through reflection to find the db name which could impact the performance.

@dbusch
Copy link
Author

dbusch commented Oct 20, 2011

You're absolutely right I just don't know what to do about it other than to try to build up a map of classname -> db names

On Oct 20, 2011, at 4:48 PM, Green Luo wrote:

The biggest concern is every requests will go through reflection to find the db name which could impact the performance.

@greenlaw110
Copy link
Collaborator

Probably code enhancement could be a solution.

@dbusch
Copy link
Author

dbusch commented Oct 21, 2011

I'll try to take a look into these two approaches next week.

On Oct 20, 2011, at 11:02 PM, Green Luo wrote:

Probably code enhancement could be a solution.

Reply to this email directly or view it on GitHub:
#42 (comment)

@dbusch
Copy link
Author

dbusch commented Nov 1, 2011

I've made an update to improve the performance of the datasource name lookup. Also have added a couple bugfixes and merged in the latest 1.2.4 code.

@greenlaw110
Copy link
Collaborator

thx, will evaluate

On Wed, Nov 2, 2011 at 8:05 AM, dbusch <
[email protected]>wrote:

I've made an update to improve the performance of the datasource name
lookup. Also have and added a couple bugfixes and merged in the latest
1.2.4 code.

Reply to this email directly or view it on GitHub:
#42 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants