Amazon
ElastiCache
Amazon ElastiCache is a web
service that makes it easy to deploy, operate, and scale an
in-memory cache in the cloud.
The service improves the performance
of web applications by allowing you to retrieve information from a
fast, managed, in-memory caching system, instead of relying entirely
on slower disk-based databases.
Amazon ElastiCache is
protocol-compliant with Memcached, a widely adopted memory
object caching system.
There are several merits of
using elastic catch. There are, simple to deploy , easily managed ,
compatible , designed for use with other Amazon Web Services , secure
and cost effective.
Amazon
ElastiCache Functionality:
- Use the Amazon ElastiCache APIs to launch a Cache Cluster selecting a Cache Cluster Name, Cache Node Type and Number of Nodes that best meets our needs.
- Connect to your Cache Nodes using your favorite Memcached clients or Programming language.
- Get detailed monitoring statistics of our Cache Nodes for no additional charge via Amazon CloudWatch.
- If at any point we need additional capacity, we can add more Cache Nodes to our Cache Cluster with a simple API call.
- Pay only for the resources you actually consume, based on our Cache Node hours used.
Features:
- Pre-configured Parameters
- Automatic failure detection and recovery
- Detailed Monitoring and Metrics
- Automatic Software Patching
- Push-Button Scaling
Amazon
ElastiCache Cache Node Types:
- Micro
- Standard
- Enhanced
- High-Memory
- High-CPU
Lets see a sample Java Code for this implementation,
import net.spy.memcached.MemcachedClient;
import java.net.InetSocketAddress;
import java.io.IOException;
/**
*
* @author Raghu
*/
public class ElastiCache {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
try {
//127.0.0.1 - machine's ip
//11211 - port in which memcache server running
MemcachedClient c = new MemcachedClient(new InetSocketAddress("cachetest.7hpjru.cfg.use1.cache.amazonaws.com", 11211));
///MemcachedClient c = new MemcachedClient(new InetSocketAddress("cachetest.7hpjru.0001.use1.cache.amazonaws.com", 11211));
String s = "ElastiCache";
c.set("someKey", 3600, s);
Object myObject = c.get("someKey");
System.out.println("\n myobject---->" + myObject.toString());
//c.delete("someKey");
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
No comments:
Post a Comment