Skip to content

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

@heidemn

Description

@heidemn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions