1.What is Memcached ?
2.How to perform basic operations on Memcached like insert, retrieve and delete using Java client SpyMemcached.
3.Sample Java client to perform the operations on Memcached.

1.What is Memcached?
Memcached is an open source, high performance, distributed memory object caching system. intended to speed up dynamic web applications by reducing the database load. It is a key-value dictionary of strings, objects, etc, stored in the memory, resulting from database calls, API calls, or page rendering.

2.How to insert data into Memcached?
Insert a data/record into the Memcached using below method
memcachedClient.set(String key, String value);

2.1 How to retrieve data from Memcached ?
Retrieve a data/record from the Memcached using below method
getContentFromMemcache(String key);

2.2 How to delete data from Memcached ?
Delete a data/record from Memcached
memcachedClient.delete(String key);

3 Maven dependency :
<dependency>
<groupId>net.spy</groupId>
<artifactId>spymemcached</artifactId>
</dependency>

Below is the sample Java code to test one Memcached

Output -1 :
abc
null

Output -2 : for loop
key _0 – value_0
key _1 – value_1
key _2 – value_2
key _3 – value_3
key _4 – value_4
key _5 – value_5
key _6 – value_6
key _7 – value_7
key _8 – value_8
key _9 – value_9

Ref : Memcached.org