#3139

arpita21
Participant

What is Distributed cache and it’s application ?

The distributed cache works on small data file or libraries of code that may be accessed by all nodes in the cluster. When data is small you can put all your cache into single machine.
2 ways to put data into cache and access it –

1) Generic option parser :- In this case we can specify the cache file with the list of URLs as the argument of the file. The files that are specify via URL are already present in the filesystem and it is accessible by every machine in the cluster.

2) Distributed cache API :- In this case we use the method in the Driver class to add name of files which should be sent to all nodes to the system. We use DistributedCache.addCacheFile() to add the File and getLocalCacheFiles() use to retrieve the list of paths.

It is mainly used to store application data residing in database.

Prwatech