-1

I am storing a key value property using ehcache. This is used in a java program X. Now I am using another java program Y, where I want to use the same key value pair. I will read and may update the key value pair from any one of the two java programs X or Y. Both X, Y run at the same time.

summer
  • 139
  • 1
  • 10
  • If you use [memcached](http://memcached.org/) I think it'll be distributed, otherwise the two JVM instances do not directly share memory. – Elliott Frisch Aug 30 '15 at 23:00

2 Answers2

1

You could use distributed cache or ehcache replication. To start thinking what to choose you could read this. I am personaly prefer distributed cache, because it more flexible and easer to use. You just need to setup tsa server and configure caches to use server.

Zufar Muhamadeev
  • 3,085
  • 5
  • 23
  • 51
1

If you have two applications, you have two jvm and you have to use replication between the two ehcaches.

If you decide to apply replication to the ehcaches, here is a complete guide about it

http://www.ehcache.org/generated/2.9.0/pdf/Ehcache_Replication_Guide.pdf

BUT

I give you another solution, why not use a very fast, key value and big data database like REDIS.

http://redis.io/

It will be properly integrated with spring data into yours projects like a normal database and you will be able read and write very fast.

http://projects.spring.io/spring-data-redis/

try it!!

AntuanSoft
  • 343
  • 2
  • 9