The case I have is that I currently have 3 memcached instances running at 3 different servers. My application is currently at the same 3 different nodes. All the applications servers know of all the memcached servers, but if one of them goes down, I have no way of notice.
The idea is to move the memcached servers to own nodes.
I have begun to look at CouchBase as maybe an alternative of solving this, but are unsure of exactly it will work.
Will it work so that I have a CouchBase cluster, on each application node, and then connect them to the different memcached servers, and CouchBase will then monitor and know which ones is alive?
In that case, how does the application which are currently tied to the memcached instances know how to get the data if one of the memcached instances are down? Or is it CouchBase that will be the middle-man taking care of where to store it?
Couchbase is a very adaptive platform to use when replacing a standard memcached instance. It allows you to move a lot of fault tolerances from your application to the couchbase instances.
As you are using PHP, I recommend that you use the PHP SDK when accessing the Couchbase cluster. It can be obtained here: http://www.couchbase.com/develop/php/current
Now, the important thing to know is that the SDK for PHP is ‘vbucket aware’. What this means is that when you use it to connect to the Couchbase cluster it will gather all of the information for all of the nodes from the address you put into the constructor. For example:
This will create an object that you are able to run commands through that will, on it’s own, be able to handle all of the failovers should a node go down, etc that is required. Each language has it’s own little code processes (I generally use Python myself) but once you are familiar with them they are very effective.
The cluster can be managed through a command line interface or though a web URL by accessing
http://<nodehostname>:8091/. This is also the URL you will access to setup the initial cluster after installing it.I would highly recommend Couchbase as an alternative to standalone memcached.