Browse by type

Coherence is a scalable, fault-tolerant, cloud-ready, distributed platform for building grid-based applications and reliably storing data. The product is used at scale, for both compute and raw storage, in a vast array of industries such as critical financial trading systems, high performance telecommunication products and eCommerce applications.
Typically, these deployments do not tolerate any downtime and Coherence is chosen due to its novel features in death detection, application data evolvability, and the robust, battle-hardened core of the product that enables it to be seamlessly deployed and adapted within any ecosystem.
At a high level, Coherence provides an implementation of the familiar Map<K,V>
interface but rather than storing the associated data in the local process it is partitioned
(or sharded) across a number of designated remote nodes. This partitioning enables
applications to not only distribute (and therefore scale) their storage across multiple
processes, machines, racks, and data centers but also to perform grid-based processing
to truly harness the CPU resources of the machines.
The Coherence interface NamedMap<K,V> (an extension of Map<K,V>) provides methods
to query, aggregate (map/reduce style) and compute (send functions to storage nodes
for locally executed mutations) the data set. These capabilities, in addition to
numerous other features, enable Coherence to be used as a framework for writing robust,
distributed applications.
As Coherence is generally embedded into an application by using Coherence APIs, the natural place to consume this dependency is from Maven:
<dependencies>
<dependency>
<groupId>com.oracle.coherence.ce</groupId>
<artifactId>coherence</artifactId>
<version>22.06.10</version>
</dependency>
</dependencies>
You can also get Coherence container images from the official GitHub Packages site. For other language clients, follow the links to C++, .NET, JavaScript, Go and Python. For commercial offerings, go to Oracle Technology Network.
First and foremost, Coherence provides a fundamental service that is responsible for all facets of clustering and is a common denominator / building block for all other Coherence services. This service, referred to as 'service 0' internally, ensures that the mesh of members is maintained and responsive, taking action to collaboratively evict, shun, or in some cases, voluntarily depart the cluster when deemed necessary. As members join and leave the cluster, other Coherence services are notified, thus enabling those services to react accordingly.
Note: This part of the Coherence product has been in production for more than 10 years, being the subject of some extensive and imaginative testing. While this feature has been discussed here, it certainly is not something that customers, generally, interact with directly, but is important to be aware of.
Coherence services build on top of the cluster service. The key implementations to be aware of are PartitionedService, InvocationService, and ProxyService.
In the majority of cases, customers deal with maps. A map is represented
by an implementation of NamedMap<K,V>. A NamedMap is hosted by a service,
generally the PartitionedService, and is the entry point to store, retrieve,
aggregate, query, and stream data.
Coherence Maps provide a number of features:
java.util.concurrent package enabling distributed process coordination through the gridCoherence also provides a number of non-functional features:
You must have the following installed and available on your PATH.
The following example shows you how to quickly get started with Coherence using the Coherence CLI to create a 3 node Coherence cluster scoped to you local machine. You will then access data using the CohQL and Coherence consoles.
For macOS or Linux platforms, use the following to install the latest version of the CLI:
curl -sL https://raw.githubusercontent.com/oracle/coherence-cli/main/scripts/install.sh | bash
When you install the CLI, administrative privileges are required as the
cohctlexecutable is moved to the /usr/local/bin directory.
For Windows, see here for installation guide.
Use the following command to create a 3 node Coherence cluster called my-cluster, scoped to your local machine using the default values.
$ cohctl create cluster my-cluster
Cluster name: my-cluster
Cluster version: 22.06.10
Cluster port: 7574
Management port: 30000
Replica count: 3
Initial memory: 128m
Persistence mode: on-demand
Group ID: com.oracle.coherence.ce
Additional artifacts:
Startup Profile:
Dependency Tool: mvn
Are you sure you want to create the cluster with the above details? (y/n) y
Checking 3 Maven dependencies...
- com.oracle.coherence.ce:coherence:22.06.10
- com.oracle.coherence.ce:coherence-json:22.06.10
- org.jline:jline:3.26.3
Starting 3 cluster members for cluster my-cluster
Starting cluster member storage-0...
Starting cluster member storage-1...
Starting cluster member storage-2...
Current context is now my-cluster
Cluster added and started
Note: If you do not have the Maven artefacts locally, it may take a short while to download them from Maven central.
Once the cluster is created, wait it a couple of seconds, and use the following command to see the members.
$ cohctl get members
Using cluster connection 'my-cluster' from current context.
Total cluster members: 3
Cluster Heap - Total: 384 MB Used: 114 MB Available: 270 MB (70.3%)
Storage Heap - Total: 128 MB Used: 16 MB Available: 112 MB (87.5%)
NODE ID ADDRESS PORT PROCESS MEMBER ROLE STORAGE MAX HEAP USED HEAP AVAIL HEAP
1 /127.0.0.1 55654 58270 storage-1 CoherenceServer true 128 MB 16 MB 112 MB
2 /127.0.0.1 55655 58271 storage-2 CoherenceServer true 128 MB 74 MB 54 MB
3 /127.0.0.1 55656 58269 storage-0 CoherenceServer true 128 MB 24 MB 104 MB
Note: If you do not see the above, then ensure the java executa
$ claude mcp add coherence \
-- python -m otcore.mcp_server <graph>