Elastic MemCache

What is Elastic Cache :

Elastic cache is a web service that makes it easy to manage and scale a distributed in memory cache environment in the cloud.

 

How it works:

Image

 

1.Configuraton with AWS console

2.Need to Configure the Elastic-Cache Cluster Client in the server.

   In order to take advantage of auto discovery .

 

3. Sample PHP application code.

 

 

 /**
  * Sample PHP code to show how to integrate with the Amazon ElastiCcache
  * Auto Discovery feature.
  * @author         Azeem
  */
       
function cache_test()
 {
           
echo “Hi ,This is elastic memcache clastering system sample<br>”;
$server_endpoint=’test-memcached.xxxxx.yyyyyy.zzzz.cache.amazonaws.com‘; //this is  elastic memcache
$server_port=11211; //this is the prot we have configured
$client =  new Memcached();
$client->addServer($server_endpoint, $server_port); //initializing the server configuration
$client->set(‘my_key’, ‘My Value is at   elastic memcache ‘.time()); //setting the key with value

echo ‘Data in the cluster: [‘ . $client->get(‘my_key’) . ‘]’; //getting the value

}

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s