Xmemcached is a Javanio based memcached client. It is thread-safe, simple in structure, supports all memcached text protocols and binary protocols, and has a relatively superior performance. It also supports advanced features such as JMX, dynamic additions and deletions, client statistics, and NIO connection pools. Infoq Chinese station editor interviewed the tool's core http://www.aliyun.com/zixun/aggregation/7155.html "> developer Dennis Zhuang.
The new version improvements include the following:
1, the introduction of the failure model, the so-called failure mode refers to when a memcached for various reasons is not available, the request sent to this node will throw an exception directly, rather than using the next available node. You can look at this document memached. Not enabled by default, enabling Failure mode is simple:
Memcachedclientbuilder builder= ...
Enable Failure mode.
Builder.setfailuremode (TRUE);
2. When failure mode is enabled, a backup node is allowed for each memcached, and when the primary node is hung out, the request is forwarded to the backup node, and the primary node is automatically switched to the master node after it is restored. Note that the prerequisite for setting up a backup node is to enable failure mode. Suppose we already have two memcached nodes: Host1:port and Host2:port, set up a backup node for Host1:port Host3:port can be implemented as:
Memcachedclientbuilder builder= New
Xmemcachedclientbuilder (Addrutil.getaddressmap ("Host1:port,host3:port host2:port"))
The primary-standby nodes are separated by commas, separated by spaces, and fully compatible with 1.2. And when the backup node connection is accidentally disconnected, xmemcached also automatically repairs the backup node's connection and joins the mapping.
3. Bug fixes and new features
Xmemcached Main Highlights:
1.Supports all memcached text based protocols and binary protocols (binary Kyoto Supports since version 1.2.0).
2.Supports distributed memcached with standard hash or consistent hash strategy
3.Supports for JMX to allow the behavior of the Xmemcachedclient.change the optimizer ' factor or add/ Remove memcached Server dynamically
4.Supports weighted server.
5.Supports Connection pool. Can create more 50x15 to one memcached server with Java NIO. (since version 1.2.0)
6.Supports failure mode and standby nodes.
7.Supports integrating to Spring framework and hibernate-memcached.
8.High configured.
9.Supports talking with Kestrel (an MQ written in Scala) and Tokyotyrant
Download Address:
Xmemcached-1.3.0-bin-with-dependencies.tar.gz xmemcached-1.3.0-src.tar.gz