Search code examples
cachingoracle-coherence

Oracle Coherence - Scheme for Persistence


In Oracle Coherence 12, what is the backing-map-scheme that can give a durable storage (NOT database)?

For Ex. Redis writes to a RDB/AOF file and restores KV entries after restart.


Solution

  • Configured Persistence Envrionments in operational config.

     <persistence-environments>
        <!-- -Dcoherence.distributed.persistence.base.dir=override USR_HOME -->
    
        <persistence-environment id="stage_env_w_active_store">
                <persistence-mode>active</persistence-mode>
                <active-directory system-property="coherence.distributed.persistence.active.dir">
                        /opt/datastore/staged/active</active-directory>
                <snapshot-directory system-property="coherence.distributed.persistence.snapshot.dir">
                        /opt/datastore/staged/snapshot</snapshot-directory>
                <trash-directory system-property="coherence.distributed.persistence.trash.dir">
                        /opt/datastore/staged/trash</trash-directory>
        </persistence-environment>
    
        <persistence-environment id="stage_env_w_ondemand_store">
                <persistence-mode>on-demand</persistence-mode>
                <active-directory system-property="coherence.distributed.persistence.active.dir">
                        /opt/datastore/staged/dactive</active-directory>
                <snapshot-directory system-property="coherence.distributed.persistence.snapshot.dir">
                        /opt/datastore/staged/dsnapshot</snapshot-directory>
                <trash-directory system-property="coherence.distributed.persistence.trash.dir">
                        /opt/datastore/staged/dtrash</trash-directory>
        </persistence-environment>
    
    </persistence-environments>
    

    Configured the backing-map-scheme persistence in the cache scheme.

     <distributed-scheme>
          <scheme-name>server</scheme-name>
          <service-name>PartitionedCache</service-name>
          <local-storage system-property="coherence.distributed.localstorage">true</local-storage>
          <backing-map-scheme>
            <local-scheme>
              <high-units>{back-limit-bytes 0B}</high-units>
            </local-scheme>
          </backing-map-scheme>
              <persistence>
             <environment>stage_env_w_active_store</environment>
           </persistence>
          <autostart>true</autostart>
        </distributed-scheme>
    

    The "Active Space Used on disk (MB)" shows apt space used in JMX JVisualVM.