I have over the last couple years used EhCache either via Spring (with AOP) or having it configured as hibernates' cache. I have never had the time or the need to look into the whole distributed caching available with Terracotta. However I recently stumbled on to Hazelcast and read the following:
"Hazelcast is pure Java. JVMs that are running Hazelcast will dynamically cluster. Although by default Hazelcast will use multicast for discovery, it can also be configured to only use TCP/IP for environments where multicast is not available or preferred. Communication among cluster members is always TCP/IP with Java NIO beauty. Default configuration comes with 1 backup so if one node fails, no data will be lost. It is as simple as using java.util.{Queue, Set, List, Map}. Just add the hazelcast.jar into your classpath and start coding."
I was instantly intrigued. So it sounds simple enough...Open IDE...jump in... being a maven fan, I figure, why download and manually "install" when you can just use maven, so I search around a little and add the following to a pom.
Edit: 1.8.4 is now outdated check http://www.hazelcast.com/downloads.jsp for the latest.
From the online documentation, I saw there was an InstanceListener interface. I create a simple Main class, that implements that and lists the instances.
So running this just adds a listener to the Hazelcast instance. According to the documentation Hazelcast allows for the following (and lots more):
# Distributed java.util.{Queue, Set, List, Map}
# Querying distributed data
I created a couple Main classes to run these separately, so that I could see if they are usable across different JVM executions.
So within minutes... I have a distributed cache across 4 applications, that I can monitor, control, query... (and btw. Hazelcast allows you to add indexes to the caches, same as a database to optimize queries).
If I was to place these 4 applications on 4 different machines, they will by default cluster (multicast for discovery) and have built in failover, monitoring and even persistence if required.
Coming from an environment where we have dozens of servers all caching data, this has got to be one of the most exciting open source products I have come across. Now I just need to convince the powers that be to prototype this and this may be the first open source project I actually try get involved in. The possibilities I am seeing for this type of functionality and then integrating it with the Spring Framework may actually make my brain explode.
Subscribe to:
Post Comments (Atom)
Popular Posts
-
I have recently been slacking on content on my blog, between long stressful hours at work and to the wonderful toy that is an iPhone, I have...
-
I make no claim to be a "computer scientist" or a software "engineer", those titles alone can spark some debate, I regar...
-
I saw an article (well more of a rant) the other day, by Rob Williams Brain Drain in enterprise Dev . I have to say, I do agree with some o...
-
This series of posts will be about me getting to grips with JBoss Drools . The reasoning behind it is: SAP bought out my company's curre...
-
Update: Check out my updated re-certification on the new 2019 exam... here Let me start by saying, for this certification I studied and...
This sounds awesome - does anyone use it yet? It sounds a lot like memcache but it persists the data. I like that.
ReplyDeleteThanks for this article. I've tried to run your example on my laptop but got confused by the result I received.
ReplyDelete1:) If I run AddThingsToCache and UseTheCache once, i got list has 10000 items and map has 10000 items as expected.
2:) If I run AddThingsToCache and then UseTheCache again, I am getting incorrect result for the number of items in the list. e.g. 19877!
Am I doing something wrong?
Hi,
ReplyDeleteHow can we achieve the statistics of the map, like hits , access\requests.
Benny
Best place to ask this would be in the google group. I personally have not spent time looking at the monitoring.
ReplyDeletehttp://groups.google.com/group/hazelcast
Here I’d like to mention another Distributed Cache alternative "NCache”. I experienced that this is the most mature solution and has more features than all other options. The option that you mentioned is supported in java only but NCache is supported in .NET and JAVA both. But I’d recommend NCache and Hazelcast both as I read the details of Hazelcast and I found it useful too.
ReplyDeleteJust come across this excellent open source project , hazelcast is truly amazing it provides not only distributed cache but also failover and scalability. great software.
ReplyDeleteJavin
Difference between ClassNotFoundException vs NoClassDefFoundError
Regarding clustering, did you ever try to compare with glassfish v3.1 capabilities ?
ReplyDeleteHazelcast version 1.8.4 is quite old. Make sure to use the latest hazelcast version available at http://www.hazelcast.com/downloads.jsp.
ReplyDelete-talip
Hazelcast
Talip, I now updated the post to include the download link, yeah 1.8.4 was a while back.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThe common misconception is that it is not 100% accurate and it only produces 90 to 95% accuracy according to law officials. It also leads to the convictions of innocent people occasionally. It had a little success on exposing spies like Karl Koecher and Ann Belen Montes.http://liedetector.uk
ReplyDeleteIf I was to place these 4 applications on 4 different machines, they will by default cluster (multicast for discovery) and have built in failover, monitoring and even persistence if required. buy lawn suits online , pakistani lawn suits online shopping ,
ReplyDeleteAivivu đại lý vé máy bay, tham khảo
ReplyDeletevé máy bay đi Mỹ hạng thương gia
vé máy bay từ mỹ đi việt nam
thông tin chuyến bay từ canada về việt nam
mua vé máy bay từ nhật bản về việt nam
giá vé máy bay từ hàn quốc về việt nam
Vé máy bay từ Đài Loan về Việt Nam
Chi phi cho chuyen gia nuoc ngoai
This kind of work pleases me very much.
ReplyDeletethis blog is great for our country to be a valuable blog and would like to visit you
ReplyDeletevisit my site for sure and you will not be good for the good thank you and have a nice day
ReplyDelete