<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ALTERthought Blogs &#187; Terracotta</title>
	<atom:link href="http://alterlabs.com/category/technologies/terracotta/feed/" rel="self" type="application/rss+xml" />
	<link>http://alterlabs.com</link>
	<description>Results through imagination</description>
	<lastBuildDate>Tue, 13 Apr 2010 19:19:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Terracotta Plugin for Grails</title>
		<link>http://alterlabs.com/technologies/java/terracotta-plugin-for-grails/</link>
		<comments>http://alterlabs.com/technologies/java/terracotta-plugin-for-grails/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 15:29:21 +0000</pubDate>
		<dc:creator>Vincent Jorrand</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Groovy/Grails]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Terracotta]]></category>

		<guid isPermaLink="false">http://alterlabs.com/technologies/java/terracotta-plugin-for-grails/</guid>
		<description><![CDATA[I have created a new Grails Plugin to help in the development of Grails applications clustered using Terracotta. The details of this plugin can also be found at http://www.grails.org/Terracotta+Plugin.
Terracotta is a Java infrastructure that allows you to scale your application by clustering JVMs.
Features

Generation of a terracotta configuration file
Generation of terracotta enabled start up scripts for [...]]]></description>
			<content:encoded><![CDATA[<p>I have created a new <a href="http://www.grails.org/">Grails</a> Plugin to help in the development of Grails applications clustered using Terracotta. The details of this plugin can also be found at <a href="http://www.grails.org/Terracotta+Plugin">http://www.grails.org/Terracotta+Plugin</a>.<br />
<a href="http://www.terracotta.org/">Terracotta</a> is a Java infrastructure that allows you to scale your application by clustering JVMs.</p>
<p><strong>Features</strong></p>
<ul style="font-size: 12px">
<li>Generation of a terracotta configuration file</li>
<li>Generation of terracotta enabled start up scripts for containers</li>
</ul>
<p><span id="more-100"></span></p>
<p><strong>Installation</strong><br />
<code>grails install-plugin terracotta</code></p>
<p><strong>Usage</strong><br />
Install the plugin<br />
Run the start up script generation task<br />
Run the terracotta configuration generation task<br />
generate a war for the application and deploy in a container<br />
start the terracotta server(s)<br />
start the application servers</p>
<p><strong>Components</strong><br />
Generate<em>&lt;ContainerName&gt;</em>Script: Generate the start up script for an application server<br />
GenerateTcConfig: Generate the tc-config.xml file for terracotta</p>
<p><strong>Generate<em>&lt;ContainerName&gt;</em>Script</strong><br />
Currently only 2 containers are supported: jboss and tomcat.</p>
<p>Edit TerracottaConfig.properties to set the parameters for the start up scripts:<br />
The terracotta install directory on the target jboss or tomcat server:<br />
<code>terracotta.install.dir</code><br />
The path place where the tc.config.xml will be made available to on the servers (this plugin does not remote copy it you have to do that):<br />
<code>terracotta.config.path</code></p>
<p>Run:<br />
<code>grails generate-jboss-scripts</code></p>
<p>Copy the generated scripts in the startup script folders of the containers. You will later start the containers using these scripts instead of standard ones.</p>
<p><strong>GenerateTcConfig</strong><br />
Generates the tc-config.xml required to run a terracotta enabled container.<br />
It enables the clustering of all the domain classes defined in the project and allows to add any additional classes to be made clusterable by including a user defined xml segment.<br />
It also clusters the http sessions across the container instances for your application.</p>
<p>Edit TerracottaConfig.properties to set the host names and ports for the terracotta servers to be used by the application.</p>
<p>Edit CustomIncludes.xml to specify any additional terracotta include rules required by your application.</p>
<p>Run:<br />
<code>grails generate-tc-config</code></p>
<p>Copy the generated file on each container server, in the location specified when generating the container start up scripts.</p>
<p><strong>Running the Clustered Application</strong><br />
Deploy your application on all the container instances.<br />
Start the terracotta server(s)<br />
Start the containers using the generated start up scripts. (Note that you will need a form of load balancing to witness the effects of the clustering, I used Apache with mod_jk)</p>
<p><strong>Fun Note</strong><br />
Start one only one node of your cluster. Start a session (log in your app, &#8230;). Stop that server instance, then start another one. Continue using your application without losing your session!</p>
<p><strong>Looking Ahead</strong><br />
Future enhancements include support for more containers (easy), and support for running terracotta in development mode (more complex).</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/Terracotta" rel="tag"> Terracotta</a>, <a href="http://technorati.com/tag/Grails" rel="tag"> Grails</a>, <a href="http://technorati.com/tag/Scalability" rel="tag"> Scalability</a>, <a href="http://technorati.com/tag/Java" rel="tag"> Java</a>, <a href="http://technorati.com/tag/Clustering" rel="tag"> Clustering</a></p>
   ]]></content:encoded>
			<wfw:commentRss>http://alterlabs.com/technologies/java/terracotta-plugin-for-grails/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Terracotta</title>
		<link>http://alterlabs.com/technologies/java/terracotta/</link>
		<comments>http://alterlabs.com/technologies/java/terracotta/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 14:22:33 +0000</pubDate>
		<dc:creator>Vincent Jorrand</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Terracotta]]></category>

		<guid isPermaLink="false">http://alterlabs.com/uncategorized/terracotta/</guid>
		<description><![CDATA[I looked at Terracotta over the last few weeks. My goals were to understand what it does and how it could be helpful to us in the future. To achieve these goals, while evaluating it I always related it back to past projects to look at how terracotta could have been helpful those.
What I found [...]]]></description>
			<content:encoded><![CDATA[<p>I looked at <a title="Terracotta" href="http://www.terracottatech.com/">Terracotta</a> over the last few weeks. My goals were to understand what it does and how it could be helpful to us in the future. To achieve these goals, while evaluating it I always related it back to past projects to look at how terracotta could have been helpful those.</p>
<p>What I found is that it could have helped us in at least 4 different ways.<br />
<span id="more-91"></span><br />
<strong>Session Clustering</strong><br />
The lowest hanging fruit is the ability of terracotta to be used as a session clustering solution. The beauty of it is that it can be done with NO change to the application code. I was able to enable terracotta management of the sessions for our  <a title="Oyogi" href="http://corp.oyogi.com/">Oyogi</a> application without changing a line of its source code. In fact I did not even recompile it, I only created the terracotta configuration and edited the the JBoss start scripts as described in the <a title="JBoss Application Server Quick Start" href="http://www.terracotta.org/confluence/display/howto/JBoss+Application+Server+Quick+Start">Quick Start</a>.<br />
Terracotta can be used in that way for all the major web containers: Tomcat, Jetty, JBoss, BEA WebLogic, IBM WebSphere, Glassfish and Geronimo.</p>
<p><strong>Global Singleton</strong><br />
Terracotta provides the ability to turn traditional (single JVM) singletons into terracotta cluster wide singletons. Those are not &#8220;real&#8221; singletons as one instance exists on each JVM clustered by terracotta, but they can behave in all manners just like if there was really a single instance shared by all the JVMs. This can also be easily applied to <a title="spring" href="http://www.springframework.org/">Spring</a> beans thanks to the Terracotta for Spring.</p>
<p><strong>Keep Transient Data Transient</strong><br />
This is where I believe terracotta can have the most unique impact, but it also is where the application structure is directly impacted by the usage of Terracotta. In many applications data that is transient in nature but needs to be shared between JVM instances ends up being stored in the database. Terracotta allows us to keep this data in the Java heap and cluster it. This approach can also in some cases replace the usage of queuing infrastructure (such as JMS) between a producer and a consumer.<br />
Taking full advantage of this requires some changes in the application code, but those changes result in simpler solution. The code is modified to use objects in the heap directly instead of retrieving data from a database (and write to objects in the heap instead of update/insert in a database). A core benefit of this approach is to offload work from the databases and let them do what they are designed to do: store and retrieve persistent data.</p>
<p><strong>Hibernate Second Level Cache</strong><br />
Terracotta provide support for Hibernate from multiple perspectives. First it supports basic Hibernate object clustering: a data object retrieved through hibernate can have it&#8217;s lazily read attributes read from any node in the Terracotta cluster. Second it provides clustering of Hibernate detached objects (data objects no kept after the end of the database session). Finally and most importantly it provides support for clustering the use of EHCache as a Hibernate Second Level Cache.<br />
Like the session clustering solution this usage of Terracotta can be completely transparent to the application. An single JVM application should be possible to deploy across multiple JVMs clustered by Terracotta with no changes to the application itself.</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/Terracotta" rel="tag"> Terracotta</a>, <a href="http://technorati.com/tag/Hibernate" rel="tag"> Hibernate</a>, <a href="http://technorati.com/tag/Scalability" rel="tag"> Scalability</a>, <a href="http://technorati.com/tag/Java" rel="tag"> Java</a>, <a href="http://technorati.com/tag/Clustering" rel="tag"> Clustering</a></p>
   ]]></content:encoded>
			<wfw:commentRss>http://alterlabs.com/technologies/java/terracotta/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
