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

Already on GitHub? Sign in to your account

If you make the redis no longer required, what are you using instead to store the settings? #24

Closed
simkimsia opened this Issue Jan 10, 2013 · 8 comments

Comments

Projects
None yet
4 participants

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.

Contributor

ayrton commented Jan 28, 2013

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 jamesgolick#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 #22jamesgolick#22


Reply to this email directly or view it on GitHubhttps://github.com/jamesgolick/rollout/issues/24#issuecomment-12771164.

Contributor

ayrton commented Jan 28, 2013

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/jamesgolick/rollout/issues/24#issuecomment-12777248.

Contributor

ayrton commented Jan 29, 2013

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
金城

yacc commented Oct 3, 2013

@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)
Contributor

EricR commented May 2, 2014

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.

@EricR EricR closed this May 2, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment