Can anyone explain how Memcached (Read and Write Operation) works Couchbase cluster environment? I have read several articles and bit confused Memcached and Couchbase thing.
@manochpriyankara The memcached bucket is plain old memcached. So no internal replication , no persists to disk , no N1QL(SQL) queries on JSON data and no XDCR to another data center.
Why use memcached bucket then?
Maybe you need to use it as tmp data store with TTL(expires) of a few seconds or minutes.
But househippo I want the above features but no persist to disk.
In upcoming CB 5.0 release we have a new bucket type called ephemeral which does exactly that. SQL , XDCR , inter cluster replication but doesn’t write to disk. You can get a Beta of 5.0 here https://www.couchbase.com/downloads#couchbase-server
@househippo Thanks for the quick reply. I have one question. How Memcached bucket distributed data? Is it same like a vbucket mechanism?
The memcached bucket is not that smart. It dose the below. So if you have 5 nodes in a cluster it will hash between the 5 nodes. But if you lose a node and only have 4 nodes the CRC32 will rehash to the 4 nodes only.
serverId = crc32(key) % servers.size