Using Membase as a Memcached Server
I was attempting to find some answers on the Membase server. We are looking for several items that are contained in the membase server (such as replication / automatic failover). We have a cluster of approximately 12 severs, currently, we replicate to 6 of them and attempt to determine if they fail through heartbeat.
What we are attempting to do is simply utilize memcached but have replication to a peer that would be utilized and promoted to the master in the event that the connection to the primary server was downed.
Is this a valid use case for membase? It looks as if persistence was optional and we are looking to use it simply as a memcached server.
Membase is designed as an actual data-store, not a cache. While it would technically work in your environment, I don't know that it will behave quite as you wish.
However, we will soon be releasing extra functionality into membase that will allow for exactly what you want. It will let you define a "cache" type bucket within the same cluster and have it replicated and/or persisted to disk, but still act like a cache.
How does that sound?
Thanks for the interest!
Perry
Have you implemented the replication, failover detection and reloading within the client?
I believe that it would be useful for the cache bucket, would that support automatic failover? I believe that is really the key.
Replication is actually implemented directly within memcached with an updated repcached patch (1.4.4 compatibility). The failover is a little tricky, we haven't perfected it at all. Thoughts of using heartbeat or abstracting the client code to handle it (which is just the wrong way to do it). The only thing I foresee that would work well is actually utilizing a proxy client to handle this for us. I did see that NorthScale had a labs project called Moxi, however, just from reading I wasn't able to see anything specific to it.
Initially, failover will not be automatic, but that is definitely planned.
As far as Moxi, there is currently quite a bit of work going on to integrate it with membase functionality which will of course support failing over to replicas and such, but it does not do so currently.
Perry
FYI, to have a better idea of what I am talking about:
memcached1-1 replicates to memcached2-1
memcached1-2 replicates to memcached2-2
memcached2-3 replicates to memcached1-3
memcached2-4 replicates to memcached1-4
When memcached1-1 was unavailable for any reason memcached2-1 would be utilized and when memcached1-1 came back online and finished getting it's data back, it would be utilized again.
We mainly want to utilize this setup for both upgrades and failover support.