Wednesday, May 18, 2011

Joining Multiple Coherence Clusters

"I do not recall distinctly when it began, but it was months ago."

"Nyarlathotep" - H.P. Lovecraft
At my previous job I was given the following problem to consider: is it possible for a Java application (with just a single JVM) to connect to more than one Coherence cluster? In this context, the word "connect" means that the application actually joins the clusters in question, rather than simply works through a proxy such as provided by Coherence*Extend. I was able to determine that the answer was "yes", however the solution was not as straightforward as one might think. It's not possible to just load two Coherence instances into the JVM by calling a constructor with the necessary parameters, as Coherence makes extensive use of system properties and default configuration files in lieu of defining constructors for a client to call. In addition Coherence uses the Singleton pattern in conjuction with several key classes. That said, there is a solution and that's what this post is all about.

Sunday, February 13, 2011

Order out of Chaos

In stark certainty, we were wandering amidst a death which had reigned at least 500,000 years, and in all probability even longer.

- "At the Mountains of Madness", H.P. Lovecraft

Coding requires that we make decisions all the time, ranging from the small (what should I call this variable) to the large (what framework should I use). While sometimes the information we base our answers on is certain data (the data we are given will never be null), more often we need to make come up with an answer based on uncertain data (what SLA should we advertise for our system based on what we know of the SLA for all the various components of the system).  Coming up with answers for the latter type of questions may seem daunting, however it may not be so impossible given that there is there is a whole branch of mathematics that deals with situations like this, namely probability.