-
Notifications
You must be signed in to change notification settings - Fork 33
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
New option for Modis::Model - :enable_all_index #7
Conversation
28b6238
to
a2aa543
Compare
Allows to disable creating of my:core:key:all kind of keys if they are not needed. Getting rid of these keys is important feature, because those keys consume a huge amount of memory (one single *:all key for 158m records consumes for about of 10GB of ram) Assuming some people don't use Model.all in their code, it's important to disable that feature on demand
a2aa543
to
5ef9bea
Compare
Considering this is out in the wild, I'm a bit skeptic to introduce this as an opt-in feature as developers that update the gem would have to add the code to maintain current functionality. What do you think about making this an opt-out option instead so that we can safely release a new 2.x version instead and make a future release make this opt-in. That would give you the ability to opt-out as needed for now without breaking others codebase. Also, any thoughts on the behavior of |
… set to false By default, redis returns emtpy array when the desired key does not exist. This behavior may mislead a developer, since he just disabled that key to be used. So instead throw error to bring an attention to it
They don't have to. "all" index is still enabled by default, so default behavior did not change. So if no def all_index_enabled?
@use_all_index == true || @use_all_index.nil?
end Or, are you talking more about semantic stuff like
I thought on this, but wasn't sure about the details. You're right. I've added another commit introducing error when user is trying to get :all records with that option disabled. |
Sorry to get back at this so late, I've been pretty swamped with life 😄
Yeah, I was talking about the name as it originally confused me. Though reading the code it makes sense the way you implemented it. If you don't mind making the name change that would be great, I'll merge this and release a new minor version update 👍 |
Actually, disregard...thinking about it, it makes sense to leave it as is if in the future we make this an opt-in feature the name will make better sense |
Thank you! Are you going to release a minor version with this update soon? (I just want to use this fix in our production, so we prefer setting version instead of github's master branch) |
Yeah, I'll do that today as I'm at GORUCO for the day and I tend to do a lot of OSS work when I'm at conferences 😄 |
@nattfodd I've released version 2.1.0 of the gem which includes your change! Thank you for this! 🎉 |
Allows to disable creating of
my:core:key:all
kind of keys if they are not needed.Getting rid of these keys is important feature, because those keys consume a huge amount of memory.
For example, one single
*:all
key having 158m ids consumes about of 10GB of RAM.Assuming some people don't use Model.all in their code,
it's important to disable that feature on demand