# Package oracle.kv.coherence

package oracle.kv.coherence
This package contains the public API for integration of Oracle NoSQL Database with Oracle Coherence. These classes enable the use of NoSQL DB as the persistent backing for a Coherence distributed, or partitioned cache. There is 1 primary use case that are supported.

The case is when Oracle NoSQL Database is used solely as the persistent backing for Oracle Coherence-based applications. In this case, the format of data in the database is likely of limited concern, and the application should use the NoSQLBinaryStore module.

You will use the Oracle Coherence cache configuration files to define a distributed-scheme cache, where a variety of configuration parameters can be specified to identify the Oracle NoSQL Database instance that will back the cache as well as parameters to control Consistency, Durability, and other store type-specific attributes.

In Coherence version 3.7.1, cache configuration parameters are specified as a few initialization parameters which are accessible by implementations that include a public constructor with a matching signature. You may refer to the following example for defining a NoSQL binary cache.

    <cachestore-scheme>
      <class-scheme>
        <class-name>oracle.kv.coherence.NoSQLBinaryStore</class-name>
        <init-params>
          <init-param>
            <param-name>storeName</param-name>
            <param-value>kvstore</param-value>
          </init-param>
          <init-param>
            <param-name>helperHosts</param-name>
            <param-value>localhost:5000</param-value>
          </init-param>
        </init-params>
      </class-scheme>
    </cachestore-scheme>

Since Coherence version 12.1.2, cache configuration parameters are specified within a custom XML namespace and are processed by the NoSQL Database namespace handler at runtime. The following example declares a kv namespace that is associated with the NoSQLNamespaceHandler namespace handler class.

    <cache-config xmlns:kv="class://oracle.kv.coherence.NoSQLNamespaceHandler">

    <cachestore-scheme>
      <kv:binary-cache-store>
        <kv:store-name>kvstore</kv:store-name>
        <kv:helper-hosts>localhost:5000</kv:helper-hosts>
      </kv:binary-cache-store>
    </cachestore-scheme>

Please also refer to each cache store implementation class in this package for a complete list of configuration parameters that can be specified.

- Related Packages
  Package
  Description
  oracle.kv
  This package contains the public API for using Oracle NoSQL Database.
- Class
  Description
  CacheKeyMapper
  This interface defines a mechanism for translating an Oracle Coherence cache key object into an Oracle NoSQL Database `Key`.
  NoSQLBinaryStore
  Oracle NoSQL Database implementation of the `BinaryEntryStore` interface.
  PofKeySerializer
  This class provides Coherence Portable Object Format (POF) serialization of the `Key` class.