<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Aura – mongodb</title>
    <link>/tags/mongodb/</link>
    <description>Recent content in mongodb on Aura</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    
	  <atom:link href="/tags/mongodb/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Docs: </title>
      <link>/docs/components/aura-redis-mongo-sync/environment-variables/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/components/aura-redis-mongo-sync/environment-variables/</guid>
      <description>
        
        
        &lt;h1 id=&#34;aura-redis-mongo-synchronizer-environment-variables&#34;&gt;Aura Redis Mongo Synchronizer environment variables&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;Notation&lt;/strong&gt;&lt;/p&gt;


&lt;div class=&#34;pageinfo pageinfo-primary&#34;&gt;
&lt;p&gt;List of environment variables defined for &lt;strong&gt;aura-redis-mongo-sync&lt;/strong&gt; component&lt;/p&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Properties marked in &lt;strong&gt;bold&lt;/strong&gt; are mandatory.&lt;/li&gt;
&lt;li&gt;Properties marked in &lt;em&gt;italics&lt;/em&gt; are optional.&lt;/li&gt;
&lt;/ul&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Property&lt;/th&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Modifiable by OB?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_LOGGING_EXTRA_TIME_METRICS&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Boolean&lt;/td&gt;
&lt;td&gt;Extra time metrics for logging. By default: &lt;code&gt;false&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_LOGGING_LEVEL&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;Level to be used in monitoring logs, from more to less verbose: &lt;code&gt;&#39;TRACE&#39;, &#39;DEBUG&#39;, &#39;INFO&#39;, &#39;WARN&#39;, &#39;ERROR&#39;, &#39;FATAL&#39;, &#39;OFF&#39;&lt;/code&gt;. By default: &lt;code&gt;INFO&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_MONGODB_BOT_COLLECTION_CACHES_INDEX_TTL&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Lifetime, in seconds, for the index of the caches collection. By default: &lt;code&gt;3600&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No. Only if validated with Aura Global team, because it is related to other values.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_MONGODB_BOT_COLLECTION_CONTEXT&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;Name of the collection where the context is stored. By default: &lt;code&gt;aura-context&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_MONGODB_BOT_DATABASE&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;Name of the database where the bot collections are stored. By default: &lt;code&gt;aura-bot&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AURA_MONGODB_PASSWORD&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;Password of the user that accesses MongoDB.&lt;/td&gt;
&lt;td&gt;No. Only if MongoDB credentials must be changed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_MONGODB_POOL_SIZE&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Pool size of the MongoDB. By default: &lt;code&gt;60&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_MONGODB_SSL&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Boolean&lt;/td&gt;
&lt;td&gt;Flag to indicate if MongoDB connection uses SSL or not. By default: &lt;code&gt;true&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AURA_MONGODB_URI&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;URI of the MongoDB&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AURA_MONGODB_USERNAME&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;Username of the MongoDB&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_CONFIGURATION_PREFIX&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;Prefix for Redis configuration keys. By default: &lt;code&gt;aura-config:&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_CONTEXT_CACHE_PREFIX&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;Prefix for Redis context cache keys. By default: &lt;code&gt;context:&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_SUBSCRIPTIONS_EVENTS&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;Comma-separated list of the types of Redis messages to trigger subscriptions events. By default: &lt;code&gt;expired,evicted&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_CONTEXT_CACHE_SHADOW_KEY_PREFIX&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;Prefix for Redis shadow key cache keys. By default: &lt;code&gt;shadow-key:&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_CONTEXT_CACHE_ACTIVE_CONTEXT_PREFIX&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;Prefix for Redis active context cache keys. By default: &lt;code&gt;active-context:&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_CONTEXT_CACHE_LOCK_PREFIX&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;Prefix for Redis lock context cache keys. By default: &lt;code&gt;lock-context:&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_CONTEXT_CACHE_MIN_SHARD_BY_NODE&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Number of minimal shards assigned to a service. By default: &lt;code&gt;1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_CONTEXT_CACHE_CHECK_INDEX_SHARD_INTERVAL&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Number of seconds to wait before recalculate shards to subscribe events. By default: &lt;code&gt;60&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_CONTEXT_CACHE_CHECK_UNPROCESSED_INTERVAL_MIN&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Minimum number of seconds to wait before checking unprocessed contexts. By default: &lt;code&gt;10&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_CONTEXT_CACHE_CHECK_UNPROCESSED_INTERVAL_MAX&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Maximum number of seconds to wait before checking unprocessed contexts. By default: &lt;code&gt;120&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_CONTEXT_CACHE_CHECK_UNPROCESSED_FACTOR&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Factor to increment or decrement interval to check unprocessed contexts. By default: &lt;code&gt;1.1&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_CONTEXT_CACHE_UNPROCESSED_RANGE&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Number of unprocessed contexts to check by turn. By default: &lt;code&gt;10&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_CONTEXT_CACHE_UNPROCESSED_RANGE_FACTOR&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Factor to divide the unprocessed range. By default: &lt;code&gt;5&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AURA_REDIS_CONTEXT_CACHE_SHARD_COUNT&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Number of shards to generate lists for storing unprocessed context. For performance reasons, it is important to configure the same number as the number of pods of the &lt;em&gt;&lt;strong&gt;aura-redis-mongo-synchronizer&lt;/strong&gt;&lt;/em&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_CONTEXT_CACHE_TTL&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Time in seconds to store a context in cache. By default: &lt;code&gt;60&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_LOCK_CONTEXT_CACHE_TTL&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Time in seconds to store a lock context in cache. By default: &lt;code&gt;60&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_MODE&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;Mode of Redis distribution. Values: &lt;code&gt;Cluster&lt;/code&gt;, &lt;code&gt;Sentinel&lt;/code&gt; or &lt;code&gt;Single&lt;/code&gt;. By default: &lt;code&gt;Single&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AURA_REDIS_PREFIX&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;Prefix that will be used by all Redis keys when using redis-connector. This allows mixing in a single Redis service messages coming from different environments in the same Azure subscription.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AURA_REDIS_SENTINEL_INSTANCE_NAME&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;Name of the Redis instance. Used in &lt;code&gt;Sentinel&lt;/code&gt; mode.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AURA_REDIS_HOSTS&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;A string with a list of nodes (host:port) separated by comma. For example: &amp;ldquo;localhost:port,localhost2:port2&amp;rdquo;. Default: &amp;lsquo;127.0.0.0:6379&amp;rsquo;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_DATABASE&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Database number for Single or Sentinel mode. By default: &lt;code&gt;0&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AURA_REDIS_PASSWORD&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;A string with the password of Redis.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_MAX_RECONNECT_RETRIES&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Number of retries to connect to Redis. By default: &lt;code&gt;25&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_MAX_RECONNECT_INTERVAL&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Time in milliseconds to wait before reconnecting to Redis. By default: &lt;code&gt;5000&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_USE_CONNECTION_POOL&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Boolean&lt;/td&gt;
&lt;td&gt;Flag to indicate to use a connection pool for Redis connections. Default: &lt;code&gt;true&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_CONNECTION_POOL_MIN&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Minimum number of connections in the pool. Default: &lt;code&gt;2&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REDIS_CONNECTION_POOL_MAX&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Maximum number of connections in the pool. Default: &lt;code&gt;100&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_REQUEST_TIMEOUT&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Number of seconds to wait a request. By default: &lt;code&gt;30 * 1000&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_SERVER_PORT&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Port where the server will be listening. By default: &lt;code&gt;8989&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_SERVER_RETRIES&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Number of retries made by the server in case of error in an HTTP request. By default: &lt;code&gt;3&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_SERVER_RETRY_DELAY&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Delay between retries in case of error. By default: &lt;code&gt;100&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_SERVER_RETRY_FACTOR&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Factor to multiply delay for every HTTP request retried. By default: &lt;code&gt;10&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_SERVICE_ENVIRONMENT&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Type of environment: &lt;code&gt;&#39;DEV&#39;, &#39;PRE&#39;, &#39;PRO&#39;&lt;/code&gt;. By default, &lt;code&gt;DEV&lt;/code&gt;. It is used during locale translation, to get the correct text reference.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;AURA_SHUTDOWN_GRACEFUL_TTL&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Number&lt;/td&gt;
&lt;td&gt;Time in milliseconds to complete the SHUTDOWN signal and p process all the messages in queue before SIGTERM. By default: &lt;code&gt;25 * 1000&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AURA_VERSION&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;Aura version. It is set by the deployment process.&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

      </description>
    </item>
    
    <item>
      <title>Docs: </title>
      <link>/docs/components/aura-bot-platform/aura-bot-components/bot-databases/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/components/aura-bot-platform/aura-bot-components/bot-databases/</guid>
      <description>
        
        
        &lt;h1 id=&#34;aura-bot-databases&#34;&gt;Aura Bot databases&lt;/h1&gt;


&lt;div class=&#34;pageinfo pageinfo-primary&#34;&gt;
&lt;p&gt;Description of databases used by Aura Bot&lt;/p&gt;

&lt;/div&gt;

&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Currently, &lt;em&gt;&lt;strong&gt;aura-bot&lt;/strong&gt;&lt;/em&gt; uses two databases, described below:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Mongo DB&lt;/li&gt;
&lt;li&gt;Redis + MongoDB&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;mongodb&#34;&gt;MongoDB&lt;/h2&gt;
&lt;p&gt;In order to reuse the code, and clarify the development, all classes related with MongoDB connections are stored in the &lt;a href=&#34;https://github.com/Telefonica/aura-bot-platform/blob/master/src/mongodb-storage.ts&#34;&gt;&lt;code&gt;mongodb-storage.ts&lt;/code&gt;&lt;/a&gt; file within &lt;code&gt;aura-bot-platform&lt;/code&gt; repository.&lt;/p&gt;
&lt;p&gt;Here it can be found generic &amp;ldquo;connection&amp;rdquo; class, that is &lt;code&gt;mongodb-connection.ts&lt;/code&gt;, that will handle the connection request, pooling them
and configuring according the configuration (&lt;code&gt;config&lt;/code&gt; is mandatory when initializing).&lt;/p&gt;
&lt;p&gt;We can find also several &amp;ldquo;DAO&amp;rdquo; files, that will couple with a specific MongoDB database and collection, and will create optionally
indexes or any other thing required in a specific domain.&lt;/p&gt;
&lt;h3 id=&#34;mongodbconnection&#34;&gt;MongoDbConnection&lt;/h3&gt;
&lt;p&gt;There will be only one instance of &lt;code&gt;MongoDbConnection&lt;/code&gt;, creating it in the first call to &lt;code&gt;getInstance&lt;/code&gt; (requiring &lt;code&gt;config&lt;/code&gt; param) and
returning the same instance in subsequent calls (where the config param is not required).&lt;/p&gt;
&lt;p&gt;To create the instance properly, the following configuration variables are used:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Var name&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Required/Optional&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;AURA_MONGODB_URI&lt;/td&gt;
&lt;td&gt;URI to connect to MongoDB, for example &lt;em&gt;mongodb://localhost:27017/?authSource=admin&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_MONGODB_USERNAME&lt;/td&gt;
&lt;td&gt;User name to authenticate connection to MongoDB&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_MONGODB_PASSWORD&lt;/td&gt;
&lt;td&gt;Password to authenticate connection to MongoDB&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_MONGODB_POOL_SIZE&lt;/td&gt;
&lt;td&gt;MongoDB pool size&lt;/td&gt;
&lt;td&gt;Optional &lt;em&gt;(Default: 10)&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_MONGODB_SSL&lt;/td&gt;
&lt;td&gt;Use SSL or not when connecting to MongoDB&lt;/td&gt;
&lt;td&gt;Optional &lt;em&gt;(Default: false)&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This singleton module should be loaded the first time automatically by the system, and then could be accessed just by calling &lt;code&gt;getInstance&lt;/code&gt;
method, like:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;connection&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;await&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;MongoDbConnection&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;getInstance&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;db&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;connection&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;dbConnect&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;DATABASE&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;collection&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;db&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;collection&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;COLLECTION&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;mongodbstorage&#34;&gt;MongoDbStorage&lt;/h3&gt;
&lt;p&gt;This DAO class will be used by Bot Builder v4 to store the conversation and user data. An index is created to delete documents older than 24
hours (specified by config var &lt;code&gt;AURA_MONGODB_BOT_COLLECTION_CONTEXT_INDEX_TTL&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Following config variables are used to initialize this class:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Var name&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Required/Optional&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;AURA_MONGODB_BOT_DATABASE&lt;/td&gt;
&lt;td&gt;Database name where the documents will be stored&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_MONGODB_BOT_COLLECTION_CONTEXT&lt;/td&gt;
&lt;td&gt;Collection name where the documents will be stored&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_MONGODB_BOT_COLLECTION_CONTEXT_INDEX_TTL&lt;/td&gt;
&lt;td&gt;Time (in seconds) that will exist the documents without updates, before being deleted&lt;/td&gt;
&lt;td&gt;Optional &lt;em&gt;(Default: 86440)&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;To create and initialize a MongoDbStorage, a code like following could be used:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;storage&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;await&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;MongoDbStorage&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;().&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;init&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;configuration&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;cache-module&#34;&gt;Cache module&lt;/h3&gt;
&lt;p&gt;The &lt;em&gt;&lt;strong&gt;cache module&lt;/strong&gt;&lt;/em&gt; allows the generation of different types of cache:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;AuraCacheLocal&lt;/code&gt;: only used for local data.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AuraCacheRemote&lt;/code&gt;: only used for remote data.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AuraCacheRemoteLocal&lt;/code&gt;: used for remote and local data, with priority for remote.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;AuraCacheLocalRemote&lt;/code&gt;: used for local and remote data, with priority for local.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;how-to-use-cache-module&#34;&gt;How to use cache module&lt;/h4&gt;
&lt;p&gt;It is possible to use any of the caches through the following commands:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-typescript&#34; data-lang=&#34;typescript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// cache local.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheLocal&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;AuraCacheLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;nameCacheLocal&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// cache remote.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheRemote&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;AuraCacheRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;nameCacheRemote&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// cache local-remote
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheLocalRemote&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;AuraCacheLocalRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;nameCacheLocalRemote&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// cache remote-local.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheRemoteLocal&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;AuraCacheRemoteLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;nameCacheRemoteLocal&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;variables-for-auracachelocal&#34;&gt;Variables for AuraCacheLocal&lt;/h4&gt;
&lt;p&gt;Only for local cache (&lt;code&gt;AuraCacheLocal&lt;/code&gt;), it is possible to define a series of options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;stdTTL&lt;/strong&gt;: standard TTL as number in seconds for every generated cache element. By default, &lt;code&gt;0&lt;/code&gt; (0 = unlimited).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;compressedData&lt;/strong&gt;: data is to be compressed in remote cache. By default, &lt;code&gt;false&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;deleteOnExpire&lt;/strong&gt;: boolean value that indicates whether variables will be deleted automatically when they expire or not. If &lt;code&gt;true&lt;/code&gt;, the variable will be deleted. If &lt;code&gt;false&lt;/code&gt;, the variable will remain. By default, &lt;code&gt;true&lt;/code&gt;. You are encouraged to handle the variable upon the event expired by yourself.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-typescript&#34; data-lang=&#34;typescript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;options&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;{&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;stdTTL&lt;/span&gt;: &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;100&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;encryptData&lt;/span&gt;: &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;true&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheLocal&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;AuraCacheLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;nameCacheLocal&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;options&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;store-a-key&#34;&gt;Store a key&lt;/h4&gt;
&lt;p&gt;The following code sets a key value pair. It is possible to define a TTL (in seconds).
It returns &lt;code&gt;true&lt;/code&gt; on success.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-typescript&#34; data-lang=&#34;typescript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheLocal&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;AuraCacheLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;nameCacheLocal&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;auraCacheLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;set&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;value&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheRemote&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;AuraCacheRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;nameCacheRemote&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;await&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;set&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;value&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;1800&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt; &lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// -&amp;gt; data expire at 30m.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;retrieve-a-key&#34;&gt;Retrieve a key&lt;/h4&gt;
&lt;p&gt;The following code gets a saved value from the cache.
It returns &lt;code&gt;undefined&lt;/code&gt; if the value is not found or has expired. If the value is found, it returns an object with the corresponding key value pair.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-typescript&#34; data-lang=&#34;typescript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheLocal&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;AuraCacheLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;nameCacheLocal&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;auraCacheLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;set&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;value&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;auraCacheLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;get&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt; &lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// -&amp;gt; value.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheRemote&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;AuraCacheRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;nameCacheRemote&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;await&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;set&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;value&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;await&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;get&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt; &lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// -&amp;gt; value.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For caches such as &lt;code&gt;AuraCacheLocalRemote&lt;/code&gt; and &lt;code&gt;AuraCacheRemoteLocal&lt;/code&gt;, it is possible to force it to obtain data different from the priority:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-typescript&#34; data-lang=&#34;typescript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// cache local-remote
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheLocalRemote&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;AuraCacheLocalRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;nameCacheLocalRemote&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;await&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheLocalRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;set&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;value&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;await&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheLocalRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;getRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt; &lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// -&amp;gt; value.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;auraCacheRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;getLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// cache remote-local.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheRemoteLocal&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;AuraCacheRemoteLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;nameCacheRemoteLocal&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;await&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheRemoteLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;set&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;value&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;auraCacheRemoteLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;getLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt; &lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// -&amp;gt; value.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;await&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheRemoteLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;getRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt; &lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// -&amp;gt; value.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;delete-a-key&#34;&gt;Delete a key&lt;/h4&gt;
&lt;p&gt;The following code deletes a key. It returns the number of deleted entries. A delete will never fail.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-typescript&#34; data-lang=&#34;typescript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheLocal&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;AuraCacheLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;nameCacheLocal&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;auraCacheLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;set&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;value&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;auraCacheLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;get&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt; &lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// -&amp;gt; value.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;auraCacheLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;del&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt; &lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// -&amp;gt; 1.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;auraCacheLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;get&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt; &lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// -&amp;gt; undefined.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheRemote&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;AuraCacheRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;auraCacheRemote&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;await&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;set&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;value&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;await&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;get&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt; &lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// -&amp;gt; value.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;await&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;del&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt; &lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// -&amp;gt; 1.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;await&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;get&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt; &lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// -&amp;gt; undefined.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;flush-all-data&#34;&gt;Flush all data&lt;/h4&gt;
&lt;p&gt;The following code deletes all data from a store.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-typescript&#34; data-lang=&#34;typescript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheLocal&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;AuraCacheLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;nameCacheLocal&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;auraCacheLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;set&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;value&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;auraCacheLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;get&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt; &lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// -&amp;gt; value.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;auraCacheLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;flush&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;();&lt;/span&gt; &lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// -&amp;gt; true.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;auraCacheLocal&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;get&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt; &lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// -&amp;gt; undefined.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheRemote&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;AuraCacheRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;auraCacheRemote&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;await&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;set&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;value&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;await&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;get&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt; &lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// -&amp;gt; value.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;await&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;flush&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;();&lt;/span&gt; &lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// -&amp;gt; true.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;await&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraCacheRemote&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;get&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt; &lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;// -&amp;gt; undefined.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;redis--mongodb&#34;&gt;Redis + MongoDB&lt;/h2&gt;
&lt;p&gt;If the configuration variable &lt;code&gt;AURA_BOT_CONTEXT_DATABASE&lt;/code&gt; is set to &lt;code&gt;REDIS-MONGODB&lt;/code&gt;, &lt;em&gt;&lt;strong&gt;aura-bot&lt;/strong&gt;&lt;/em&gt; uses a two-level cache to store the context through &lt;a href=&#34;../../docs/components/aura-redis-mongo-sync/&#34;&gt;Aura Redis Mongo Synchronizer&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The following environment variables must be set for the two databases.&lt;/p&gt;
&lt;h3 id=&#34;variables&#34;&gt;Variables&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Var name&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Required/Optional&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;AURA_MONGODB_BOT_COLLECTION_CONTEXT&lt;/td&gt;
&lt;td&gt;Name of the collection where the context is stored. By default: &lt;code&gt;aura-context&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_MONGODB_BOT_DATABASE&lt;/td&gt;
&lt;td&gt;Name of the database where the bot collections are stored. By default: &lt;code&gt;aura-bot&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_MONGODB_PASSWORD&lt;/td&gt;
&lt;td&gt;Password of the MongoDB. Required&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_MONGODB_POOL_SIZE&lt;/td&gt;
&lt;td&gt;Pool size of the MongoDB. By default: &lt;code&gt;60&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_MONGODB_SSL&lt;/td&gt;
&lt;td&gt;Boolean value indicating if MongoDB connection uses SSL or not. By default: &lt;code&gt;true&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_MONGODB_URI&lt;/td&gt;
&lt;td&gt;URI of the MongoDB&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_MONGODB_USERNAME&lt;/td&gt;
&lt;td&gt;Username of the MongoDB&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_REDIS_CONFIGURATION_PREFIX&lt;/td&gt;
&lt;td&gt;Prefix for Redis configuration keys. By default: &lt;code&gt;aura-config:&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_REDIS_CONTEXT_CACHE_PREFIX&lt;/td&gt;
&lt;td&gt;Prefix for Redis context cache keys. By default: &lt;code&gt;context:&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_REDIS_CONTEXT_CACHE_SHADOW_KEY_PREFIX&lt;/td&gt;
&lt;td&gt;Prefix for Redis shadow key cache keys. By default: &lt;code&gt;shadow-key:&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_REDIS_CONTEXT_CACHE_ACTIVE_CONTEXT_PREFIX&lt;/td&gt;
&lt;td&gt;Prefix for Redis active context cache keys. By default: &lt;code&gt;active-context:&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_REDIS_CONTEXT_CACHE_SHARD_COUNT&lt;/td&gt;
&lt;td&gt;Number of shards to generate lists for storing unprocessed context.&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_REDIS_CONTEXT_CACHE_TTL&lt;/td&gt;
&lt;td&gt;Time in seconds to store a context in cache. By default: &lt;code&gt;60&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_REDIS_MODE&lt;/td&gt;
&lt;td&gt;Mode of Redis distribution (&lt;code&gt;Cluster&lt;/code&gt;, &lt;code&gt;Sentinel&lt;/code&gt; or &lt;code&gt;Single&lt;/code&gt;). By default: &lt;code&gt;Single&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_REDIS_PREFIX&lt;/td&gt;
&lt;td&gt;Prefix that will be used by all redis keys when using redis-connector. This allow mixing in a single redis service messages coming from different environments in the same Azure subscription.&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_REDIS_SENTINEL_INSTANCE_NAME&lt;/td&gt;
&lt;td&gt;Name of the Redis instance. Use in sentinel mode.&lt;/td&gt;
&lt;td&gt;Optional&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_REDIS_HOSTS&lt;/td&gt;
&lt;td&gt;A string with list of nodes (host:port) separate by comma. For example: &amp;ldquo;localhost:port,localhost2:port2&amp;rdquo;. Default: &amp;lsquo;127.0.0.0:6379&amp;rsquo;&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_REDIS_DATABASE&lt;/td&gt;
&lt;td&gt;Database number for &lt;code&gt;Single&lt;/code&gt; or &lt;code&gt;Sentinel&lt;/code&gt; mode. By default: &lt;code&gt;0&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_REDIS_PASSWORD&lt;/td&gt;
&lt;td&gt;A string with the password of Redis.&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_REDIS_MAX_RECONNECT_RETRIES&lt;/td&gt;
&lt;td&gt;Number of retries to connect to Redis. By default: &lt;code&gt;25&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_REDIS_MAX_RECONNECT_INTERVAL&lt;/td&gt;
&lt;td&gt;Time in milliseconds to wait before reconnecting to Redis. By default: &lt;code&gt;5000&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_REDIS_USE_CONNECTION_POOL&lt;/td&gt;
&lt;td&gt;Used connection pool for Redis connections. Default: &lt;code&gt;true&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_REDIS_CONNECTION_POOL_MIN&lt;/td&gt;
&lt;td&gt;Minimum number of connections in the pool. Default: &lt;code&gt;2&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AURA_REDIS_CONNECTION_POOL_MAX&lt;/td&gt;
&lt;td&gt;Maximum number of connections in the pool. Default: &lt;code&gt;100&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

      </description>
    </item>
    
    <item>
      <title>Docs: </title>
      <link>/docs/components/aura-redis-mongo-sync/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/components/aura-redis-mongo-sync/</guid>
      <description>
        
        
        &lt;h1 id=&#34;aura-redis-mongo-synchronizer-arms&#34;&gt;Aura Redis Mongo Synchronizer (ARMS)&lt;/h1&gt;


&lt;div class=&#34;pageinfo pageinfo-primary&#34;&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;aura-redis-mongo-synch&lt;/strong&gt;&lt;/em&gt; (&lt;strong&gt;ARMS&lt;/strong&gt;) is a service that allows the use of Redis and MongoDB to create a Bot Framework Context management as a two-level cache.&lt;br&gt;
Find in the current documents the description of this component, its architecture, components and processes.&lt;/p&gt;
&lt;p&gt;&lt;i class=&#34;fa-regular fa-bullseye fa-xl&#34; style=&#34;color: #3a13fb;&#34;&gt;&lt;/i&gt; &lt;em&gt;&lt;strong&gt;Aura Virtual Assistant&lt;/strong&gt;&lt;/em&gt; component&lt;/p&gt;

&lt;/div&gt;

&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;To implement a two-level cache strategy:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Redis will be used as the first-level cache, with a short expiration time to speed up writing operations.&lt;/li&gt;
&lt;li&gt;MongoDB will be used as the second-level cache, with a high expiration time.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;aura-redis-mongo-synchronizer&lt;/strong&gt;&lt;/em&gt; (&lt;strong&gt;ARMS&lt;/strong&gt;) will be responsible for transferring expired data from Redis to MongoDB.&lt;/p&gt;
&lt;p&gt;The service is implemented as a web server just to make it easier to handle it and to connect with Aura monitoring systems, such as Prometheus. It is in charge of managing the expired data in Redis using the &lt;a href=&#34;https://redis.io/docs/latest/develop/interact/pubsub/&#34;&gt;Pub/Sub system provided by Redis&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;aura-redis-mongo-synchronizer-components&#34;&gt;Aura Redis Mongo Synchronizer components&lt;/h2&gt;
&lt;p&gt;The following figure shows the main components of the &lt;em&gt;&lt;strong&gt;aura-redis-mongo-sync&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;div style = &#34;width:800px; margin:0 auto&#34;&gt;  
&lt;p&gt;&lt;img src=&#34;../../images/redis-mongo-sync/redis-mongo-sync-diagram.svg&#34; alt=&#34;Aura Redis Mongo sync components&#34;&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;h3 id=&#34;server&#34;&gt;Server&lt;/h3&gt;
&lt;p&gt;The web server is implemented using &lt;a href=&#34;https://fastify.dev/&#34;&gt;fastify&lt;/a&gt;, a very fast web framework for &lt;strong&gt;NodeJS&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The web server works only as the service controller, while all the synchronization tasks are performed by a module outside the service called &lt;em&gt;&lt;strong&gt;aura-redis-mongo-sync&lt;/strong&gt;&lt;/em&gt; or &lt;strong&gt;&lt;strong&gt;ARMS&lt;/strong&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 id=&#34;modules&#34;&gt;Modules&lt;/h3&gt;
&lt;h4 id=&#34;redis-mongo-sync&#34;&gt;Redis Mongo Sync&lt;/h4&gt;
&lt;p&gt;It is responsible for synchronizing data between Redis and MongoDB.&lt;/p&gt;
&lt;p&gt;It uses a &lt;a href=&#34;https://redis.io/docs/latest/develop/interact/pubsub/&#34;&gt;publish/subscribe system provided by Redis&lt;/a&gt; to notify the module when to synchronize data from Redis to MongoDB, based on events generated by Redis regarding the changes in the status of the documents.&lt;/p&gt;
&lt;h3 id=&#34;controllers--services&#34;&gt;Controllers &amp;amp; Services&lt;/h3&gt;
&lt;p&gt;When the previous step is finished, the request lands on the controller.&lt;/p&gt;
&lt;p&gt;Each controller processes the request through a service in charge of implementing the logic. Once the request has been processed, the controller prepares and sends the response.&lt;/p&gt;
&lt;p&gt;There is a controller to manage requests associated with the server itself (&lt;a href=&#34;#generic-controller&#34;&gt;&lt;em&gt;&lt;strong&gt;generic&lt;/strong&gt;&lt;/em&gt; controller&lt;/a&gt;) and a controller for each module, in charge of handling the requests of that specific module.&lt;/p&gt;
&lt;h4 id=&#34;generic-controller&#34;&gt;Generic controller&lt;/h4&gt;
&lt;p&gt;As indicated above, the &lt;em&gt;&lt;strong&gt;generic&lt;/strong&gt;&lt;/em&gt; controller handles requests to retrieve information of the status of the server itself.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;healthz&lt;/code&gt;: It is used to check if the server is online returning a simple status response: &lt;code&gt;{&amp;quot;status&amp;quot;: &amp;quot;ok&amp;quot;}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;lastevent&lt;/code&gt;: It returns the date of the last synchronization between Redis and MongoDB: &lt;code&gt;{ status: &#39;ok&#39;, lastEvent: DATE }&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;shutdown&lt;/code&gt;: Service to be invoked mainly by &lt;strong&gt;Kubernetes&lt;/strong&gt; cluster to perform a server graceful shutdown.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;data-storage&#34;&gt;Data Storage&lt;/h2&gt;
&lt;p&gt;A new class has been created that implements the &lt;a href=&#34;https://learn.microsoft.com/en-us/javascript/api/botbuilder-core/storage?view=botbuilder-ts-latest&#34;&gt;Bot Framework &lt;em&gt;&lt;strong&gt;storage&lt;/strong&gt;&lt;/em&gt; interface&lt;/a&gt; called &lt;code&gt;RedisMongoDbStorage&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This class writes the context data to Redis and firstly, it reads the data from Redis. If this data does not exist in Redis, it fetches it from MongoDB.&lt;/p&gt;
&lt;p&gt;This class is included in the &lt;a href=&#34;../../docs/developers-workspace/develop-features/aura-utilities/aura-bot-utilities/aura-bot-common/&#34;&gt;&lt;em&gt;&lt;strong&gt;aura-common-utilities&lt;/strong&gt;&lt;/em&gt;&lt;/a&gt; repository. Check the &lt;a href=&#34;https://github.com/Telefonica/aura-common-utilities/blob/master/packages/aura-bot-utilities/src/aura-bot-common/storage/redis-mongo-storage.ts&#34;&gt;Github repository&lt;/a&gt; for further details.&lt;/p&gt;
&lt;h2 id=&#34;data-structure-in-redis&#34;&gt;Data structure in Redis&lt;/h2&gt;
&lt;p&gt;Redis stores its data in &lt;code&gt;key:value&lt;/code&gt; structures. This &lt;code&gt;value&lt;/code&gt; can support different data structures.&lt;/p&gt;
&lt;p&gt;In the following sections, the ones used to store the bot context are explained.&lt;/p&gt;
&lt;p&gt;These structures support an expiration time so that Redis deletes them when the expiration time is reached, so the content has expired. The expiration of a record in Redis emits an specific &lt;code&gt;event&lt;/code&gt;, of &lt;code&gt;expired&lt;/code&gt; type, that can be handled by an external module.&lt;/p&gt;
&lt;h3 id=&#34;context-bot-framework-context&#34;&gt;Context (Bot Framework Context)&lt;/h3&gt;
&lt;p&gt;The bot context is stored in a &lt;code&gt;key:string&lt;/code&gt; structure:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Key: context:[MONGO DATABASE NAME]:[MONGO COLLECTION NAME]:[MONGO CONTEXT INDEX KEY]
Value: The content of the context is stored in a string obtained by converting the Object context in JSON to string.
Expiration: [EXPIRATION]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Where:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;MONGO DATABASE NAME: Name of the database to use when &lt;strong&gt;ARMS&lt;/strong&gt; writes this data in MongoDB.&lt;/li&gt;
&lt;li&gt;MONGO COLLECTION NAME: Name of the collection to use when &lt;strong&gt;ARMS&lt;/strong&gt; writes this data in MongoDB.&lt;/li&gt;
&lt;li&gt;MONGO CONTEXT INDEX KEY: Key to use when &lt;strong&gt;ARMS&lt;/strong&gt; writes this data in MongoDB.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When a &lt;code&gt;key:value&lt;/code&gt; data expires in Redis, an &lt;code&gt;event&lt;/code&gt; is emitted indicating which key contained the expired record (event =&amp;gt; &lt;code&gt;expired&lt;/code&gt;). The data can no longer be retrieved because Redis deletes &lt;code&gt;value&lt;/code&gt; data before emitting the event and if this event is not processed, it will not recur, forcing us to use some auxiliary data structures in order to recover the expired data.&lt;/p&gt;
&lt;h4 id=&#34;shadow-keys&#34;&gt;Shadow Keys&lt;/h4&gt;
&lt;p&gt;A Shadow Key is a &lt;code&gt;key:void&lt;/code&gt; structure used to emit the event. As the expiration event returns a key, that will contain the current key of the context containing the data.&lt;/p&gt;
&lt;p&gt;To improve efficiency, this shadow-key contains the key &lt;a href=&#34;https://en.wikipedia.org/wiki/Shard_(database_architecture)&#34;&gt;SHARD&lt;/a&gt;, which allows ARMS to subscribe only to certain shards to improve performance.&lt;/p&gt;
&lt;p&gt;The number of shards is defined in the variable &lt;strong&gt;AURA_REDIS_CONTEXT_CACHE_SHARD_COUNT&lt;/strong&gt;, which indicates that the algorithm to calculate the shard based on the key will generate numbers between 1 and the value of the variable.&lt;/p&gt;
&lt;p&gt;It is important to notice that the number of shards configured in &lt;strong&gt;AURA_REDIS_CONTEXT_CACHE_SHARD_COUNT&lt;/strong&gt; must be the same as the number of pods configured in the &lt;em&gt;&lt;strong&gt;aura-redis-mongo-synchronizer&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Key: shadow-key:[SHARD]:context:[MONGO DATABASE NAME]:[MONGO COLLECTION CONTEXT]:[MONGO CONTEXT INDEX KEY]
Value: empty
Expiration:  [REDIS CONTEXT DATABASE EXPIRATION] 
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;When the service receives the expiration of this key, we can extract the shard and the real value from the context.&lt;/p&gt;
&lt;h4 id=&#34;active-context-list&#34;&gt;Active Context List&lt;/h4&gt;
&lt;p&gt;To ensure all data is synchronized, we need to keep in a list all the active context keys. By doing that, if an error occurs in the service and the expiration notifications are lost, we can recover data by periodically checking this list.&lt;/p&gt;
&lt;p&gt;The data structure to be used is &lt;code&gt;key: score-List&lt;/code&gt;. The score list contains a list of values with a string field and a numeric field by which the data can be sorted. The string field is used to store the key and the numeric field to store the expiration date.&lt;/p&gt;
&lt;p&gt;In this way, we can retrieve those expired records that have not been processed, as items are removed from the list once they are synchronized.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Key: active-context:[SHARD_VALUE]
            context:[MONGO DATABASE NAME]:[MONGO COLLECTION CONTEXT]:[MONGO CONTEXT INDEX KEY 1]     DATE_1
            context:[MONGO DATABASE NAME]:[MONGO COLLECTION CONTEXT]:[MONGO CONTEXT INDEX KEY 2]     DATE_2
            ...
            context:[MONGO DATABASE NAME]:[MONGO COLLECTION CONTEXT]:[MONGO CONTEXT INDEX KEY N]     DATE_N
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To store these elements, we will use partitioned lists in &lt;a href=&#34;https://en.wikipedia.org/wiki/Shard_(database_architecture)&#34;&gt;SHARD&lt;/a&gt; mode, that is, they will be included in the list that corresponds to them according to their &lt;code&gt;KEY&lt;/code&gt;. The &lt;code&gt;SHARD_VALUE&lt;/code&gt; is a number that is calculated from the key and the module obtained by dividing this number by the number of partitions that are configured.&lt;/p&gt;
&lt;p&gt;For example, there is a series of lists to avoid collisions between PODS of the service (&lt;strong&gt;ARMS&lt;/strong&gt;). That is, if the &lt;code&gt;KEY1&lt;/code&gt; key returns &lt;code&gt;301&lt;/code&gt; (this data is obtained by performing an operation on the content of the key) this is divided by the number of partitions, 5 for example, and the module +1 is obtained, to avoid the 0. This indicates that the list where it will be stored will be &lt;code&gt;active-context:2&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The execution of this process is based on the current system load. The variables associated to the execution period are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;AURA_REDIS_CONTEXT_CACHE_CACHE_CHECK_UNPROCESSED_INTERVAL_MIN&lt;/strong&gt;, which indicates in seconds the minimum time that will be set.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AURA_REDIS_CONTEXT_CACHE_CACHE_CHECK_UNPROCESSED_INTERVAL_MAX&lt;/strong&gt;, which indicates in seconds the maximum time for the interval.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The system will recalculate the next run based on the load. If the number of elements to be processed is very high, the interval will be reduced until it reaches the minimum, while if the load is low, the interval will be increased until it reaches the maximum.&lt;/p&gt;
&lt;h4 id=&#34;shard-variables&#34;&gt;SHARD variables&lt;/h4&gt;
&lt;p&gt;To manage the SHARD and the list to be selected by the &lt;strong&gt;ARMS&lt;/strong&gt;, two variables come into play in Redis stored in the &lt;code&gt;key:string&lt;/code&gt; structure.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;AURA_REDIS_CONTEXT_CACHE_SHARD_COUNT&lt;/strong&gt; : Number of lists to generate (partitions).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AURA_REDIS_CONTEXT_LAST_SHARD_PROCESSED&lt;/strong&gt;: Partition to manage at that moment, that is, when a service requests this data, one is added to it so that the next service that requests it can access the next partition, and so on.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AURA_REDIS_CONTEXT_LAST_INDEX_SHARD_PROCESSED&lt;/strong&gt;: This variable is used to assign event subscriptions in an orderly fashion. For example, if we have two ARMS services and the &lt;strong&gt;AURA_REDIS_CONTEXT_CACHE_SHARD_COUNT&lt;/strong&gt; is set to four, then the first service will subscribe to 1 and 2 and the second service to 3 and 4. This order of assignment is done by incrementing this environment variable.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;synchronization-flows&#34;&gt;Synchronization Flows&lt;/h2&gt;
&lt;div style = &#34;width:800px; margin:0 auto&#34;&gt;  
&lt;p&gt;&lt;img src=&#34;../../images/redis-mongo-sync/redis-mongo-sync-flow.svg&#34; alt=&#34;Aura Redis Mongo Synchronization Flow&#34;&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;h3 id=&#34;read-data&#34;&gt;Read Data&lt;/h3&gt;
&lt;p&gt;The Bot Framework components will read data in the following order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;They will try to read data from Redis.&lt;/li&gt;
&lt;li&gt;If Redis does not return data, they will try it in MongoDB.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;ARMS&lt;/strong&gt; will read data in two situations:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;When an expiration event is issued, ARMS reads the corresponding data, obtaining the context key contained in the expired KEY.&lt;/li&gt;
&lt;li&gt;When the active context control service runs (it does it periodically) and it has some expired context that must be synchronized.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;write-data&#34;&gt;Write Data&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Bot Framework components will write all their data in Redis.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ARMS&lt;/strong&gt; will write the synchronized records in MongoDB.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;NOTE: &lt;strong&gt;ARMS&lt;/strong&gt; also writes data in Redis but only to control its core and internal behavior, incrementing SHARD, updating active context lists, etc.&lt;/p&gt;
&lt;h3 id=&#34;distribution-of-the-event-subscription&#34;&gt;Distribution of the event subscription&lt;/h3&gt;
&lt;p&gt;As previously mentioned, every time a Shadow-Key expires in Redis, it emits an event that will be received by the &lt;strong&gt;ARMS&lt;/strong&gt; services that are subscribed to that event.&lt;/p&gt;
&lt;p&gt;Now, as the Shadow-Key contains the SHARD of the real key of the data, we can distribute the events among different &lt;strong&gt;ARMS&lt;/strong&gt; to improve performance and avoid network overload.&lt;/p&gt;
&lt;p&gt;For the assignment of the events to subscribe, there is a method that is executed every certain time. The value is in the variable &lt;strong&gt;AURA_REDIS_CONTEXT_CACHE_CHECK_INDEX_SHARD_INTERVAL&lt;/strong&gt; and is measured in seconds.&lt;/p&gt;
&lt;h4 id=&#34;steps-to-generate-event-subscription&#34;&gt;Steps to generate event subscription&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Save the current state of the service: This saves, in a Redis structure, the identifier of the current &lt;strong&gt;ARMS&lt;/strong&gt; and the current time.&lt;/li&gt;
&lt;li&gt;Consult the number of &lt;strong&gt;ARMS&lt;/strong&gt; services available: This is done by consulting the previous structure, obtaining those services that have been recently updated.&lt;/li&gt;
&lt;li&gt;Calculate the number of events to subscribe: This is done by dividing &lt;strong&gt;AURA_REDIS_CONTEXT_CACHE_SHARD_COUNT&lt;/strong&gt;, which contains the number of partitions, by the number of services. There is a variable that can limit this assignment, &lt;strong&gt;AURA_REDIS_CONTEXT_CACHE_MIN_SHARD_BY_NODE&lt;/strong&gt;: if this variable is greater than the previous result, the value of the variable is used. For example, if the result is 1, but this variable has the value 2, the service must subscribe to 2 events.&lt;/li&gt;
&lt;li&gt;Assign the events: Once the number of events to subscribe to is determined, the &lt;strong&gt;AURA_REDIS_CONTEXT_LAST_INDEX_SHARD_PROCESSED&lt;/strong&gt; variable is consulted and incremented. The value to assign is the module between the returned value and the value of &lt;strong&gt;AURA_REDIS_CONTEXT_CACHE_SHARD_COUNT&lt;/strong&gt;. In this way, it will assign consecutive values between 1 and the &lt;strong&gt;AURA_REDIS_CONTEXT_CACHE_SHARD_COUNT&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Subscription to Redis: Once the SHARDs to be subscribed have been assigned, we only need to disconnect the events that do not match the current selection and connect the ones we do not have connected.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;i class=&#34;fa-solid fa-circle-info fa-xl&#34; style=&#34;color: #3267c3;&#34;&gt;&lt;/i&gt; To obtain an optimal performance, ideally the number of &lt;strong&gt;AURA_REDIS_CONTEXT_CACHE_SHARD_COUNT&lt;/strong&gt; should at least match the number of ARMS services.&lt;/p&gt;
&lt;p&gt;Example of distribution for &lt;strong&gt;AURA_REDIS_CONTEXT_CACHE_SHARD_COUNT&lt;/strong&gt; = 5, and adding &lt;strong&gt;ARMS&lt;/strong&gt; services until reaching 5.&lt;/p&gt;
&lt;/br&gt;
&lt;div style = &#34;width:1200px; margin:0 auto&#34;&gt;  
&lt;p&gt;&lt;img src=&#34;../../images/redis-mongo-sync/redis-mongo-sync-flow-shards.svg&#34; alt=&#34;Aura Redis Distribution of events by shard&#34;&gt;&lt;/p&gt;
&lt;/div&gt;

      </description>
    </item>
    
    <item>
      <title>Docs: </title>
      <link>/docs/developers-workspace/develop-features/aura-utilities/aura-utilities/aura-mongo-handler/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/developers-workspace/develop-features/aura-utilities/aura-utilities/aura-mongo-handler/</guid>
      <description>
        
        
        &lt;h1 id=&#34;aura-mongo-handler-utility&#34;&gt;aura-mongo-handler utility&lt;/h1&gt;


&lt;div class=&#34;pageinfo pageinfo-primary&#34;&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;aura-mongo-handler&lt;/strong&gt;&lt;/em&gt; utility is a tool to handle the MongoDB database&lt;/p&gt;

&lt;/div&gt;

&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;aura-mongo-handler&lt;/strong&gt;&lt;/em&gt; utility is the connector and cache for MongoDB.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../images/auracache.png&#34; alt=&#34;aura-mongo-handler&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;i class=&#34;fa-regular fa-file-lines fa-xl&#34; style=&#34;color: #0d5de7;&#34;&gt;&lt;/i&gt; Find more information in the Github repository:
&lt;a href=&#34;https://github.com/Telefonica/aura-common-utilities/tree/master/packages/aura-utilities/src/aura-mongo-handler/&#34;&gt;https://github.com/Telefonica/aura-common-utilities/tree/master/packages/aura-utilities/src/aura-mongo-handler/&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;steps-to-create-a-two-level-cache&#34;&gt;Steps to Create a Two Level Cache&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;First, initialize the MongoDB Connector&lt;/li&gt;
&lt;li&gt;Instantiate a new &lt;code&gt;TwoLevelCache&lt;/code&gt; Object&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;initialize-mongodb-connector&#34;&gt;Initialize MongoDB Connector&lt;/h2&gt;
&lt;p&gt;To initialize the Singleton of MongoDB connector, you need these variables in your configuration object:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;AURA_MONGODB_URI&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;AURA_MONGODB_POOL_SIZE&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;AURA_MONGODB_SSL&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;AURA_MONGODB_USERNAME&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;AURA_MONGODB_PASSWORD&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;BRIDGE_MESSAGE_CACHE_TTL&lt;/code&gt;           -&amp;gt; Time in miliseconds&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;BRIDGE_MONGODB_DATABASE_CACHE&lt;/code&gt;       -&amp;gt; Database name in MongoDB for Cache&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;BRIDGE_MONGODB_COLLECTION_DL_CACHE&lt;/code&gt;  -&amp;gt; Collection name in MongoDB for Cache&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;BRIDGE_MONGODB_INDEX_DL_CACHE&lt;/code&gt;      -&amp;gt; Index field name in MongoDB Collection&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To initialize, use the following command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-typescript&#34; data-lang=&#34;typescript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#000&#34;&gt;Connector&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;init&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;configuration&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;instantiate-a-new-twolevelcache-object&#34;&gt;Instantiate a new TwoLevelCache Object&lt;/h2&gt;
&lt;p&gt;To instantiate a TwoLevelCache object, the following elements are needed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A Mongo DataBase Name&lt;/li&gt;
&lt;li&gt;A collection name&lt;/li&gt;
&lt;li&gt;The property in the model to be saved in the cache to use as index in MongoDB. This index must be created by deploy scripts.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Constructor:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;(name: string, localTTlMiliseconds: number, databaseName: string, collectionName: string, indexId?: string)
&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;name: Name inside the logs generated by this instance.&lt;/li&gt;
&lt;li&gt;localTTlMiliseconds: Local cache lifetime in in miliseconds.&lt;/li&gt;
&lt;li&gt;databaseName: Name of the database in MongoDB.&lt;/li&gt;
&lt;li&gt;collectionName: Name of the collection in MongoDB database.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-typescript&#34; data-lang=&#34;typescript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;const&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;tlCache&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;TwoLevelsCache&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;CustomModel&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;LogName&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;&lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;30000&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;collectionName&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;DataBaseName&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;customId&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you need more than one cache and use an instance for each of them, you can do this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-Typescript&#34; data-lang=&#34;Typescript&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;export&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;class&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;AppCaches&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;public&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;static&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;auraBotCache&lt;/span&gt;: &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;TwoLevelsCache&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;AuraBotModel&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;public&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;static&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;userDataCache&lt;/span&gt;:&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;TwoLevelsCache&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;UserModel&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;&amp;gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;public&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;static&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;init&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;configuration&lt;/span&gt;: &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;any&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#000&#34;&gt;AppCaches&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;auraBotCache&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;TwoLevelsCache&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;AuraBotCache&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;30000&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;AuraCacheDB&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;AuraCacheCollection&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;auraId&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#000&#34;&gt;AppCaches&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;userDataCache&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;new&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;TwoLevelsCache&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;AuraUserCache&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;30000&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;UserCacheDB&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;UserCacheCollection&amp;#39;&amp;#39;userId&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;this&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
      </description>
    </item>
    
    <item>
      <title>Docs: </title>
      <link>/docs/developers-workspace/monitoring/metrics/aura-redis-mongodb-sync-metrics/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/docs/developers-workspace/monitoring/metrics/aura-redis-mongodb-sync-metrics/</guid>
      <description>
        
        
        &lt;h1 id=&#34;aura-redis-mongodb-synchronizer-metrics&#34;&gt;Aura Redis MongoDB Synchronizer metrics&lt;/h1&gt;


&lt;div class=&#34;pageinfo pageinfo-primary&#34;&gt;
&lt;p&gt;List of metrics available in &lt;a href=&#34;../../docs/components/aura-redis-mongo-sync/&#34;&gt;&lt;em&gt;&lt;strong&gt;aura-redis-mongo-sync&lt;/strong&gt;&lt;/em&gt; (ARMS)&lt;/a&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;h2 id=&#34;aura_component_version&#34;&gt;aura_component_version&lt;/h2&gt;
&lt;p&gt;This metric is intended to store the number of &lt;em&gt;&lt;strong&gt;aura-bot&lt;/strong&gt;&lt;/em&gt; instances (pods) running each version of the code. It is stored as a &lt;a href=&#34;https://prometheus.io/docs/concepts/metric_types/#gauge&#34;&gt;Gauge&lt;/a&gt; in &lt;strong&gt;Prometheus&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Labels:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;version&lt;/code&gt;: version field in the &lt;code&gt;package.json&lt;/code&gt; file included in the running docker container.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;component&lt;/code&gt;: name of the component that is writing the metric.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;aura_server_unhandled_error&#34;&gt;aura_server_unhandled_error&lt;/h2&gt;
&lt;p&gt;This metric is intended to store the number of unhandled errors happening in &lt;em&gt;&lt;strong&gt;aura-redis-mongo-sync&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;It is stored as a &lt;a href=&#34;https://prometheus.io/docs/concepts/metric_types/#counter&#34;&gt;Counter&lt;/a&gt; in &lt;strong&gt;Prometheus&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Labels:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;error&lt;/code&gt;: exception message that forced the unhandled error.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;redis_mongo_sync_duration_milliseconds&#34;&gt;redis_mongo_sync_duration_milliseconds&lt;/h2&gt;
&lt;p&gt;This metric measures the data upload time from the service to the Mongo database.&lt;/p&gt;
&lt;p&gt;It is stored as a &lt;a href=&#34;https://prometheus.io/docs/concepts/metric_types/#histogram&#34;&gt;Histogram&lt;/a&gt; in &lt;strong&gt;Prometheus&lt;/strong&gt;. So every sample, besides the defined labels, also includes its duration.&lt;/p&gt;
&lt;p&gt;The &lt;em&gt;&lt;strong&gt;aura-redis-mongo-sync&lt;/strong&gt;&lt;/em&gt; service contains a data collector that helps the event service move stale data from Redis to MongoDB. This collector sends the data in packets to optimize performance. This metric measures the time MongoDB takes to process the packet.&lt;/p&gt;
&lt;p&gt;Labels:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;status&lt;/code&gt;: HTTP status returned in the response. Values: &lt;code&gt;success&lt;/code&gt;.
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;success&lt;/code&gt;: if the status is &lt;code&gt;success&lt;/code&gt;, the time is stored.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;redis_mongo_synced_items_total&#34;&gt;redis_mongo_synced_items_total&lt;/h2&gt;
&lt;p&gt;This metric is intended to store the registers synchronized between Redis and MongoDB by events.&lt;/p&gt;
&lt;p&gt;It is stored as a &lt;a href=&#34;https://prometheus.io/docs/concepts/metric_types/#counter&#34;&gt;Counter&lt;/a&gt; in &lt;strong&gt;Prometheus&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Labels:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;type&lt;/code&gt;: register type. Values: &lt;code&gt;event&lt;/code&gt;, &lt;code&gt;active_context&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;event&lt;/code&gt;: Items synchronized by event.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;active_context&lt;/code&gt;: Items synchronized by active context process.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;redis_mongo_synced_errors&#34;&gt;redis_mongo_synced_errors&lt;/h2&gt;
&lt;p&gt;This metric is intended to store the errors that have occurred in the synchronization.&lt;/p&gt;
&lt;p&gt;It is stored as a &lt;a href=&#34;https://prometheus.io/docs/concepts/metric_types/#counter&#34;&gt;Counter&lt;/a&gt; in &lt;strong&gt;Prometheus&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Labels:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;error&lt;/code&gt;: Values : &lt;code&gt;create&lt;/code&gt;, &lt;code&gt;syncData&lt;/code&gt;, &lt;code&gt;executeBulk&lt;/code&gt;.
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;create&lt;/code&gt;: If the error occurred when creating the service.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;syncData&lt;/code&gt;: If the error occurred when synchronizing the data.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;executeBulk&lt;/code&gt;: If the error occurred when uploading the data to MongoDB in bulk mode.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;redis_mongo_sync_configuration_settings&#34;&gt;redis_mongo_sync_configuration_settings&lt;/h2&gt;
&lt;p&gt;This metric contains the service configuration data.&lt;/p&gt;
&lt;p&gt;It is stored as a &lt;a href=&#34;https://prometheus.io/docs/concepts/metric_types/#gauge&#34;&gt;Gauge&lt;/a&gt; in &lt;strong&gt;Prometheus&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Labels:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;setting_name&lt;/code&gt;: Values: &lt;code&gt;shard_count&lt;/code&gt;, &lt;code&gt;pod_count&lt;/code&gt;, &lt;code&gt;active_context_ttl_seconds&lt;/code&gt;, &lt;code&gt;redis_cache_ttl_seconds&lt;/code&gt;.
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;shard_count&lt;/code&gt;: Current shard used to distribute the data to synchronize between pods.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pod_count&lt;/code&gt;: Current number of services of &lt;em&gt;&lt;strong&gt;aura-redis-mongo-sync&lt;/strong&gt;&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;active_context_ttl_seconds&lt;/code&gt;: Time interval to run the data collector.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;redis_cache_ttl_seconds&lt;/code&gt;: Time in seconds that will be set to the context elements in the Redis cache.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;services_status&#34;&gt;services_status&lt;/h2&gt;
&lt;p&gt;This metric is intended to store the number of success or errored checks of modules of the server. It is stored as a &lt;a href=&#34;https://prometheus.io/docs/concepts/metric_types/#counter&#34;&gt;Counter&lt;/a&gt; in &lt;strong&gt;Prometheus&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Labels:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;moduleId&lt;/code&gt;: Id of the module.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;status&lt;/code&gt;: OK or ERROR&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
  </channel>
</rss>
