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

[question] Also usable with regular Memcached server? #37

Open
heidemn opened this issue Mar 13, 2021 · 0 comments
Open

[question] Also usable with regular Memcached server? #37

heidemn opened this issue Mar 13, 2021 · 0 comments

Comments

@heidemn
Copy link

heidemn commented Mar 13, 2021

Hi,

We have an application that we offer both on AWS and on-premises.
My question is, is it possible + advisable to use the Elasticache client with regular Memcached servers (for on-premises)?
= Is there any reason not to do so?
The advantage would be that we could build a single Docker image for both use cases.

I'm assuming it could possibly work like this, can you confirm?

Usage with Elasticache + autodiscovery:

$dynamic_client = new Memcached('persistent-id');
$dynamic_client->setOption(Memcached::OPT_CLIENT_MODE, Memcached::DYNAMIC_CLIENT_MODE);
$dynamic_client->addServer("mycluster.abcdef.cfg.use1.cache.amazonaws.com", 11211);

Usage with regular Memcached, on-premises:

$static_client = new Memcached('persistent-id');
$static_client->setOption(Memcached::OPT_CLIENT_MODE, Memcached::STATIC_CLIENT_MODE);
$static_client->addServer("memcached-container", 11211);

And, another question: Have you guys considered contributing your changes upstream to https://github.com/php-memcached-dev/php-memcached and https://github.com/libmemcached/libmemcached ?
I guess this would reduce the overhead and delay for you to support new PHP versions.
And for the users, it would simplify the installation, since the OS package manager can be used to install the client.

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

No branches or pull requests

1 participant