If you make the redis no longer required, what are you using instead to store the settings?
simkimsia opened this issue · 8 comments
You wrote, "As of rollout-2.x, only one key is used per feature for performance reasons. The data format is percentage|user_id,user_id,...|group,_group.... This has the effect of making concurrent feature modifications unsafe, but in practice, I doubt this will actually be a problem.
This also has the effect of rollout no longer being dependent on redis. Just give it something that responds to set(key,value) and get(key)."
Then what is used to save the settings?
Which is preferred for a production live system? With Redis or without?
Thank you.
Fyi in a former project we couldn't use redis for persistence, so we tried using pstore (standard ruby) and mongo. I've documented both in #22
So I cannot use mysql basically for this feature flag yes?
With gratitude,
KimSia
金城
On Mon, Jan 28, 2013 at 3:36 PM, Ayrton De Craene
notifications@github.comwrote:
Fyi in a former project we couldn't use redis for persistence, so we tried
using pstore (standard ruby) and mongo. I've documented both in #22#22—
Reply to this email directly or view it on GitHubhttps://github.com//issues/24#issuecomment-12771164.
I'm sure you could, you'd need to write your own custom RolloutManager
-class though, which in turn needs to respond to a get- & set-method.
But would you recommend it?
I am building a web application using the CakePHP framework and the idea of
having feature flags is crucial for quick and dirty A/B testing.
With gratitude,
KimSia
金城
On Mon, Jan 28, 2013 at 7:09 PM, Ayrton De Craene
notifications@github.comwrote:
I'm sure you could, you'd need to write your own custom RolloutManager-class
though which responds to a get- & set-method.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/24#issuecomment-12777248.
I personally wouldn't use MySQL or Postgres for something like this, if I were to be using redis in a project already, I'd go for that. If not, pstore or yaml store would be my second choices.
On Tue, Jan 29, 2013 at 5:43 PM, Ayrton De Craene
notifications@github.comwrote:
that
Thank you!
I will definitely look at this closer.
With gratitude,
KimSia
金城
@simkimsia , in case you decide to use Mysql (file based storage are not going to work well in multi-server environments for example), just create a table to use as your storage. Then you can test rollout in your current environment and later easily migrate to Redis when ready.
Here's an example with Active Records in a Rails environment for example:
class KeyValueStore < ActiveRecord::Base
def set(key,value)
record = KeyValueStore.find_or_create_by_key(key)
record.update_attribute(:value,value)
record.save
end
def get(key)
record = KeyValueStore.find_by_key(key)
record.nil? ? nil : record.value
end
end
And the migration:
class CreateKeyValueStores < ActiveRecord::Migration
def change
create_table :key_value_stores do |t|
t.string :key
t.string :value
end
add_index :key_value_stores, :key
end
end
Then use your key value store when initializing your rollout object:
$kvstore = KeyValueStore.new
$rollout = Rollout.new($kvstore)
I'm going to close this, as clarification seems to have been made about this. If you have any other questions feel free to open an issue again.