简体   繁体   English

服务器模式下的Infinispan JPA CacheStore

[英]Infinispan JPA CacheStore in server mode

Need to front an existing DataStore (RDBMS) with infinispan, with write-behind. 需要使用infinispan在现有DataStore(RDBMS)的前面,并在后面进行写操作。 Also we dont want to run Infinispan in embedded mode to avoid memory pressure on the existing application which needs to serve high volume. 同样,我们也不想在嵌入式模式下运行Infinispan,以避免对需要处理大量数据的现有应用程序造成内存压力。 We would like to run a cluster of infinispan in server mode and connect our application using hotrod. 我们想在服务器模式下运行infinispan集群,并使用hotrod连接我们的应用程序。

Since JDBCStore doesnt support custom schema, the only option is to use JPA based CacheStore, however looks like there is limitation of only allowing JPA store to work in embedded mode .. Is there any workaround ? 由于JDBCStore不支持自定义架构,因此唯一的选择是使用基于JPA的CacheStore,但是看起来只允许JPA存储在嵌入式模式下工作是有局限性的。是否有解决方法?

The tricky part of using JPA cache store with server is how to plug user classes into the server. 将JPA高速缓存存储与服务器一起使用的棘手部分是如何将用户类插入服务器。 This is necessary since JPA entities/collections need to be accessible for JPA cache store. 这是必需的,因为JPA缓存存储区需要访问JPA实体/集合。 It might be possible to do this by creating a module and plugging it into the server modules and having Infinispan JPA cache store modules depend on it. 通过创建一个模块并将其插入服务器模块,并使Infinispan JPA缓存存储模块依赖于此模块,可以实现此目的。 This might be doable but not something we encourage/support and requires deep understanding of Infinispan Server's module architecture. 这可能是可行的,但我们不鼓励/不支持,并且需要深入了解Infinispan Server的模块架构。

My suggestion would be to stick to embedded use case and JPA cache store. 我的建议是坚持使用嵌入式用例和JPA缓存存储。 To avoid memory issues, you could configure eviction so that only those recently used entries are kept in memory. 为避免出现内存问题,您可以配置逐出,以便仅将那些最近使用的条目保留在内存中。 You could also use off-heap container in Infinispan to offload data storage outside the heap and keep your application running smoothly. 您还可以在Infinispan中使用堆外容器来卸载堆外的数据存储,并使应用程序平稳运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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