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

Accept ENV['MEMCACHE_URL'] #219

Conversation

seamusabshere
Copy link

hi Mike,

What do you think of accepting all of the configuration params in a single env var?

Redis has started doing it, Rails has done it for a while, and I just submitted a similar patch to mongo-ruby-driver.

Thanks!
Seamus

PS. Added lots of tests, existing tests pass
PPS. I made sure it doesn't do anything if the traditional MEMCACHE_SERVERS env var is set.

@mperham
Copy link
Collaborator

mperham commented May 20, 2012

Why is this necessary? I don't like it because a URL shouldn't have multiple hosts. I'd like a more specific reason why this type of hack is necessary.

@seamusabshere
Copy link
Author

Yah, Mongo has the same issue - I copied their solution.

I like the idea of configuring hosts, ports, and options from URL-like env var for various reasons, not least of which is doing what others are doing, but I agree it's not ideal for multiple hosts.

What it we did

MEMCACHE_SERVERS=[x,y,z]
MEMCACHE_URL="memcached://username:password@multiple:291"

and reserved the word "multiple"?

@mperham
Copy link
Collaborator

mperham commented May 21, 2012

I still don't see a reason aside from "Mongo does this" and "I like this style of config". multiple just adds another hack into the mix. Sorry but I don't think this is a good idea.

@mperham mperham closed this May 21, 2012
@mperham
Copy link
Collaborator

mperham commented May 21, 2012

And for the record, Redis / Mongo / RDBMS are usually single servers whereas memcached is frequently multiple servers. A URL maps to a single server well but not to multiple. That's one reason why I don't think this works well.

@maccman
Copy link

maccman commented Nov 30, 2013

+1

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.

None yet

3 participants