<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Cirrus Minor</title>
	
	<link>http://arnon.me</link>
	<description>Musings of a holistic architect by Arnon Rotem-Gal-Oz</description>
	<lastBuildDate>Mon, 05 Dec 2011 19:37:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/CirrusMinor" /><feedburner:info uri="cirrusminor" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>REST with JAX-RS and silverlight clients</title>
		<link>http://feedproxy.google.com/~r/CirrusMinor/~3/pGLG4JMzbFU/</link>
		<comments>http://arnon.me/2011/12/rest-jaxrs-silverlight-clients/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 19:37:26 +0000</pubDate>
		<dc:creator>Arnon Rotem-Gal-Oz</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JAX-RS]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://arnon.me/?p=556</guid>
		<description><![CDATA[I am Working on a RESTful  service using Jersey (not my first choice, but a reasonable compromise). It is hosted inside FuseESBand all is well. Here&#8217;s an overly simplified version of the resource that reports status: 1 2 3 4 5 6 7 8 9 10 11 @Path&#40;&#34;/stat&#34;&#41; public class StatusResource &#123; @GET @Produces&#40;MediaType.TEXT_PLAIN&#41; public String [...]]]></description>
			<content:encoded><![CDATA[<p>I am Working on a RESTful  service using <a href="http://jersey.java.net/">Jersey</a> (not my first choice, but a reasonable compromise). It is hosted inside <a href="http://fusesource.com/products/enterprise-servicemix/">FuseESB</a>and all is well. Here&#8217;s an overly simplified version of the resource that reports status:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">@Path<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/stat&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> StatusResource <span style="color: #009900;">&#123;</span>
    @GET
    @Produces<span style="color: #009900;">&#40;</span>MediaType.<span style="color: #006633;">TEXT_PLAIN</span><span style="color: #009900;">&#41;</span>
      <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getStatus<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>checkStatus<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #0000ff;">&quot;Ok&quot;</span><span style="color: #339933;">;</span>
         <span style="color: #000000; font-weight: bold;">else</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #0000ff;">&quot;Not so good&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Then we tried to connect a silverlight client to this server (don&#8217;t ask me why).  The first hurdle was a security one. Silverlight doesn&#8217;t like to communicate with a server it didn&#8217;t launch from. To resolve that you need to <a href="http://msdn.microsoft.com/en-us/library/cc197955(v=vs.95).aspx">add a ClientAccessPolicy.xml to the root of your domain</a>to allow cross-domain access. Here&#8217;s a simple all-permissive version of it:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">@Path<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;clientaccesspolicy.xml&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ClientAccessPolicyResource <span style="color: #009900;">&#123;</span>
    @GET
    @Produces<span style="color: #009900;">&#40;</span>MediaType.<span style="color: #006633;">APPLICATION_XML</span><span style="color: #009900;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getStatus<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #0000ff;">&quot;&lt;?xml version=<span style="color: #000099; font-weight: bold;">\&quot;</span>1.0<span style="color: #000099; font-weight: bold;">\&quot;</span> encoding=<span style="color: #000099; font-weight: bold;">\&quot;</span>utf-8<span style="color: #000099; font-weight: bold;">\&quot;</span>?&gt;&lt;access-policy&gt;&lt;cross-domain-access&gt;&lt;policy&gt; &lt;allow-from http-request-headers=<span style="color: #000099; font-weight: bold;">\&quot;</span>*<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;domain uri=<span style="color: #000099; font-weight: bold;">\&quot;</span>*<span style="color: #000099; font-weight: bold;">\&quot;</span>/&gt;&lt;/allow-from&gt; &lt;grant-to&gt; &lt;resource path=<span style="color: #000099; font-weight: bold;">\&quot;</span>/<span style="color: #000099; font-weight: bold;">\&quot;</span> include-subpaths=<span style="color: #000099; font-weight: bold;">\&quot;</span>true<span style="color: #000099; font-weight: bold;">\&quot;</span>/&gt;&quot;</span><span style="color: #339933;">+</span>
     <span style="color: #0000ff;">&quot; &lt;/grant-to&gt;&lt;/policy&gt;&lt;policy &gt;&lt;allow-from http-methods=<span style="color: #000099; font-weight: bold;">\&quot;</span>*<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;domain uri=<span style="color: #000099; font-weight: bold;">\&quot;</span>*<span style="color: #000099; font-weight: bold;">\&quot;</span>/&gt;&lt;/allow-from&gt;&lt;grant-to&gt;&quot;</span><span style="color: #339933;">+</span>
      <span style="color: #0000ff;">&quot;&lt;resource path=<span style="color: #000099; font-weight: bold;">\&quot;</span>/<span style="color: #000099; font-weight: bold;">\&quot;</span> include-subpaths=<span style="color: #000099; font-weight: bold;">\&quot;</span>true<span style="color: #000099; font-weight: bold;">\&quot;</span>/&gt; &lt;/grant-to&gt;&lt;/policy&gt;&lt;/cross-domain-access&gt;&lt;/access-policy&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>By the way &#8211; since silverlight is entirely a client technology you can also serve it from the Java web server (<a href="http://www.tomcatexpert.com/tags/tomcat-silverlight">as long as you emit the right mime-type </a>) in which case you don&#8217;t need the cross-domain policy mentioned above.</p>
<p>Another interesting phenomena we saw was that the client only got the response once. no matter how many times we polled the server. We ran fiddler and saw that no request are in fact going out to the server &#8211; it was the browser&#8217;s (IE8) cache that was holding us back. It took me some head scratching as to how to solve this &#8211; but the solution is pretty simple &#8211; return an &#8216;expires&#8221; http header from the server to make sure the browser will only cache the result for a limited time. To do that with jersey you need to return a Response object instead of the text (or JSON/HTML etc.)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">@Path<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;stat&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> StatusResource <span style="color: #009900;">&#123;</span>
&nbsp;
    @GET @Produces<span style="color: #009900;">&#40;</span>MediaType.<span style="color: #006633;">TEXT_PLAIN</span><span style="color: #009900;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">public</span> Response getStatus<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        Response.<span style="color: #006633;">ResponseBuilder</span> response <span style="color: #339933;">=</span> Response.<span style="color: #006633;">ok</span><span style="color: #009900;">&#40;</span>checkStatus<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #003399;">Date</span> expirationDate <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Date</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">System</span>.<span style="color: #006633;">currentTimeMillis</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> maxCacheInterval<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    response.<span style="color: #006633;">expires</span><span style="color: #009900;">&#40;</span>expirationDate<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #000000; font-weight: bold;">return</span> response.<span style="color: #006633;">build</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>While I think Silverlight is a technology on its way out. It is still around. It is nice to know that with a couple of simple moves you can get it to play nice even with a Java backend</p>
<hr />
<p>Illustration by <a href="http://www.sxc.hu/photo/1342301">arinas74</a></p>
<script src="http://feeds.feedburner.com/~s/arnonrgo?i=http://arnon.me/2011/12/rest-jaxrs-silverlight-clients/" type="text/javascript" charset="utf-8"></script><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=pGLG4JMzbFU:JR2sMRjSg4g:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=pGLG4JMzbFU:JR2sMRjSg4g:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=pGLG4JMzbFU:JR2sMRjSg4g:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=pGLG4JMzbFU:JR2sMRjSg4g:G79ilh31hkQ"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=G79ilh31hkQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=pGLG4JMzbFU:JR2sMRjSg4g:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=pGLG4JMzbFU:JR2sMRjSg4g:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=pGLG4JMzbFU:JR2sMRjSg4g:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=pGLG4JMzbFU:JR2sMRjSg4g:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=pGLG4JMzbFU:JR2sMRjSg4g:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=pGLG4JMzbFU:JR2sMRjSg4g:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=pGLG4JMzbFU:JR2sMRjSg4g:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=pGLG4JMzbFU:JR2sMRjSg4g:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CirrusMinor/~4/pGLG4JMzbFU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://arnon.me/2011/12/rest-jaxrs-silverlight-clients/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://arnon.me/2011/12/rest-jaxrs-silverlight-clients/</feedburner:origLink></item>
		<item>
		<title>SOA Patterns : Composite Frontend (PDF)</title>
		<link>http://feedproxy.google.com/~r/CirrusMinor/~3/be7Vk0N_0_U/</link>
		<comments>http://arnon.me/2011/10/soa-patterns-composite-frontend-pdf/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 18:26:58 +0000</pubDate>
		<dc:creator>Arnon Rotem-Gal-Oz</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[SOA Patterns]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Patterns]]></category>
		<category><![CDATA[Service Oriented Architecture]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Software Architecture]]></category>

		<guid isPermaLink="false">http://arnon.me/?p=544</guid>
		<description><![CDATA[I got a few request for a PDF version of the pattern so here it is :  Composite Frontend Pattern]]></description>
			<content:encoded><![CDATA[<p>I got a few request for a PDF version of the pattern so here it is :  <a href="http://arnon.me/wp-content/uploads/2011/10/Composite-Frontend.pdf">Composite Frontend</a> Pattern</p>
<script src="http://feeds.feedburner.com/~s/arnonrgo?i=http://arnon.me/2011/10/soa-patterns-composite-frontend-pdf/" type="text/javascript" charset="utf-8"></script><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=be7Vk0N_0_U:GLU1PUs0Rwo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=be7Vk0N_0_U:GLU1PUs0Rwo:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=be7Vk0N_0_U:GLU1PUs0Rwo:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=be7Vk0N_0_U:GLU1PUs0Rwo:G79ilh31hkQ"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=G79ilh31hkQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=be7Vk0N_0_U:GLU1PUs0Rwo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=be7Vk0N_0_U:GLU1PUs0Rwo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=be7Vk0N_0_U:GLU1PUs0Rwo:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=be7Vk0N_0_U:GLU1PUs0Rwo:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=be7Vk0N_0_U:GLU1PUs0Rwo:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=be7Vk0N_0_U:GLU1PUs0Rwo:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=be7Vk0N_0_U:GLU1PUs0Rwo:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=be7Vk0N_0_U:GLU1PUs0Rwo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CirrusMinor/~4/be7Vk0N_0_U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://arnon.me/2011/10/soa-patterns-composite-frontend-pdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://arnon.me/2011/10/soa-patterns-composite-frontend-pdf/</feedburner:origLink></item>
		<item>
		<title>SOA Patterns : Composite Frontend</title>
		<link>http://feedproxy.google.com/~r/CirrusMinor/~3/K6BarDmPI4Y/</link>
		<comments>http://arnon.me/2011/10/soa-patterns-composite-frontend/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 06:02:40 +0000</pubDate>
		<dc:creator>Arnon Rotem-Gal-Oz</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Featured Posts]]></category>
		<category><![CDATA[SOA Patterns]]></category>
		<category><![CDATA[service consumers]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[soa patterns]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://arnon.me/?p=523</guid>
		<description><![CDATA[I am not blogging much these days &#8211; most of it is due to trying to get my bloody book finished. A case study and a finished anti-pattern chapter where recently pushed to the MEAP, and here&#8217;s one additional pattern from chapter 6 (service consumer patterns): When we try to think about service consumers, the [...]]]></description>
			<content:encoded><![CDATA[<p>I am not blogging much these days &#8211; most of it is due to trying to get my bloody book finished. A case study and a finished anti-pattern chapter where recently pushed <a href="http://www.manning.com/rotem/">to the MEAP</a>, and here&#8217;s one additional pattern from chapter 6 (service consumer patterns):</p>
<p>When we try to think about service consumers, the obvious candidates are, of course, other services. Nevertheless there are other software components that interact with services e.g. legacy systems,  Non-SOA external systems or reporting databases. The Composite Frontend pattern deals with yet another type of service consumer – the User interface.</p>
<p>&nbsp;</p>
<p>First let just verify that User interfaces aren’t in fact services. One reason user interfaces are not services is that they converge several business areas e.g. if you want to enter an order you’d probably also want to lookup information about the customer, maybe you’d also want to browse the product catalog, look at open invoices etc. In addition to convergence, user interfaces deliver data rather than process it. User interfaces are data producers (actually there’s one exception to that – where the UI is the front of a “human service” see orchestrated choreography pattern (in chapter 7) for more details.</p>
<p>&nbsp;</p>
<p>Ok, so UIs aren’t services, does it matter? Well, it does and the problem is not that UIs aren’t services per se. The main challenge caused by user interfaces comes from their main difference i.e. the aggregation or convergence of several services into a cohesive and useful UI.</p>
<p>&nbsp;</p>
<p>6.1.1      The Problem</p>
<p>To better understand the challenges caused by user interface working with multiple services, let’s consider an example with just a single point of friction.</p>
<p>&nbsp;</p>
<p>In a project I worked on we’ve designed the C4ISR (Command, Control, Communications, Computers, Intelligence, Surveillance and Reconnaissance) system for an Unmanned Naval Patrol Vehicle (UNPV). One of the services in the system was dubbed “Common Operational Picture” or COP for short. The COP ‘s responsibility was to handle anything that is detected by sensors e.g. ships, planes, whatever (There’s technical jargon for all that like targets, detections, tracks etc. but that’s not important here). One of the main UI representations of the COP was a map ,such as the one in figure 6.4 below, which showed all the detections. Clicking on map icon, say a ship, presents some information the COP knows about it, such as id, nationality, course  etc.</p>
<p style="padding-left: 30px; text-align: center;" align="center"><a href="http://arnon.me/wp-content/uploads/2011/10/6.4.png"><img class="aligncenter size-full wp-image-530" title="6.4" src="http://arnon.me/wp-content/uploads/2011/10/6.4.png" alt="" width="401" height="268" /></a> <span style="text-align: -webkit-auto;">Figure 6.4 A simplified  illustration of a  front end for a “Common Operational Picture” service of a naval command and control system. We see a shore line and then using NATO symbology: 2 radars, a submarine and an a ship (the Unmanned Naval Patrol Vehicle)</span></p>
<p>&nbsp;</p>
<p>The system had a few other services in addition to the COP, amongst them there was the “UNPV service”. The UNPV service was responsible for anything related to the UNPV itself for instance, setting it on a navigation course, turning it around, etc. The UNPV service had several UI screens to allow managing and monitoring these functions. Another responsibility of the UNPV service was to send its location to the COP (locations are the COP’s responsibility, remember?) so back in the UI, one of the icons of the map is that of the UNPV.</p>
<p>&nbsp;</p>
<p>What happens when a user clicks on the UNPV icon on the map?  Remember, while the desired outcome is to display a popup with options related to controlling the UNPV, the click is on the map, a control serviced by another service (the COP). In an Object Oriented system the UNPV might be a sub-class of a detection so that it would accept the same event and respond a little differently (in a more specialized way). Here, however the COP and the UNPV are completely different services, developed by two different group and maybe even two different companies.</p>
<p>&nbsp;</p>
<p>We may be able to dismiss this specific example and just solve it with a specific solution e.g add an ‘if’ statement somewhere to call up the correct commands and to interact with the correct service(s). The problem, however, is that this example is just the tip of the iceberg. For instance: how do we handle security? – do we need to login for each service separately? How do we handle things that all the services need? SOA’s premise is that we’d get a sort of lego-like enterprise where we can compose different business processes easily. Is there any way  we can get that in the  user interface? In summary:</p>
<p>&nbsp;</p>
<blockquote><p><strong>How do you we interact with multiple services, get an integrated, cohesive user interface and still preserve SOA principles and modularity benefits?</strong></p>
<p>&nbsp;</p></blockquote>
<p>One option is, as mentioned above, write specific client code. Using this approach “an application”, is any specific composition of services. For the example above, the application would include the two service (COP and UNPV) and a UI that ties them together. The up-side of this approach is that each application delivers a consistent experience for the user. After all, a specific or tailored application can be made to be very cohesive. Additionally there are many tried and tested ways to build flexible UIs with a proper separation of concerns, e.g. using Model-View-Controller and its variations (in a multitude of rich client and web technologies) so we’d probably be able to reuse some of the UI-side logic even going  from application to application. Nevertheless, we do lose on flexibility. For one, any service change that has UI aspects needs to be redone for each of its UI instances (applications). More so, since the UI specifically ties multiple services changes in one service may cause another to mal-function within the unified UI. We also lose on Composability, or the ability to replace services and to create new business flows (relatively) easy. Overall it’s a bad option long-term but it can be made to work as a short term solution.</p>
<p>A related option is taking a similar approach of tying several services together but instead of integrating them on the client side we integrate the services together on the server side. This approach shares it pros and cons with the previous solution. However there are specific circumstances where it does make sense and you can read about them in the next pattern (section 6.5 Client/Server/Service)</p>
<p>Lastly, we have the option to have independent UI components per service. This would overcome the limitations we’ve mentioned above since each service’s corresponding UI can evolve independently and you can just cram a as many of these as you like to create an application. Unfortunately, with all its benefits this is a non even an option here as, by definition, we won’t have the mechanisms for UI components that work cross services. i.e. it won’t actually solve problems like the one in the example and we can’t get a cohesive UI.</p>
<p>&nbsp;</p>
<p>6.1.2      The Solution</p>
<p>What we need, essentially, is a way to compose services together while keeping their respective autonomy on one hand and providing mechanisms to glue them together as a cohesive whole – That’s what the Composite Frontend pattern is about:</p>
<p>&nbsp;</p>
<blockquote><p><strong>Apply the Composite Frontend pattern to aggregate services while providing them unified client-side services like layout and theming as well as coordination services for client-side service integration</strong></p></blockquote>
<p>&nbsp;</p>
<p style="padding-left: 30px; text-align: center;"><a href="http://arnon.me/wp-content/uploads/2011/10/6.5.png"><img class="aligncenter size-full wp-image-529" title="6.5" src="http://arnon.me/wp-content/uploads/2011/10/6.5.png" alt="" width="502" height="266" /></a></p>
<p style="padding-left: 30px;">Figure 6.5 The Composite Frontend pattern. Each Service has a Portlet which is a Service Agent combined with a UI logic (most likely Model in a MVC UI pattern). The UI host provides services for the different potlets to weave them together into a coherent UI.</p>
<p>The Composite Frontend pattern is about taking the ideas (and sometimes the technologies) behind web portal and applying them to SOA services. Web portals provide unified access point that aggregates multiple web pages. They also provide single sign-one and personalization. SOA interfaces need that and more.</p>
<p>The composite front-end pattern is composed of two main components: the portlet and the host. The portlets are the building blocks, “the composites” which are fused together to form the user interface. The portlets are made of at least two components. The user interface logic (views and controllers in MVC lingo). The second component, the service proxy (or agent) , is the more interesting one from an SOA perspective. The service proxy is a client-side representation of a service. The proxy serves as the model for the user interfaces components. It is usually recommended to have a single proxy per service -just like it is recommended for each service to maintain its own data store. Furthermore, from a product management perspective it can be seen as  part of the service itself</p>
<p>&nbsp;</p>
<p>The host is the “value-add” part of the composite frontend pattern. The host provides the glue that ties the different portlets into a cohesive whole. As such, the host provides  several roles. Firstly it provides the canvas or surface on which the portlets are displayed. Additionally it controls the life-cycle of the portlets and lastly it provides capabilities (avoiding the loaded term services&#8230;)  like inter-portlet communications and single-sign-on.</p>
<p>&nbsp;</p>
<p>Lets revisit the problem discussed in the previous section. We had a right-click on a ui component, which should have produced a context menu with options from two services. How would that would with the composite frontend pattern? One option is that a click would be first intercepted by the host which would then dispatch it to any registered portlet. Another option illustrated in figure 6.6 below , is for the click to  be intercepted by the first portlet the Common Operation Picture (or COP), have it notify the host and have the host ask all the iixnvolved portlets to render the right-click menu. The COP portlet should pass enough information as part of the event for the other porlets to be able to do something meaningful with.</p>
<p style="padding-left: 30px; text-align: center;"><a href="http://arnon.me/wp-content/uploads/2011/10/6.6.png"><img class="aligncenter size-full wp-image-528" title="6.6" src="http://arnon.me/wp-content/uploads/2011/10/6.6.png" alt="" width="366" height="284" /></a>Figure 6.6: Sample event flow in a Composite Frontend. Events are intercepted by the user interface components of individuals portlets , The events are transferred to the host which dispatches them to registered protlets for handling. The host can then render the results for display</p>
<p>The composite frontend pattern is a service consumer pattern so the proxy will utilize the various service interaction patterns like saga, request/reply etc. (see chapter 5) and it can benefit from the various service composition patterns like Service Registry and Servicbus (see chapter 7)</p>
<p>You’ve probably notices the use of the term portlets to describe the service agents and you might be wondering why the pattern is named Composite Frontend rather than Portal. The main reason for that is that the pattern can also be used with rich client implementations and not just web ones – let’s explore that further in the technology mapping section</p>
<p>&nbsp;</p>
<p>6.1.3      Technology Mapping</p>
<p>Normally, you’d won’t be developing your own Composite Frontend container and instead use existing products that provide the framework and usually the tooling to help build the portlets.</p>
<p>The obvious example for that are web portal frameworks. Modern enterprise web portals usually support anything from JSR 168/286 (Java Portlet specification) to  WSRP (Web Services for Remote Portlet) to open web standards like RSS, plain REST services or standards like open social.  There are a lot of products in this area both commercial like  ibm WebSphere portal server and Microsoft Sharepoint and open source options like Jboss Gatein and Lifray.  Figure 6.7 below show he layout functionality of the UI host as it is implemented in Jboss Gatein</p>
<p style="text-align: center;"><a href="http://arnon.me/wp-content/uploads/2011/10/6.7.png"><img class="aligncenter size-full wp-image-527" title="6.7" src="http://arnon.me/wp-content/uploads/2011/10/6.7.png" alt="" width="473" height="288" /></a></p>
<p style="padding-left: 30px;">Figure 6.7: The layout capability of a Composite Frontend UI host as it is implemented in Jboss Gatein portal.</p>
<p>Web portals are not the only option for implementing composite frontends. You can also implement the concept for desktop (“rich client”) applications. An example for that is the prism framework made by Microsoft’s Pattern and Practices group. Prism implements the Composite Frontend pattern for both Silverlight and WPF applications. Prism provides all the functionality of a user interface host and lets you write portlets that consume these capabilities. Code snippet 6.4 below demonstrate using an EventAggregator facility that allows inter-portlet communications (such as the one needed for the sample scenario in the map component example above):</p>
<p>Code listing 6.4 Sample use of Prism’s EventAggregator to send events between different porlets unified by the prism shell</p>
<p>&nbsp;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&#91;</span>Export<span style="color: #008000;">&#40;</span><span style="color: #008000;">typeof</span><span style="color: #008000;">&#40;</span>SampleView<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">partial</span> <span style="color: #6666cc; font-weight: bold;">class</span> SampleView <span style="color: #008000;">:</span> UserControl
<span style="color: #008000;">&#123;</span>
   <span style="color: #008000;">&#91;</span>ImportingConstructor<span style="color: #008000;">&#93;</span>
   <span style="color: #0600FF; font-weight: bold;">public</span> SampleView<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#91;</span>Import<span style="color: #008000;">&#93;</span> IEventAggregator eventAggregator
   <span style="color: #008000;">&#123;</span>
       InitializeComponent<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
       eventAggregator<span style="color: #008000;">.</span><span style="color: #0000FF;">GetEvent</span><span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Subscribe</span><span style="color: #008000;">&#40;</span>OnItemSelectedReceived<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #008080;">#1</span>
   <span style="color: #008000;">&#125;</span>
   <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> ItemSelectedReceived<span style="color: #008000;">&#40;</span>ItemSelectedEvent item<span style="color: #008000;">&#41;</span>
   <span style="color: #008000;">&#123;</span>
     <span style="color: #008080; font-style: italic;">//do something with item...</span>
   <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>#1 subscribing to an temSelectedEvent. Another portlet can call get on the EventAggregator to get a reference to the event and raise it without knowing if thare are any subscribers</p>
<p>&nbsp;</p>
<p>Lastly, in addition to web portal frameworks and desktop framework you can roll your own implementation of Composite Frontend. however, as mentioned above it is usually better to  choose one of the available options as it quite an investment to get it right.</p>
<p>6.1.4      Quality Attributes</p>
<p>Before moving on to the next pattern lets examine some business drives (or scenarios) that can drive us to use the Composite Frontend pattern.</p>
<p>In essence, the main drives to Composite Frontend are flexibility to adding and changing services and the desire for an integrated user interface that feels as a whole Table 6.X provides examples for both quality attributes:</p>
<p>&nbsp;</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="122">
<div>
<p>Quality Attribute (level1)</p>
</div>
</td>
<td valign="top" width="126">
<div>
<p>Quality Attribute (level2)</p>
</div>
</td>
<td valign="top" width="123">
<div>
<p>Sample Scenario</p>
</div>
</td>
</tr>
<tr>
<td valign="top" width="122">Usability</td>
<td valign="top" width="126">Operability</td>
<td valign="top" width="123">Under normal system use end user wants to achieve business tasks fluently. System should reuse entered data (like personal details) between different tasks</td>
</tr>
<tr>
<td valign="top" width="122">Flexibility</td>
<td valign="top" width="126">Changability</td>
<td valign="top" width="123">Under normal conditions, changing the billing process to support a new  credit card clearance provider, should take less than one week</td>
</tr>
</tbody>
</table>
<p>Table 6.3  composite frontend  pattern quality attributes scenarios. These are the architectural scenarios that can make us think about using composite frontend pattern.</p>
<p>&nbsp;</p>
<p>Composite Frontend is probably the preferred way to provide an SOA user interface. However one problem we still have to solve with integrating UIs is UIs that are not SOA aware – for instance what happens when we have an existing UI that we want to expose to services? The next pattern will try to answer exactly that.</p>
<script src="http://feeds.feedburner.com/~s/arnonrgo?i=http://arnon.me/2011/10/soa-patterns-composite-frontend/" type="text/javascript" charset="utf-8"></script><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=K6BarDmPI4Y:oGwgCBeUCnE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=K6BarDmPI4Y:oGwgCBeUCnE:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=K6BarDmPI4Y:oGwgCBeUCnE:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=K6BarDmPI4Y:oGwgCBeUCnE:G79ilh31hkQ"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=G79ilh31hkQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=K6BarDmPI4Y:oGwgCBeUCnE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=K6BarDmPI4Y:oGwgCBeUCnE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=K6BarDmPI4Y:oGwgCBeUCnE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=K6BarDmPI4Y:oGwgCBeUCnE:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=K6BarDmPI4Y:oGwgCBeUCnE:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=K6BarDmPI4Y:oGwgCBeUCnE:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=K6BarDmPI4Y:oGwgCBeUCnE:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=K6BarDmPI4Y:oGwgCBeUCnE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CirrusMinor/~4/K6BarDmPI4Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://arnon.me/2011/10/soa-patterns-composite-frontend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://arnon.me/2011/10/soa-patterns-composite-frontend/</feedburner:origLink></item>
		<item>
		<title>HP’s enterprise play</title>
		<link>http://feedproxy.google.com/~r/CirrusMinor/~3/zh_IccqO3ME/</link>
		<comments>http://arnon.me/2011/08/hp-bigdata/#comments</comments>
		<pubDate>Sun, 21 Aug 2011 21:03:25 +0000</pubDate>
		<dc:creator>Arnon Rotem-Gal-Oz</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Analytics]]></category>
		<category><![CDATA[Big Data]]></category>

		<guid isPermaLink="false">http://arnon.me/?p=510</guid>
		<description><![CDATA[The internet is ablaze with posts and articles on HPs abandonment of WebOS and the PC business. I don&#8217;t have a lot to add to this discussion (It&#8217;s a pity, I was considering a Pre3 device, blah blah). I am personally more interested in the last bit of their announcement that talked about the 10.3bn$ [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">The internet is ablaze with posts and articles on HPs abandonment of WebOS and the PC business. I don&#8217;t have a lot to add to this discussion (It&#8217;s a pity, I was considering a Pre3 device, blah blah). I am personally more interested in the last bit of their announcement that talked about the <a href="http://www.bloomberg.com/news/2011-08-18/hp-said-to-be-near-10-billion-autonomy-takeover-spinoff-of-pc-business.html">10.3bn$ acquisition </a>of <a href="http://www.autonomy.com/">Autonomy</a>. If we add this to <a href="http://www.hp.com/hpinfo/newsroom/press/2011/110214xb.html">HP&#8217;s acquisition of Vertica just 6 months ago</a> and the (supposedly )<a href="http://www.informationweek.com/articles/229401466">failed attempt to acquire Tibco</a> we can see HP is making a  play for the whole unstructured/big-data/analytics field.</p>
<p style="text-align: left;">Vertica is  a columnar database optimized for analytics. In a nut shell, columnar databases allow fast aggregation of  data as well as holding a lot of columns per row &#8211; both traits are helpful when trying to report on data (but vey wasteful when you try to do OLTP operations). Autonomy adds to that path analysis and related algorithms to provide insight from stored data. Add that to HP&#8217;s hardware capabilities and you can get a high-performance data appliances that can handle large amounts of data efficiently.</p>
<p style="text-align: left;">HP is not alone in this trend. We see similar moves by <a href="http://www.emc.com/about/news/press/2010/20100706-01.htm">EMC which acquired Greenplum</a> followed by  unified GreenPlum/Hadoop  SW-HW solution, IBM <a href="http://www-03.ibm.com/press/us/en/pressrelease/32955.wss">acquiring Netezza</a> and  rolling  its own Hadoop version, heck, even <a href="http://techcrunch.com/2011/03/03/teradata-buys-aster-data-263-million/">Teradata recently acquired Aster Data to bolster its analytics offering</a>. It&#8217;s almost like we&#8217;re back in the 1950&#8242;s with companies creating dedicated appliances instead of general purpose computers.</p>
<p style="text-align: left;">While Teradata, an NCR spinoff, pioneered this trend, I think Oracle&#8217;s introduction of Exadata popularized this trend. Oracle which is probably the leader could (and still can) be sold with any hardware. All of a sudden, with the acquisition of Sun, Oracle started to keep the high-end customers to itself. This was especially a blow to HP considering the first incarnation of exadata ran on HP&#8217;s hardware. Anyway, as we saw above, the big vendors* are rushing to build their own &#8220;complete software and hardware suits&#8221; and HP, it seems, is doing the same. By talking about dropping its PC business HP is trying to pull an IBM (and its Lenovo move) and focus on Enterprise solutions in general and the hot analytics market in particular</p>
<p style="text-align: left;">Meanwhile I am reading that <a href="http://www.zdnet.com/blog/btl/hps-touchpad-fire-sale-the-fallout/55594">HP servers are having trouble handling the demand for their tablet dumping </a>- I guess that&#8217;s also bad press to the cloud message of HP. I hope their analytics message and solutions will fare better</p>
<p style="text-align: left;">By the way, for now this is only interesting for larger corporations which are willing to spend the big bucks involved  (e.g. Vertica was priced at 100K$ per terabyte last time I checked). Smaller companies esp. SaaS provider, will probably still solve their big data problems with Hadoop, Cassandra and the like. However <a href="http://www.marketwatch.com/story/worlds-data-more-than-doubling-every-two-years-driving-big-data-opportunity-new-it-roles-2011-06-28">as data is more than doubling every two years</a> and as the top-tier market will get saturated, I am sure we&#8217;ll start seing offerings with more reasonable price-tags over the next few years.</p>
<hr />
<p style="text-align: left;">* You may have notices that Microsoft is missing from this list &#8211; MS is also making moves in this field with Parallel Data Warehouse and Dryad . Unlike the other&#8217;s they do not have hardware capabilities as well as some other challenges. Maybe I&#8217;ll dedicate a post to them in the future.</p>
<script src="http://feeds.feedburner.com/~s/arnonrgo?i=http://arnon.me/2011/08/hp-bigdata/" type="text/javascript" charset="utf-8"></script><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=zh_IccqO3ME:KvQ79ot-EsQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=zh_IccqO3ME:KvQ79ot-EsQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=zh_IccqO3ME:KvQ79ot-EsQ:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=zh_IccqO3ME:KvQ79ot-EsQ:G79ilh31hkQ"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=G79ilh31hkQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=zh_IccqO3ME:KvQ79ot-EsQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=zh_IccqO3ME:KvQ79ot-EsQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=zh_IccqO3ME:KvQ79ot-EsQ:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=zh_IccqO3ME:KvQ79ot-EsQ:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=zh_IccqO3ME:KvQ79ot-EsQ:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=zh_IccqO3ME:KvQ79ot-EsQ:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=zh_IccqO3ME:KvQ79ot-EsQ:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=zh_IccqO3ME:KvQ79ot-EsQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CirrusMinor/~4/zh_IccqO3ME" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://arnon.me/2011/08/hp-bigdata/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://arnon.me/2011/08/hp-bigdata/</feedburner:origLink></item>
		<item>
		<title>RabbitMQ – part I –  AMQP</title>
		<link>http://feedproxy.google.com/~r/CirrusMinor/~3/hIFtn1igCHs/</link>
		<comments>http://arnon.me/2011/08/amqp/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 18:37:30 +0000</pubDate>
		<dc:creator>Arnon Rotem-Gal-Oz</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[amqp]]></category>
		<category><![CDATA[message bus]]></category>
		<category><![CDATA[messaging]]></category>
		<category><![CDATA[RabbitMQ]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://arnon.me/?p=491</guid>
		<description><![CDATA[I haven&#8217;t blogged in a few months and I guess it is about time I get back to writing. A lot has happened including me leaving CloudValue (I still think it can be interesting business-wise, but it wasn&#8217;t very challenging technically) and moving to a new company (where I&#8217;ll probably won&#8217;t get rich but I [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t blogged in a few months and I guess it is about time I get back to writing. A lot has happened including me leaving CloudValue (I still think it can be interesting business-wise, but it wasn&#8217;t very challenging technically) and moving to a new company (where I&#8217;ll probably won&#8217;t get rich but I get to work on challenging projects :) ). Anyway, I working with quite a few interesting technologies these days (Hadoop,  Greenplum, BigInsight and whatnot )and I thought it might be a good idea  to write about some of them. The first technology I am going to talk about is RabbitMQ.</p>
<p>RabbitMQ is a message bus built in Erlang. It implements the AMQP protocol, which, unlike JMS, is also a wire protocol and not just an API. (meaning you can use an AMQP client with any compliant AMQP server) AMQP has a few concepts which are different from &#8220;regular&#8221; messaging infrastructures (like MSMQ or MQSeries). The illustration below shows the main concepts of AMQP</p>
<p><a href="http://arnon.me/wp-content/uploads/2011/08/Rabbitmq.png"><img class="alignleft size-large wp-image-492" title="Rabbitmq" src="http://arnon.me/wp-content/uploads/2011/08/Rabbitmq-1024x445.png" alt="" width="491" height="214" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Virtual Host – Virtual host is administrative container which  provides access control boundaries. Each virtual host has its own set of exchanges. A connection can only be associated with a single virtual host</p>
<p>Exchange – An exchange is a message routing agent. Exchanges can be temporary, auto-deleted or durable. Messages are published to exchanges and then routed to queues that are bound to the exchange (if no queues are bound the message will be lost).Exchanges support one of the following routing schemes</p>
<ul>
<li>Direct – based on a routing key. Any queue (or exchange) binding to the key will get the message</li>
<li>Fan-out – no routing key , each queue or exchange bound to this type of exchange will get a copy of the message</li>
<li>Header -  Header based routing allows compound routing based on a combination of lists of identifiers (essentially key-value pairs) the routing can be done on either any or all key-values specified. The subscription then specified a set of key-values and an operator (and or any) e.g. { &#8216;x-match&#8217; =&gt; &#8216;any&#8217;, :customer =&gt; &#8217;23&#8242;, :agent =&gt; &#8217;007&#8242; }. This looked like a promising direction until we’ve found that it isn’t well supported (e.g. it isn’t even documented in the C# documentation of RabbitMQ) and doesn’t perform well</li>
<li>Topic – Topic based routing allows compound routing based on topic hierarchy. Topics is based on pattern matching (a strong core capability of Erlang, RabbitMQ’s implementation language) and allows versatile subscription based on wildcards: * a single segment placeholder or # zero or more segments  (e.g. foo.*.bar will match foo.baz.bar, foo.bag.bar but not foo.baz.bag.bar, foo.#.bar will match all of them)</li>
</ul>
<p>Both queues and exchanges can bind to an exchange. The default exchange uses the queue name as routing key (i.e. sends a message directly to a queue)</p>
<p>Queue – A queue is a FIFO buffer. It is important to note that the FIFO order is only guaranteed when a single consumer is used. Queues, like exchanges cab be temporary, auto-deleted or durable. Getting messages from exchanges to queues is done by binding the queue to an exchange.</p>
<p>So that&#8217;s a short into to AMQP itself. In the next installments I&#8217;ll expand a little about RabbitMQ itself, show some coding samples and finish it up with some pros/cons</p>
<hr />
<p>illustration by <a href="http://www.flickr.com/photos/beautyredefined/2389559961/">beautyredefined</a></p>
<script src="http://feeds.feedburner.com/~s/arnonrgo?i=http://arnon.me/2011/08/amqp/" type="text/javascript" charset="utf-8"></script><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=hIFtn1igCHs:ha8EJNpxEAE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=hIFtn1igCHs:ha8EJNpxEAE:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=hIFtn1igCHs:ha8EJNpxEAE:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=hIFtn1igCHs:ha8EJNpxEAE:G79ilh31hkQ"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=G79ilh31hkQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=hIFtn1igCHs:ha8EJNpxEAE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=hIFtn1igCHs:ha8EJNpxEAE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=hIFtn1igCHs:ha8EJNpxEAE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=hIFtn1igCHs:ha8EJNpxEAE:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=hIFtn1igCHs:ha8EJNpxEAE:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=hIFtn1igCHs:ha8EJNpxEAE:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=hIFtn1igCHs:ha8EJNpxEAE:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=hIFtn1igCHs:ha8EJNpxEAE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CirrusMinor/~4/hIFtn1igCHs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://arnon.me/2011/08/amqp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://arnon.me/2011/08/amqp/</feedburner:origLink></item>
		<item>
		<title>Amazon’s EC2 &amp; EBS outage</title>
		<link>http://feedproxy.google.com/~r/CirrusMinor/~3/j4DF-GlywYI/</link>
		<comments>http://arnon.me/2011/04/amazons-ec2-ebs-outage/#comments</comments>
		<pubDate>Sat, 23 Apr 2011 21:39:13 +0000</pubDate>
		<dc:creator>Arnon Rotem-Gal-Oz</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[When things break]]></category>

		<guid isPermaLink="false">http://arnon.me/?p=466</guid>
		<description><![CDATA[Unless you are living under a rock, you&#8217;ve probably heard, if not felt Amazon&#8217;s outage (you can read more about it all over the web, e.g.  Cade Metz at the register or Julianne Pepitone at CNN money, [edit Apr26] Todd Hoff &#8216;s list of posts on the subject) This incident is very interesting in the technical sense [...]]]></description>
			<content:encoded><![CDATA[<p>Unless you are living under a rock, you&#8217;ve probably heard, if not felt Amazon&#8217;s outage (you can read more about it all over the web, e.g.  <a href="http://www.theregister.co.uk/2011/04/21/amazon_web_services_outages_spans_zones/">Cade Metz at the register</a> or <a href="http://money.cnn.com/2011/04/21/technology/amazon_server_outage/index.htm">Julianne Pepitone at CNN money</a>, [edit Apr26] <a href="highscalability.com/blog/2011/4/25/the-big-list-of-articles-on-the-amazon-outage.html">Todd Hoff &#8216;s list of posts on the subject</a>) This incident is very interesting in the technical sense as well as very  disturbing.</p>
<p>First off it is a major event since Amazon controls almost 60% of the Infrastructure as a Service market (<a href="http://online.wsj.com/article/SB10001424052748704739504576067580949404062.html">per WSJ</a>) and an incident like this is bad publicity for the whole cloud concept. After all if Amazon is fledgling what does that mean for Rackspace and the other IaaS players &#8211; not to mention PaaS players like Google and Microsoft (since PaaS solutions require more complicated software and higher integration with end-solutions.</p>
<p style="display: inline !important;">It is also worth mentioning that this isn&#8217;t the major outages for Amazon. One notable &#8220;availability event&#8221;  occurred in 2008 where S<a href="http://status.aws.amazon.com/s3-20080720.html">3 had major problem for about half a day</a> and <a href="http://www.datacenterknowledge.com/archives/2009/07/19/outage-for-amazon-web-services/">a few minor problem with EC2 </a> in 2009. What&#8217;s stands out here is that the availability zones features that was supposed to isolate this type of breakdown to smaller areas broke and only sites that had data-center redundancy (like Netflix for example) managed to handle the interruption while sites like foursquare, reddit and even, it seems,  <a href="https://forums.aws.amazon.com/thread.jspa?threadID=65649&amp;tstart=0">a company monitoring cardiac arrests </a></p>
<p>were all harmed.</p>
<p>Another alarming behavior on the part of Amazon is the lack of transparency / bad crisis management in handling the outage. For example Keith Smith CEO of BigDoor (one of the startups affected by the outage) <a href="http://www.geekwire.com/2011/amazoncoms-real-problem-outage-communication">writes</a></p>
<blockquote>
<p style="display: inline !important;">&#8220;Starting at 1:41 a.m. PST, Amazon’s updates read as if they were written by their attorneys and accountants who were hedging against their stated SLA rather than being written by a tech guy trying to help another tech guy.&#8221;</p>
</blockquote>
<p>When a big supplier fumbles a lot of companies are affected and it is bound to get big press. Also, systems, esp. complex ones, have bugs and its understandable that things may break from time to time (and I am sure that Amazon, which evidently has top talent would find a way to prevent this from recurring). However, Cloud providers need to understand that <a href="http://en.wikipedia.org/wiki/Uncle_Ben#.22With_great_power_comes_great_responsibility.22">&#8220;with great power comes great responsibility&#8221;</a> and the technical offering need to be strengthened with great support and transparency.</p>
<p>On the technical level, it also means that, while moving to the cloud carries a lot of benefits and can save a lot on operations costs, the responsibility for our application&#8217;s up time is still our responsibility and depending on the  cost of failure (on the scale from few dollars to lives of people)  we should also architect for disaster regardless of vendor claims. When we build closed systems we may  look at the Mean-Time Between Failure (MTBF and MTBCF) advertised by hardware manufacturers but we&#8217;d also add software based reliability mechanisms &#8211; for the cloud that may mean cross data-center (region) deployments, cross cloud provider deployments, or even on-premise backup &#8211; This is the same measures you&#8217;d take when your dealing with the electric company, if it is important enough, you&#8217;d install UPSs and generators and alternate sites and whatnot, you just have to figure out how important business continuousness is</p>
<p>I guess we&#8217;ll all wait to see how all this unfolds and what will be the after-effects of this outage on Cloud-computing. I personally think that it is still a good move in many cases, however this incident, help focus that the responsibility for our application&#8217;s wellness  is still ultimately  ours</p>
<p>Edit Apr. 24th:</p>
<p>I just read a post in <a href="http://www.codinghorror.com/blog/2011/04/working-with-the-chaos-monkey.html">Coding Horror</a> which refers to a <strong>year old </strong>post in Netflix&#8217;s blog called &#8220;<a href="http://techblog.netflix.com/2010/12/5-lessons-weve-learned-using-aws.html">5 lessons we&#8217;ve learned using AWS</a> [Amazon WebSevices]&#8220;. Netflix, in case you&#8217;re wondering survived Amazon&#8217;s outage and indeed, in lesson #3 they explain that if you want to survive failures you have to plan and constantly test for it:</p>
<div id="outer-wrapper">
<div id="wrap2">
<div id="content-wrapper">
<div id="main-wrapper">
<div id="main">
<div id="Blog1">
<div>
<div>
<div>
<div>
<div>
<div id="post-body-381417170823959085">
<blockquote>
<div><strong>3. The best way to avoid failure is to fail constantly.</strong></div>
<div>We’ve sometimes referred to the Netflix software architecture in AWS as our Rambo Architecture. Each system has to be able to succeed, no matter what, even all on its own. We’re designing each distributed system to expect and tolerate failure from other systems on which it depends.</div>
<div>If our recommendations system is down, we degrade the quality of our responses to our customers, but we still respond. We’ll show popular titles instead of personalized picks. If our search system is intolerably slow, streaming should still work perfectly fine.</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<script src="http://feeds.feedburner.com/~s/arnonrgo?i=http://arnon.me/2011/04/amazons-ec2-ebs-outage/" type="text/javascript" charset="utf-8"></script><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=j4DF-GlywYI:eCTiOr9-gxk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=j4DF-GlywYI:eCTiOr9-gxk:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=j4DF-GlywYI:eCTiOr9-gxk:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=j4DF-GlywYI:eCTiOr9-gxk:G79ilh31hkQ"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=G79ilh31hkQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=j4DF-GlywYI:eCTiOr9-gxk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=j4DF-GlywYI:eCTiOr9-gxk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=j4DF-GlywYI:eCTiOr9-gxk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=j4DF-GlywYI:eCTiOr9-gxk:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=j4DF-GlywYI:eCTiOr9-gxk:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=j4DF-GlywYI:eCTiOr9-gxk:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=j4DF-GlywYI:eCTiOr9-gxk:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=j4DF-GlywYI:eCTiOr9-gxk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CirrusMinor/~4/j4DF-GlywYI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://arnon.me/2011/04/amazons-ec2-ebs-outage/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://arnon.me/2011/04/amazons-ec2-ebs-outage/</feedburner:origLink></item>
		<item>
		<title>Evolving Architectures – Part VII – Parallel</title>
		<link>http://feedproxy.google.com/~r/CirrusMinor/~3/QIIUOn30HAY/</link>
		<comments>http://arnon.me/2011/04/evolving-architectures-part-vii-parallel/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 12:39:16 +0000</pubDate>
		<dc:creator>Arnon Rotem-Gal-Oz</dc:creator>
				<category><![CDATA[Agile Architecture]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Featured Posts]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[architectural changes]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Software Architecture]]></category>

		<guid isPermaLink="false">http://arnon.me/?p=452</guid>
		<description><![CDATA[(This is part seven of a series. You might want to check) Parallel and Simplification are the yin and yang of architecture evolution. Simplification, as mentioned previously, is about having foresight and thus provides for,relatively, easy evolution (i.e. architectural additions and not changes). Parallel is about reacting to changes in requirements as they come (no [...]]]></description>
			<content:encoded><![CDATA[<p>(This is part seven of a series. You might want to check<a href="http://arnon.me/category/blog/featured-posts/agile-architecture/"> the previous parts first</a>)<br />
Parallel and Simplification are the yin and yang of architecture evolution. Simplification, as mentioned previously, is about having foresight and thus provides for,relatively, easy evolution (i.e. architectural additions and not changes). Parallel is about reacting to changes in requirements as they come (no foresight) and making architectural changes.<br />
But wait, architectural changes are hard by definition* &#8211; if we make a change to the architecture a lot of things are going to break &#8211; starting with the build (or the continuous deployment if you have one) and things will just deteriorate from there. An architectural change will take, relatively, a lot of time and there are a lot of risks in trying to put everything back together. Which is exactly why we need &#8220;parallel&#8221;.<br />
As the name implies this technique is about building the new by the old. Routing old stuff to use the new and then removing the old. An analogy to help visualize this is the building of a new interchange. In most cases, when a new interchange is built, the traffic isn&#8217;t completely stopped. Instead some detours with temporary assignment of old lanes is built. Then the new lanes, bridges etc. are built, then the traffic is detoured to the new infrastructure while the old one is also fixed/changed ans then the open the new interchange. Sure, things slow down while the work is in progress but it doesn&#8217;t stop. The same is true for businesses &#8211; nobody would be willing to halt the business while you get organized to make architectural changes that weren&#8217;t foreseen.<br />
Parallel is needed because no matter how good our initial designs are,  business requirement change and with them the architecture that needs to support them. Additionally in many cases it isn&#8217;t worthwhile solving the ultimate problem on the onset, it would just cost too much (time and money) to do so. Parallel eases the pain of making significant architectural changes. Remember software is there to serve the business not the other way around :)<br />
Is parallel just a technique without architectural implications? Well, yes and no.For one it can be used as a general technique regardless what the architecture is. However one thing you can do is design for evolvability, SOA, REST and EDA (or a combination of them) are all architectural approaches that support evolvability. If you make the investment to build on an architectural style that is makes integration easy it helps a lot when things change. It also helps localize changes within defined boundaries (e.g. within the scope of a single service) and lastly they help in the interim stage where you have both the old and the new in place as you keep the old integration boundaries (events, contracts etc.) intact while adding the new ones.<br />
For instance, in a project I worked on, we&#8217;ve made significant changes using Parallel. The company made a business change which had the the technical ramifications of having  to increase the scale of the database the solution had to handle from hundreds to millions of items. To do that we had to change the back-end database (from files to Cassandra), the way we distribute the work (from centralized to distributed) and what not. The product architecture was built on Event based SOA using context based routing**. Changing the database for example was a localized change within the components that actually has to work with it keeping the rest of the system intact. The distribution was handled in the infrastructure by changing the distribution policy of event again without affecting the existing event stream. Adding new events and components wasn&#8217;t a problem either. routing events to new subscribers is a built in feature in event driven architectures, and the same goes for removing old subscribers when they are no longer needed.We did halt on deploying the interim results into production &#8211; apropos the interchange analogy mentioned above, the interim product had performance problems while the work was in progress but we did have everything working while we made a significant change and we were able to make it gradually while keeping everything connected and working</p>
<p>Lastly note that in real world scenarios you probably use a mix of simplification, parallel and yes even leaps &#8211; We need to have several tools in our tool-set. We can&#8217;t afford to just have a hammer since after all, not every problem is a nail &#8211; right?</p>
<hr />
<p>* Architecture definition as it appears in the<a href="http://arnon.me/2010/05/evolving-architectures-part-whats-software-architecture/"> first post of the series</a> :</p>
<blockquote><p>“Software architecture is the collection of decisions affecting the system’s quality attributes; which have global effects and are hardest to change. Software architecture provides the frame within which the design (code) is built.”</p></blockquote>
<p>** The context based routing was added as part of a previous architectural change. I mention this here as it is an example for a simplification &#8211; an architectural element that was not part of the original architecture but was added later when the actual need arrived (when we had to support both internal operations as well as 3rd party integration)“Software architecture is the collection of decisions affecting the system’s quality attributes; which have global effects and are <strong>hardest to change</strong>. Software architecture provides the frame within which the design (code) is built.”</p>
<p>*** illustration source <a href="http://www.newson6.com/story/13134681/construction-closes-highway-75-at-interstate-44-in-tulsa-again">newson6</a></p>
<script src="http://feeds.feedburner.com/~s/arnonrgo?i=http://arnon.me/2011/04/evolving-architectures-part-vii-parallel/" type="text/javascript" charset="utf-8"></script><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=QIIUOn30HAY:OEAnvZTu_kc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=QIIUOn30HAY:OEAnvZTu_kc:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=QIIUOn30HAY:OEAnvZTu_kc:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=QIIUOn30HAY:OEAnvZTu_kc:G79ilh31hkQ"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=G79ilh31hkQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=QIIUOn30HAY:OEAnvZTu_kc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=QIIUOn30HAY:OEAnvZTu_kc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=QIIUOn30HAY:OEAnvZTu_kc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=QIIUOn30HAY:OEAnvZTu_kc:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=QIIUOn30HAY:OEAnvZTu_kc:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=QIIUOn30HAY:OEAnvZTu_kc:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=QIIUOn30HAY:OEAnvZTu_kc:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=QIIUOn30HAY:OEAnvZTu_kc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CirrusMinor/~4/QIIUOn30HAY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://arnon.me/2011/04/evolving-architectures-part-vii-parallel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://arnon.me/2011/04/evolving-architectures-part-vii-parallel/</feedburner:origLink></item>
		<item>
		<title>Many mistakes in my previous post? (more on Azure worker role)</title>
		<link>http://feedproxy.google.com/~r/CirrusMinor/~3/yZYy3CcTGhc/</link>
		<comments>http://arnon.me/2011/03/mistakes-previous-post-azure-worker-role/#comments</comments>
		<pubDate>Sun, 06 Mar 2011 22:26:02 +0000</pubDate>
		<dc:creator>Arnon Rotem-Gal-Oz</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Software Architecture]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://arnon.me/?p=442</guid>
		<description><![CDATA[I&#8217;ve got a comment from a user calling himself &#8220;AzureBizAndTech&#8221; to my . Unfortunately the comment was deleted in in DDJ&#8217;s move to a new blogging platform over the weekend. The person, who apparently works in Microsoft (per his first point- see below) posted the comment with the title &#8220;Many mistakes in this post&#8221;. Below [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve got a comment from a <a href="http://www.drdobbs.com/blog/archives/2011/02/azure_worker_ro.html#comments">user calling himself &#8220;AzureBizAndTech&#8221;</a> to my <a href="http://arnon.me/2011/03/azure-worker-role/">previous post </a>. Unfortunately the comment was deleted in in DDJ&#8217;s move to a new blogging platform over the weekend. The person, who apparently works in Microsoft (per his first point- see below) posted the comment with the title &#8220;Many mistakes in this post&#8221;. Below are his points and my reply</p>
<blockquote><p>1) VMRole is not IaaS. This is not my opinion. It is Microsoft&#8217;s (my employer) stated position.</p></blockquote>
<p>Sorry however, whether an offering is IaaS or PaaS or anything is determined by its capabilities not by the label some marketing person put on it. The VM role is more IaaS than PaaS. It is true that it isn&#8217;t a realy IaaS since it has a limited support of VMs (e.g. you can&#8217;t run Linux on it)</p>
<blockquote><p>2) Yes, it is a good idea to allocate one service per role. How else are you going to scale?</p></blockquote>
<p>First off, scale is not the only reason for moving to the Cloud, probably not even the major reason to do so. Reduced IT costs, right-sizing hardware needs, flexibility are some of the other reasons to move. From a pricing perspective this can prove to be a poor choice. Let&#8217;s do the math. The particular client mentioned in the post has 4 web sites (variations on the product) and some 20 services. If you have an IO bound application (which they do) than you should probably use  a medium instance (<a href="http://www.microsoft.com/windowsazure/compute/default.aspx">smaller instance have moderate or low IO performance</a>). You&#8217;d want to run 2 instances per role (to get the 99.5 uptime guarantee ). Yearly cost =0.24$ * 24 hours * 365 days * 24 roles *2 &gt; 100K$ where we can probably pack everything into 2 extra large instances at 16K$ per year. Yep great idea indeed</p>
<blockquote><p>3) Services (Web or REST) can be implemented on either Web or Worker roles.</p></blockquote>
<p>It seems that by services you mean &#8220;web-services&#8221; but that&#8217;s not the only way to implement services. In any event I didn&#8217;t say you can&#8217;t. However Worker role (or VM) is where you can implement stateful services if you need them</p>
<blockquote><p>4) The cost of a proper architecture in Azure is a business discussion not a technical one.</p></blockquote>
<p>See point 2 above. Generally speaking architects who ignore the cost of their architecture are bound to fail. It is never just a business discussion (same goes for other &#8220;business&#8221; concerns like time-to-market etc.)</p>
<blockquote><p>5) Worker roles are NOT where you put all of your stateful services. Worker roles are used to implement non-web tier services. Which also need to be stateless in order to scale.</p></blockquote>
<p>Again the scale thing (it reminds me <a href="http://www.youtube.com/watch?v=b2F-DItXtZs">this</a> :)) So basically you are saying that unless you are stateless you cannot scale? is <a href="http://blogs.msdn.com/b/cbiyikoglu/archive/2010/10/30/building-scalable-database-solution-in-sql-azure-introducing-federation-in-sql-azure.aspx">SQL Azure Federation</a> a hoax then? Or is Microsoft the only company with the smarts to build stateful scalable solutions?! or what?</p>
<blockquote><p>6) CloudValue is attempting to use the Windows Azure Platform as a host. Cloud platforms are not hosting platforms That is a different paradigm.</p></blockquote>
<p>Let me get that right &#8211; Are you telling me to advise my clients to move off of Windows Azure? Is this an official Microsoft stand???  Seriously, I know it is not as we are working with MS reps in Israel and UK to help get them to the cloud  but come on&#8230;</p>
<p>Don&#8217;t get me wrong. Azure has some really nice features and it keeps improving all the time. I think worker roles (or something on top of it) need to provide a higher level of abstraction from the mapping to an instance so that you can really right-size your IT spending. Not every solution needs to scale to Google or Facebook size</p>
<script src="http://feeds.feedburner.com/~s/arnonrgo?i=http://arnon.me/2011/03/mistakes-previous-post-azure-worker-role/" type="text/javascript" charset="utf-8"></script><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=yZYy3CcTGhc:-KC1NVo3dRA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=yZYy3CcTGhc:-KC1NVo3dRA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=yZYy3CcTGhc:-KC1NVo3dRA:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=yZYy3CcTGhc:-KC1NVo3dRA:G79ilh31hkQ"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=G79ilh31hkQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=yZYy3CcTGhc:-KC1NVo3dRA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=yZYy3CcTGhc:-KC1NVo3dRA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=yZYy3CcTGhc:-KC1NVo3dRA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=yZYy3CcTGhc:-KC1NVo3dRA:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=yZYy3CcTGhc:-KC1NVo3dRA:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=yZYy3CcTGhc:-KC1NVo3dRA:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=yZYy3CcTGhc:-KC1NVo3dRA:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=yZYy3CcTGhc:-KC1NVo3dRA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CirrusMinor/~4/yZYy3CcTGhc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://arnon.me/2011/03/mistakes-previous-post-azure-worker-role/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://arnon.me/2011/03/mistakes-previous-post-azure-worker-role/</feedburner:origLink></item>
		<item>
		<title>Azure Worker Role is not there yet</title>
		<link>http://feedproxy.google.com/~r/CirrusMinor/~3/l868XrRv01Q/</link>
		<comments>http://arnon.me/2011/03/azure-worker-role/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 22:38:05 +0000</pubDate>
		<dc:creator>Arnon Rotem-Gal-Oz</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[iaas]]></category>
		<category><![CDATA[paas]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[VM Role]]></category>
		<category><![CDATA[Worker Role]]></category>

		<guid isPermaLink="false">http://arnon.me/?p=402</guid>
		<description><![CDATA[Microsoft&#8217;s furray into the Cloud service providers (a.k.a. Azure) tries to play both in the Infrastructure-as-a-Service (IaaS) and Platform-as-a-Service (PaaS) playgrounds (Kate Craig provides good definitions of IaaS and PaaS if you need them). Microsoft&#8217;s IaaS offering (though it also has some  PaaS  attributes ) is pretty simple and straight forward with a (yet in beta) [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft&#8217;s furray  into the Cloud service providers (a.k.a. Azure) tries to play both in the Infrastructure-as-a-Service (IaaS) and Platform-as-a-Service (PaaS) playgrounds (Kate Craig provides <a href="http://www.katescomment.com/iaas-paas-saas-definition/">good definitions of IaaS and PaaS</a> if you need them).  Microsoft&#8217;s IaaS offering <a href="http://blogs.msdn.com/b/plankytronixx/archive/2010/11/27/windows-azure-vm-role-looking-at-it-a-different-way.aspx">(though it also has some  PaaS  attributes </a>) is pretty simple and straight forward with a (yet in beta) Virtual Machine Role (VM Role).The VM role, as its name implies, lets you upload e VHD with a windows 2008R2 virtual machine image and just run that . It provides a relatively easy path for cloud migration but it also carries  all the caveats such a solution incurs (e.g. the need to find somewhere to persist your data , patching the OS yourself etc.)</p>
<p>Anyway, PaaS is the more interesting offering in and  in Windows Azure it is comprised of a lot of services like Azure SQL, ServiceBus, Web role (to host web sites) and our friend- the Worker Role. Microsoft defines the Worker role as follows:</p>
<blockquote><p>A worker role is a role that is useful for generalized development, and may perform background processing for a web role. When you have a need for a background process that performs long running or intermittent tasks, you should use this role</p></blockquote>
<p>That&#8217;s sounds like a good plan &#8211; but what happens when you have an SOA with a lot of services? You&#8217;d think that it would be a good idea to allocate a worker role for each service but that will translate to a large usage bill as each worker role runs on its own instance.</p>
<p>If all your services are stateless* than you can use the  Web role to solve that. Starting with SDK 1.3 of Azure you can use  full IIS installation (MS understood that their former crippled web host was a mistake, but that&#8217;s another story). Full IIS means you can host multiple services with out worrying about i. And since they&#8217;re stateless you can scale easily by adding instances and all is well. This is, by the way, <a href="http://www.mygreatwindowsazureidea.com/forums/34192-windows-azure-feature-voting/suggestions/397209-provide-multiple-roles-per-instance?ref=title">MS&#8217;s official solution for the problem</a> &#8211; which means that worker role is were we&#8217;d put our non-stateless, ie. stateful services &#8211; and that&#8217;s too costly if we go by the book (service per Role) and costly when we cram them all together since now we have to develop quite a lot of infrastructure</p>
<p>Here&#8217;s a real-life example : We (<a href="http://www.cloudvalue.com/">CloudValue</a>) are  currently working with a client in the forex market that want to port their current portfolio to the cloud. The database was a relatively painless port to Azure SQL, the web-servers took a little more work (mostly related to moving to IIS 7.5) but can now be deployed to a web-role. The back-end however is build from quite a few services some of which are, lo and behold, stateful &#8211; exchange rates and related market data arrive at high rates and require low latencies (<a href="http://www.advancedtrading.com/infrastructure/showArticle.jhtml?articleID=225701913">here is an extreme example</a>) so now what?</p>
<p>The first thing we&#8217;re doing is move everything to a VM role &#8211; that&#8217;s the fastest way to get to &#8220;something&#8221; running in the cloud, and I guess that has some merits in the PR department. If we want to move these services to worker roles or better yet to a single worker role (with multiple instances) we need to develop the infrastructure ourselves &#8211; I&#8217;m (re)writing a RoleManager which is essentially a watchdog that monitors which services are running, allows the different services to be divided between instances and generally do a lot of stuff I am expecting a PaaS vendor to provide out-of the box.. oh well</p>
<p>I assume that the composite application which is going to be part of the AppFabric (CTPs planned sometime in 2011) will address this issue, meanwhile we have to solve this problem ourselves (like the RoleManager I mentioned above)</p>
<p>* Stateless is a nice way to say that you&#8217;ve passed this hot potato to someone else and that the state is now its problem&#8230; :)</p>
<hr />
<p>Illustration by <a href="http://www.sxc.hu/photo/1118215">Laura Leavell</a></p>
<script src="http://feeds.feedburner.com/~s/arnonrgo?i=http://arnon.me/2011/03/azure-worker-role/" type="text/javascript" charset="utf-8"></script><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=l868XrRv01Q:NzqNsjaiPoo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=l868XrRv01Q:NzqNsjaiPoo:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=l868XrRv01Q:NzqNsjaiPoo:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=l868XrRv01Q:NzqNsjaiPoo:G79ilh31hkQ"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=G79ilh31hkQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=l868XrRv01Q:NzqNsjaiPoo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=l868XrRv01Q:NzqNsjaiPoo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=l868XrRv01Q:NzqNsjaiPoo:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=l868XrRv01Q:NzqNsjaiPoo:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=l868XrRv01Q:NzqNsjaiPoo:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=l868XrRv01Q:NzqNsjaiPoo:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=l868XrRv01Q:NzqNsjaiPoo:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=l868XrRv01Q:NzqNsjaiPoo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CirrusMinor/~4/l868XrRv01Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://arnon.me/2011/03/azure-worker-role/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://arnon.me/2011/03/azure-worker-role/</feedburner:origLink></item>
		<item>
		<title>Azure Page Blobs vs. Liskov Substitution Principle</title>
		<link>http://feedproxy.google.com/~r/CirrusMinor/~3/QXk-ddmH2IM/</link>
		<comments>http://arnon.me/2011/02/azure-page-blobs-liskov-substitution-principle/#comments</comments>
		<pubDate>Sat, 19 Feb 2011 07:44:45 +0000</pubDate>
		<dc:creator>Arnon Rotem-Gal-Oz</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Object Orientation]]></category>
		<category><![CDATA[OO]]></category>

		<guid isPermaLink="false">http://arnon.me/?p=425</guid>
		<description><![CDATA[&#8220;Liskov Substitution Principle&#8221; or LSP is one of the basic principles for proper object orientation. LSP definition is: &#8220;Let q(x) be a property provable about objects x of type T. Then q(y) should be true for objects y of type S where S is a subtype of T.&#8221; In plain english that means that if CloudPageBlob inherits from CloudBlob and CloudBlob.UpdateText(someText) works CloudPageBlob.UpdateText(someText) should also work and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Liskov_substitution_principle"> &#8220;Liskov Substitution Principle&#8221;</a> or LSP is one of the basic <a href="http://www.rgoarchitects.com/Files/ooprimer.pdf">principles for proper object orientation</a>. LSP definition is:</p>
<blockquote><p>&#8220;<em>Let <em>q</em>(<em>x</em>) be a property provable about objects <em>x</em> of type <em>T</em>. Then <em>q</em>(<em>y</em>) should be true for objects <em>y</em> of type <em>S</em> where <em>S</em> is a subtype of <em>T</em>.&#8221;</em></p></blockquote>
<p>In plain english that means that if CloudPageBlob inherits from CloudBlob and CloudBlob.UpdateText(someText) works CloudPageBlob.UpdateText(someText) should also work and not throw and exception&#8230; (or alternatively CloudPageBlob shouldn&#8217;t inherit from CloudBlob)</p>
<p>Hear that Microsoft?</p>
<hr />Illustration by <a href="http://www.sxc.hu/photo/1327990">Benjipie</a></p>
<script src="http://feeds.feedburner.com/~s/arnonrgo?i=http://arnon.me/2011/02/azure-page-blobs-liskov-substitution-principle/" type="text/javascript" charset="utf-8"></script><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=QXk-ddmH2IM:wvPMAPi7bp8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=QXk-ddmH2IM:wvPMAPi7bp8:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=QXk-ddmH2IM:wvPMAPi7bp8:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=cGdyc7Q-1BI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=QXk-ddmH2IM:wvPMAPi7bp8:G79ilh31hkQ"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=G79ilh31hkQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=QXk-ddmH2IM:wvPMAPi7bp8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=QXk-ddmH2IM:wvPMAPi7bp8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=QXk-ddmH2IM:wvPMAPi7bp8:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=QXk-ddmH2IM:wvPMAPi7bp8:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=QXk-ddmH2IM:wvPMAPi7bp8:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=QXk-ddmH2IM:wvPMAPi7bp8:-BTjWOF_DHI"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?i=QXk-ddmH2IM:wvPMAPi7bp8:-BTjWOF_DHI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CirrusMinor?a=QXk-ddmH2IM:wvPMAPi7bp8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/CirrusMinor?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CirrusMinor/~4/QXk-ddmH2IM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://arnon.me/2011/02/azure-page-blobs-liskov-substitution-principle/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://arnon.me/2011/02/azure-page-blobs-liskov-substitution-principle/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 1.217 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-01-31 22:10:52 -->

