Simple understanding of Web caching Tools: Mamcache and Ehcache and terracotta __web

Source: Internet
Author: User
Tags memcached

A The extremely simple research summarizes the Web caching mechanism: Mamcache and Ehcache and terracotta:

After I mamcache:google, I found that more of the current uses are: Memcached Client for Java and spymemcached, and xmemcached, but in practice the Maven Jar Library was found to have no Mcached Client for Java support. The principle may be different, but it's not very complicated to use,

1. memcached Client for Java:

It can set a lot of parameters, feel more customization, flexible, such as:

You can set up multiple servers in the server to achieve distributed.

public static void Main (string[] args) {
/* Initialize Sockiopool, manage memcached connection pool * *
String[] Servers = {"192.168.1.20:12111"};
Sockiopool pool = sockiopool.getinstance ();
Pool.setservers (servers);
Pool.setfailover (TRUE);
Pool.setinitconn (10);
Pool.setminconn (5);
Pool.setmaxconn (250);
Pool.setmaintsleep (30);
Pool.setnagle (FALSE);
Pool.setsocketto (3000);
Pool.setalivecheck (TRUE);
Pool.initialize ();
/* Set up memcachedclient instance * *
Memcachedclient memcachedclient = new Memcachedclient ()

2. Spymemcached:

Google for a long time, also consulted the boss, found this thing, there are fewer parameters can be customized, such as:

memcachedclient mc = New memcachedclient (new inetsocketaddress (

"127.0.0.1", 11211));

future<boolean> B = null;

/* Set key value, Expiration Time (SEC) and object to be cached to memcached.

b = Mc.set ("Xsaxas", 900, "someobject");

if (B.get (). Booleanvalue () = = true) {

Mc.shutdown ();

}

Ii. EhCache: In Google Memacahe found in a, seemingly function is also very strong, there are special configuration files to configure parameters, not only can do the data cache on the database, but also cache the page, the page cache, speed up access, improve user experience, and then be ter Racotta acquisitions.

Iii. Terracotta: Boss recommended, can really support the distributed cache, the above Mancache can only save data to multiple servers, but Memecahe server data can not be shared, and this Terracotta can achieve multiple server shared cache phase The same data, Terracotta integrated the Ehcache function, there are a lot of other functions, has not been studied in detail.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.