-1

I know this is a subjective question, I tried to google out, and went through the documention of different cache providers such as ehcache etc.

Use Case/ Problem Statment: An application(cache application) which will be in different VM of the server, and multiple applications such as Application A, B, C resides in different VM, can communicate to the cache application similar to the concept of Sqlfire/gmfire i.e in memory cache.

Approach: Note: Considering the requirment, I don't wanna to make use of existing cache mechanisms such mmcache,ehaceh and etc,

Could you please give some idea from where I should start such as:

1-Make use of HashMap/ConcurrentHashMap will be correct approach for this or not? 2-How I can achieve diffrent VMs communicating 3-Some best practice I should follow as a beginer. 4-went thorugh various questions posted here one of the such link is Develop in Memory Object Cache

Still in confuse how I can achieve different VMs talking to this cache VM.

I may not be clear enough to put the rough idea I am thinking of, Please let me know if you require further clarifications.

Community
  • 1
  • 1
Jayaram
  • 1,715
  • 18
  • 30

1 Answers1

1

Different VM's communicating with each other, you can use RMI, Web-Services, Rest-Services. Using RMI, you will be bound to use Java as the other communicating party. Whereas, web-service and rest-web-services will give you the advantage of using .NET, Java or other as cache clients.

For a start:

Use of collections, you can go with ConcurrentHashMap if you have a lot of read and writes, this will still be better performing.

You should consider following more params:

  • memory management
  • elements aging
  • eviction policies

But reinventing the wheel is not a good idea if there is nothing different or better to deliver.

You also need to consider, the cache app doesn't run out of memory, because of too much caching.

Himanshu Bhardwaj
  • 4,038
  • 3
  • 17
  • 36