简体   繁体   English

m子缓存中的内存存储和托管存储之间的区别

[英]Difference between in-memory-store and managed-store in mule cache

What are the main differences between in-memory-store and managed-store in mule cache scope and which gives a best performance. 在m子缓存范围中,内存中存储和托管存储之间的主要区别是什么,并且可以提供最佳性能。

What is the best way to configure caching in global scope? 在全局范围内配置缓存的最佳方法是什么?

We are currently using in-memory-store caching. 我们当前正在使用内存中的缓存。 We are always getting issues with memory outage as we are using a server with less HW configurations. 由于我们一直在使用硬件配置较少的服务器,因此总是遇到内存不足的问题。 We are using mule 3.7v. 我们正在使用m子3.7v。

Please provide your suggestions to configure cache in optimized way. 请提供建议,以优化方式配置缓存。

We are facing issue with cache expiration with in-memory-store. 我们面临着内存中的缓存过期的问题。 cache date is not being expunged after expiration time also. 过期时间后也不会清除缓存日期。 But when we use "managed-store" its working as expected. 但是,当我们使用“托管存储”时,其工作正常。 Below is my configuration: 下面是我的配置:

In-memory: This store the data inside system memory. 内存中:它将数据存储在系统内存中。 The data stored with In-memory is non-persistent which means in case of API restart or crash, the data been cached will be lost. 内存中存储的数据是非持久性的,这意味着在API重新启动或崩溃的情况下,已缓存的数据将丢失。

Managed-store: This stores the data in a place defined by ListableObjectStore. 托管存储:这将数据存储在ListableObjectStore定义的位置。 The data stored with Managed-store is persistent which means in case of API restart or crash, the data been cached will no be lost. 用托管存储存储的数据是持久性的,这意味着在API重新启动或崩溃的情况下,缓存的数据不会丢失。

Source (explained in detail with configuration difference): http://www.tutorialsatoz.com/caching-in-mule-cache-scope/ 来源(详细说明和配置差异): http : //www.tutorialsatoz.com/caching-in-mule-cache-scope/

One of my friend clearly explained me this difference as follows: 我的一位朋友清楚地向我解释了这种区别,如下所示:

in-memory cache--> It is a temperoy memory storage area where it will store the data. 内存缓存->这是一个节制的内存存储区,它将在其中存储数据。 for example: Consider using a VM component in Mule, the data will be stored in VM in the form of in-memory queue 例如:考虑在Mule中使用VM组件,数据将以内存队列的形式存储在VM中

in the case of Managed store--> we can store the data and use it in later stages. 对于“托管存储”->,我们可以存储数据并在以后的阶段中使用它。 example: object store 示例:对象存储

mainly cache will store the frequently used data. 主要是缓存将存储经常使用的数据。 It will reduce the db or http calls by saving the frequently used data or results in cache scope. 通过将常用数据或结果保存在高速缓存范围中,将减少db或http调用。

But both are for temporary storage only, means they are valid for that particular session alone. 但是两者都仅用于临时存储,这意味着它们仅对特定会话有效。

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

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