Using a membase cluster with replication but without data persistence
Hi,
We are considering using memcached as part of a solution we are designing at the moment.
While investigating the subject I came upon membase. Can I use the membase cluster to gain replication, all the 'hot swapping' and rebalancing features and all the other goodies without having to persist the data? Meaning, to turn off just the part that actually saves to disk.
Cheers,
DB
Thanks Geert-Jan for answering the question and contributing to the community.
Thanks for the response.
Been reading a bit more and couldn't quite answer for myself...
Say I have 3 nodes, for simplicity with 1 memcache bucket. Also, we are using some non-vbucket aware memcache client. let's go over a few scenarios:
-- First scenario: one of the nodes fails --
This would mean that all keys present on that node are lost since no replication is supported on memcache buckets. Correct?
Clients will continue working the same as before except that they will not find some keys and will need to fetch them from persistent stores or regenerate the data. Correct?
Clients that will attempt to set keys that should have gone on the dropped node will end up placing them on a different one or will the set key fail?
Will I need to perform a failover for the fallen node in order to continue supporting the entire key set?
In case I don't need to fail over, which component handles this actually? Server side moxis on one of the remaining nodes (assuming I am not using client side moxis)?
-- Second scenario: maintenance --
Now I want to bring one of the nodes offline for any reason (server restart etc). Is there a way for me to do this gracefully without losing the data on that node?
If I were to use a membase bucket instead, would I be able to fail over *before* I am taking the node offline?
Lastly, a different question... It's mentioned that the membase cluster allows the client to realize cluster configuration changes online without having to require client restart. Do I need to use a special client for that or is this complexity mitigated by the moxis?
Thanks,
DB
DB - responses inline to your questions:
-- First scenario: one of the nodes fails --
This would mean that all keys present on that node are lost since no replication is supported on memcache buckets. Correct?
[pk] - Correct
Clients will continue working the same as before except that they will not find some keys and will need to fetch them from persistent stores or regenerate the data. Correct?
[pk] - Correct
Clients that will attempt to set keys that should have gone on the dropped node will end up placing them on a different one or will the set key fail?
[pk] - With Memcached bucket types, the keys will end up being placed on a different server within the cluster.
Will I need to perform a failover for the fallen node in order to continue supporting the entire key set?
[pk] - "Failover" in the sense of memcached bucket types doesn't really mean anything. If a node goes away, the entire keyspace is still "valid" but its distribution will have changed a bit.
In case I don't need to fail over, which component handles this actually? Server side moxis on one of the remaining nodes (assuming I am not using client side moxis)?
[pk] - If you're going through the server-side Moxi then yes, they will handle the loss of a server and redistribute the keys. Which client library are you using? Depending on which one, it may perform it's own "failover/failback" when it detects a node has gone away.
-- Second scenario: maintenance --
Now I want to bring one of the nodes offline for any reason (server restart etc). Is there a way for me to do this gracefully without losing the data on that node?
[pk] - Not with Memcached bucket types.
If I were to use a membase bucket instead, would I be able to fail over *before* I am taking the node offline?
[pk] - The best practice would be to "remove" the server instead of fail it over. This will ensure that any replication has completed and all the data has been moved off of that node. Failing it over would immediately promote the replicas and you may lose some data that was "in flight". Failover is really only meant to be used on a server that has already failed.
Lastly, a different question... It's mentioned that the membase cluster allows the client to realize cluster configuration changes online without having to require client restart. Do I need to use a special client for that or is this complexity mitigated by the moxis?
[pk] - You can use a special client (the Enyim client for .NET supports this and the currently-Alpha-release of spymemcached does as well). However, if you're not using a "smart" client then you will HAVE to acces the cluster through Moxi (either client-side or server-side) and it handles the dynamic cluster configuration.
Say I have 3 nodes, for simplicity with 1 memcache bucket. Also, we are using some non-vbucket aware memcache client. let's go over a few scenarios:
-- First scenario: one of the nodes fails --
This would mean that all keys present on that node are lost since no replication is supported on memcache buckets. Correct?
Yes - you are right the node that fails will lose all data on it if it is using memcached buckets.
Clients will continue working the same as before except that they will not find some keys and will need to fetch them from persistent stores or regenerate the data. Correct?
Yes - You will miss cache and will have to get data from your persistent storage.
Clients that will attempt to set keys that should have gone on the dropped node will end up placing them on a different one or will the set key fail?
It should succeed, but just be on a different node.
Will I need to perform a failover for the fallen node in order to continue supporting the entire key set?
Yes
In case I don't need to fail over, which component handles this actually? Server side moxis on one of the remaining nodes (assuming I am not using client side moxis)?
-- Second scenario: maintenance --
Now I want to bring one of the nodes offline for any reason (server restart etc). Is there a way for me to do this gracefully without losing the data on that node?
No - if you use memcached only buckets.
If I were to use a membase bucket instead, would I be able to fail over *before* I am taking the node offline?
Yes
Lastly, a different question... It's mentioned that the membase cluster allows the client to realize cluster configuration changes online without having to require client restart. Do I need to use a special client for that or is this complexity mitigated by the moxis?
If you use a smart client or a client side moxi or server side moxi, you can achieve this.
Sure. Using the web-interface (http://localhost:8091 or similar) configure your bucket of type: memcached instead of membase. All rebalancing features remain, without persisting to disk
Cheers,
Geert-Jan