简体   繁体   中英

Is there a way to save data in a Java EE application without database?

Do you know of a Java EE compliant way to hold data (let's say a couple of key-value pairs) in a Java EE application without using a database? The solution should be usable in a cluster. I know about the concepts of data grids (eg Infinispan in JBoss), but i'd prefer a solution where the application does not depend on a specific application server (JCache would be great, for example, but as far i understood it, that is only usable as local cache with Infinispan, not as distributed cache).

So is it possible, for example, to save data somehow with CDI (maybe in context @ApplicationScoped)? If yes, could you describe, how?

EDIT: Thank you for all your answers. All of them right now recommend me to use certain frameworks. But isn't there a way just with the Java EE stack to do sth. like this?

If I understand your use case correctly, this is doable with Infinispan and additionally this is one of the basic Infinispan usages. Your application will not depend on any application server while using embedded libraries and Infinispan is capable of creating cluster in that embedded mode.

Please, see this question and my answer to it, I hope this can help and put some light on your question as well: Infinispan Operational modes

I think what you are searching for are called in-memory data grids . Take a look on Hazelcast for example.

You should be careful though and store data explicitly if it is important (most of the time these are used for boost caching).

I don't know the terms even in the question. But, What about using XML as data store?
This can be shared as well.

我认为可以使用Oracle Coherence API

尝试使用Terracotta中的Bigmemory,它提供内存数据缓存,并在群集世界中表现出色。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM