A Gentle Introduction to Coherence
By: Coherence Team
Tags: Distributed Systems, Introduction, Coherence, Scalability, Microservices

A Gentle Introduction to Coherence

Just in case you missed the announcement, there is now a publicly available, open sourced version of Coherence! As a result we are publishing a series of articles that will help you use it effectively.

This initial article series provides a 30,000 foot overview of the major Coherence features, and explains how they work together to simplify development of distributed applications. We will follow up with a series of deep-dive articles, drilling into the details of various product areas that require more in-depth coverage. The combination of the two will allow you to quickly get up to speed and understand which features to use and when.

Let’s tackle the obvious questions you should be asking first: Why do I care? What does it offer me? What can I build with it?

Why do I care?

As an architect of a large, mission-critical web site or enterprise application, you need to address at least three major non-functional requirements: performance, scalability and availability.

Performance is defined as the amount of time an operation takes to complete. Performance is extremely important, as it is the main factor that determines application responsiveness — experience has shown us that no matter how great and full-featured an application is, if it is slow and unresponsive, the users will hate it.

Scalability is the ability of the system to maintain acceptable performance as the load increases. While it is relatively simple to make an application perform well in a single-user environment, it is significantly more difficult to maintain that level of performance as the number of simultaneous users increases to thousands, or in the case of very large public web sites, to tens or even hundreds of thousands. The bottom line is, if your application doesn’t scale well, its performance will degrade as the load increases, and the users will hate it.

Finally, availability is measured as the percentage of time an application is available to the users. While some applications can crash several times a day without causing major inconvenience to the user, most mission critical applications simply cannot afford that luxury and need to be available 24 hours per day, every day. If your application is mission critical, you need to ensure that it is highly available, or the users will hate it. To make things even worse, if you build an e-commerce site that crashes in the run-up to Christmas, your investors will hate you as well.

The moral of the story is that in order to keep your users happy and avoid all that hatred, you as an architect need to ensure that your application is fast, remains fast even under heavy load, and stays up and running even when the hardware or software components that it depends on fail. Unfortunately, while it is relatively easy to satisfy any one of these three requirements individually, and not too difficult to comply with any two of them, it is considerably more difficult to fulfill all three at the same time.

Fortunately, Coherence can help.

What does it give me?

Coherence is a fast, scalable, fault tolerant data store. It provides automatic discovery of cluster members, automatic data sharding, highly redundant data storage, built-in messaging, events for anything that happens to the data or the cluster itself, simple to use APIs, and above all else — a “coherent” system (it is literally in the name).

Coherence is fast. Typical data access operations are usually in low single-digit milliseconds range, and even sub-millisecond for basic key-based operations. Of course, the actual performance is very much determined by the network between the cluster members — the better the network, the faster all Coherence operations are going to be.