Scaling software should be an activity done with ease by Hardware, Cloud and System Administrators without knowledge of the applications being scaled.
Tuesday, May 18, 2010
Steve Jobs Stanford Commencement
Friday, May 7, 2010
A Couple Minutes With Non-Stop Ehcache
- Download Ehcache 2.1
- Download the NonStopCache 1.0
- Start the Terracotta server
- run the below program (source code below)
Regular cache. No Decorator
The size of the cache is: 0
After put the size is: 1
Here are the keys:
Key:0
Done with cache.
Sleeping, Stop your server
Disconnected NonStop with noop cache.
The size of the cache is: 0
After put the size is: 0
Here are the keys:
Done with cache.
Disconnected NonStop with local reads cache.
The size of the cache is: 1
After put the size is: 1
Here are the keys:
Key:0
Done with cache.
Disconnected NonStop with exception cache.
Exception in thread "main" net.sf.ehcache.constructs.nonstop.NonStopCacheException: getKeys timed out
at net.sf.ehcache.constructs.nonstop.behavior.ExceptionOnTimeoutBehavior.getKeys(ExceptionOnTimeoutBehavior.java:114)
at net.sf.ehcache.constructs.nonstop.behavior.ClusterOfflineBehavior.getKeys(ClusterOfflineBehavior.java:120)
at net.sf.ehcache.constructs.nonstop.NonStopCache.getKeys(NonStopCache.java:264)
at MyFirstNonStopEhcacheSample.addToCacheAndPrint(MyFirstNonStopEhcacheSample.java:45)
at MyFirstNonStopEhcacheSample.(MyFirstNonStopEhcacheSample.java:40)
at MyFirstNonStopEhcacheSample.main(MyFirstNonStopEhcacheSample.java:60)
What Just Happened?
The cache is first loaded into an ordinary undecorated cache. This is performed before the server kill and proceeds without incident. The next round of operations on the cache were performed with the server down.
- These decorators are all being used on the same cache. This way you can make the behavior specific to the user of the cache. It gives tremendous flexibility.
- You'll notice this little sample flies through despite the timeout being set to 13 seconds. This is because it's in fail fast mode. In this configurable mode if the cache knows it can't communicate it will return the failure case immediately. If that's not what you want you can instead set it up to not fail fast and wait the full timeout no matter what.
- I did this work in config but the same setup can be done in code
And the Config file ehcachenonstop.xml:
Saturday, May 1, 2010
A Couple Minutes With Terracotta Toolkit Nightly
- Downloaded the nightly and unpacked
- Grabbed a quick sample app
import org.terracotta.api.ClusteringToolkit;
import org.terracotta.api.TerracottaClient;
import org.terracotta.coordination.Barrier;
public class PlayingWithExpressBarrier {
public static void main(String[] args) {
final String barrierName = args[0];
final int numberOfParties = Integer.parseInt(args[1]);
//Start the Terracotta client
ClusteringToolkit clustering = new TerracottaClient(
"localhost:9510").getToolkit();
//Get an instance of a barrier by name
Barrier barrier = clustering.getBarrier(barrierName,
numberOfParties);
try {
System.out.println("Waiting ...");
int index = barrier.await();
System.out.println("... finished " + index);
} catch (Exception e) {
e.printStackTrace();
}
}
}
- I worked in eclipse so at this point all I had to do is add the toolkit jar to the classpath to get it to compile
- Now kickoff the Terracotta server
- And run the sample 3 time
Thursday, April 29, 2010
Countdown To The Terracotta Toolkit Beta
- Ease of use is paramount - For both the developers that leverage the Terracotta toolkit and the people who use the stuff built using the Terracotta toolkit
- Stable API matters - We are building a compatibility kit and will maintain a strict and clear versioning scheme so that framework developers can rely on and clearly know what versions of Terracotta can work with the API version used in the application. Your users can just drop in any version of the terracotta-toolkit.jar that implements the version of the API you coded against.
- Parts is Parts - Get all the useful parts we use to build our products packaged and out for others to use.
- Scale Continuum - The parts should work both clustered and unclustered continuing our vision of a scale continuum.
Monday, April 26, 2010
Dave Klein's Scale Grails Webinar
Thursday, April 22, 2010
<terracotta clustered="true"/>
Tuesday, April 20, 2010
Ehcache 2.1 Beta - Lots of Stuff, Still Backward Compatible
- Build on our vision of an application scale continuum from one node to the cloud.
- Improve Ehcache performance both unclustered and clustered.
- Improve Ehcache applicability for both unclustered and clustered.
- The Explicit Locking Module - This module allows you to acquire and release locks manually for given keys. It required some significant rework in the unclustered stores but this now works just as well unclustered as it does clustered supporting fully coherent operations.
- JTA - In 2.0 of Ehcache we added JTA support when clustered via Terracotta. In 2.1 we extended that functionality to unclustered and have begun the process of performance tuning to go along with its XA compliance.
- JTA for Hibernate Second Level Cache - We added support for using Ehcache JTA in a second level cache both clustered and unclustered.
- UnlockedReadsView - This is a subtle but important feature. For those who are using a coherent cache but have some part of an application that needs to be able to read at high rates without impacting the rest of the cache this view is a huge help.
- NonStopCache - Useful for guaranteeing that your cache can never stop your application. On a per cache basis an application can avoid holdups caused by problems such as a slow disk in an unclustered cache or a network outage in a clustered one.
- New Coherent methods - We've added useful methods like putIfAbsent and replace to simply and easily work with a clustered or unclustered cache in a fully coherent manner. Together with the explicit locking wrapper much is possible.
- We also added a bunch of tests and bug fixes to the web-cache, an extremely useful tool for making performant web applications.