<?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>Udi Dahan - The Software Simplist &#187; Web Services</title>
	<atom:link href="http://www.udidahan.com/category/web-services/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.udidahan.com</link>
	<description>Enterprise Development Expert &#38; SOA Specialist</description>
	<lastBuildDate>Sat, 24 Jul 2010 20:06:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The Fallacy Of ReUse</title>
		<link>http://www.udidahan.com/2009/06/07/the-fallacy-of-reuse/</link>
		<comments>http://www.udidahan.com/2009/06/07/the-fallacy-of-reuse/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 08:40:16 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Autonomous Services]]></category>
		<category><![CDATA[EDA]]></category>
		<category><![CDATA[OO]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1026</guid>
		<description><![CDATA[This industry is pre-occupied with reuse.
There&#8217;s this belief that if we just reused more code, everything would be better.
Some even go so far as saying that the whole point of object-orientation was reuse &#8211; it wasn&#8217;t, encapsulation was the big thing. After that component-orientation was the thing that was supposed to make reuse happen. Apparently [...]]]></description>
			<content:encoded><![CDATA[<p>This industry is pre-occupied with reuse.</p>
<p>There&#8217;s this belief that if we just reused more code, everything would be better.</p>
<p>Some even go so far as saying that the whole point of object-orientation was reuse &#8211; it wasn&#8217;t, encapsulation was the big thing. After that component-orientation was the thing that was supposed to make reuse happen. Apparently that didn&#8217;t pan out so well either because here we are now pinning our reuseful hopes on service-orientation.</p>
<p>Entire books of patterns have been written on how to achieve reuse with the orientation of the day.<br />
Services have been classified every which way in trying to achieve this, from entity services and activity services, through process services and orchestration services. Composing services has been touted as the key to reusing, and creating reusable services.</p>
<p>I might as well let you in on the dirty-little secret:</p>
<h3>Reuse is a fallacy</h3>
<p>Before running too far ahead, let&#8217;s go back to what the actual goal of reuse was: getting done faster.</p>
<p>That&#8217;s it.</p>
<p>It&#8217;s a fine goal to have.</p>
<p>And here&#8217;s how reuse fits in to the picture:</p>
<blockquote><p>
If we were to write all the code of a system, we&#8217;d write a certain amount of code.<br />
If we could reuse some code from somewhere else that was written before, we could write less code.<br />
The more code we can reuse, the less code we write.<br />
The less code we write, the sooner we&#8217;ll be done!
</p></blockquote>
<p>However, the above logical progression is based on another couple of fallacies:</p>
<h3>Fallacy: All code takes the same amount of time to write</h3>
<h3>Fallacy: Writing code is the primary activity in getting a system done</h3>
<p>Anyone who&#8217;s actually written some code that&#8217;s gone into production knows this.</p>
<p>There&#8217;s the time it takes us to understand what the system should do.<br />
Multiply that by the time it takes the users to understand what the system should do <img src='http://www.udidahan.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
Then there&#8217;s the integrating that code with all the other code, databases, configuration, web services, etc.<br />
Debugging. Deploying. Debugging. Rebugging. Meetings. Etc.</p>
<p>Writing code is actually the least of our worries.<br />
We actually spend less time writing code than&#8230;</p>
<h3>Rebugging code</h3>
<p>Also known as bug regressions.</p>
<p>This is where we fix one piece of code, and in the process break another piece of code.<br />
It&#8217;s not like we do it on purpose. It&#8217;s all those dependencies between the various bits of code.<br />
The more dependencies there are, the more likely something&#8217;s gonna break.<br />
Especially when we have all sorts of hidden dependencies,<br />
like when other code uses stuff we put in the database without asking us what it means,<br />
or, heaven forbid, changing it without telling us.</p>
<p>These debugging/rebugging cycles can make stabilizing a system take a long time.</p>
<p>So, how does reuse help/hinder with that?</p>
<p>Here&#8217;s how:</p>
<h3>Dependencies multiply by reuse</h3>
<p>It&#8217;s to be expected. If you wrote the code all in one place, there are no dependencies. By reusing code, you&#8217;ve created a dependency. The more you reuse, the more dependencies you have. The more dependencies, the more rebugging.</p>
<p>Of course, we need to keep in mind the difference between&#8230;</p>
<h3>Reuse &#038; Use</h3>
<p>Your code <b>uses</b> the runtime API (JDK, .NET BCL, etc).<br />
Likewise other frameworks like (N)Hibernate, Spring, WCF, etc.</p>
<p>Reuse happens when you extend and override existing behaviors within other code.<br />
This is most often done by inheritance in OO languages.</p>
<p>Interestingly enough, by the above generally accepted definition, most web services &#8220;reuse&#8221; is actually really use.</p>
<p>Let&#8217;s take a look at the characteristics of the code we&#8217;re using and reusing to see where we get the greatest value:</p>
<h3>The value of (re)use</h3>
<p>If we were to (re)use a piece of code in only one part of our system, it would be safe to say that we would get less value than if we could (re)use it in more places. For example, we could say that for many web applications, the web framework we use provides more value than a given encryption algorithm that we may use in only a few places.</p>
<p>So, what characterizes the code we use in many places?</p>
<p>Well, it&#8217;s very <b>generic</b>.</p>
<p>Actually, the more generic a piece of code, the less likely it is that we&#8217;ll be changing something in it when fixing a bug in the system.</p>
<p><b>That&#8217;s important</b>.</p>
<p>However, when looking at the kind of code we reuse, and the reasons around it, we tend to see very <b>non-generic</b> code &#8211; something that deals with the domain-specific behaviors of the system. Thus, the likelihood of a bug fix needing to touch that code is higher than in the generic/use-not-reuse case, often much higher.</p>
<h3>How it all fits together</h3>
<blockquote><p>
Goal:&#09;Getting done faster<br />
Via:&#09;Spending less time debugging/rebugging/stabilizing<br />
Via:&#09;Having less dependencies reasonably requiring a bug fix to touch the dependent side<br />
Via:&#09;Not reusing non-generic code
</p></blockquote>
<p>This doesn&#8217;t mean you shouldn&#8217;t use generic code / frameworks where applicable &#8211; absolutely, you should.<br />
Just watch the number of kind of dependencies you introduce.</p>
<h3>Back to services</h3>
<p>So, if we follow the above advice with services, we wouldn&#8217;t want domain specific services reusing each other.<br />
If we could get away with it, we probably wouldn&#8217;t even want them using each other either.</p>
<p>As use and reuse go down, we can see that service autonomy goes up. And vice-versa.<br />
Luckily, we have service interaction mechanisms from Event-Driven Architecture that enable use without breaking autonomy.<br />
Autonomy is actually very similar to the principle of encapsulation that drove object-orientation in the first place.<br />
Interesting, isn&#8217;t it?</p>
<h3>In summary</h3>
<p>We all want to get done faster.</p>
<p>Way back when, someone told us reuse was the way to do that.</p>
<p>They were wrong.</p>
<p>Reuse may make sense in the most tightly coupled pieces of code you have, but not very much anywhere else.</p>
<p>When designing services in your SOA, stay away from reuse, and minimize use (with EDA patterns).</p>
<p>The next time someone pulls the &#8220;reuse excuse&#8221;, you&#8217;ll be ready.</p>
<hr size="1" />
<h3>Further Reading</h3>
<ul>
<li><a href="http://www.udidahan.com/2008/10/22/additional-logic-required-for-service-autonomy/">Additional logic required for service autonomy</a></li>
<li><a href="http://www.udidahan.com/2008/12/13/self-contained-events-and-soa/">Self-contained events &#038; SOA</a></li>
<li><a href="http://msdn2.microsoft.com/en-us/arcjournal/bb245672">Autonomous Services and Enterprise Entity Aggregation</a> [MS Architecture Journal]</li>
<li><a href="http://udidahan.weblogs.us/2006/05/26/podcast-does-soa-mean-the-end-of-oo/">Does SOA mean the end of OO?</a> [Podcast]</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2009/06/07/the-fallacy-of-reuse/feed/</wfw:commentRss>
		<slash:comments>49</slash:comments>
		</item>
		<item>
		<title>A Queue Isn&#8217;t An Implementation Detail</title>
		<link>http://www.udidahan.com/2009/05/25/a-queue-isnt-an-implementation-detail/</link>
		<comments>http://www.udidahan.com/2009/05/25/a-queue-isnt-an-implementation-detail/#comments</comments>
		<pubDate>Mon, 25 May 2009 18:15:01 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[MSMQ]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1015</guid>
		<description><![CDATA[It&#8217;s hard to believe that this continues to pop up even as WCF is reaching its fourth version (emphasis mine):
&#8220;A common complaint is that the first call on a client object takes some disproportionately large amount of time, usually ten seconds or more, while successive calls are instantaneous. There are many reasons why this might [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s hard to believe that this continues to pop up even as WCF is reaching its fourth version (emphasis mine):</p>
<blockquote><p>&#8220;A common complaint is that the first call on a client object takes some disproportionately large amount of time, <b>usually ten seconds or more</b>, while successive calls are instantaneous. There are many reasons why this might happen so <b>there&#8217;s no generic resolution for this problem</b>.&#8221; &#8212; <a href="http://blogs.msdn.com/drnick/archive/2009/05/22/tripping-over-missing-servers.aspx">Nicholas Allen</a></p></blockquote>
<p>The thing is that there <b>IS</b> a generic solution to this problem.</p>
<p>It&#8217;s queued messaging.</p>
<p>The only thing is that you have to give up talking to your services as if they were regular objects &#8211; calling methods on them and expecting a response. In other words, designing a distributed systems isn&#8217;t like designing a regular OO system just with some WCF sprinkled on top.</p>
<p>Even when trying to do fire and forget messaging on top of WCF (void method calls with the OneWay attribute), the underlying channel can still block your thread, as Nick mentioned. </p>
<p>A queue isn&#8217;t an implementation detail.<br />
It&#8217;s the primary architectural abstraction of a distributed system.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2009/05/25/a-queue-isnt-an-implementation-detail/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Backwards-Compatibility: Why Most Versioning Problems Aren&#8217;t</title>
		<link>http://www.udidahan.com/2009/04/10/backwards-compatibility-why-most-versioning-problems-arenrsquot/</link>
		<comments>http://www.udidahan.com/2009/04/10/backwards-compatibility-why-most-versioning-problems-arenrsquot/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 13:17:17 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Autonomous Services]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Simplicity]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/2009/04/10/backwards-compatibility-why-most-versioning-problems-arenrsquot/</guid>
		<description><![CDATA[
I’ve been to too many clients where I’ve been brought in to help them with their problems around service versioning when the solution I propose is simply to have version N+1 of the system be backwards-compatible with version N. If two adjacent versions of a given system aren’t compatible with each other, it is practically [...]]]></description>
			<content:encoded><![CDATA[<p><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 10px 10px; border-right-width: 0px" height="244" alt="image" src="http://www.udidahan.com/wp-content/ServicesVersioningPubSubandMultipleInher_11E4C/image.png" width="244" align="right" border="0" />
<p>I’ve been to too many clients where I’ve been brought in to help them with their problems around service versioning when the solution I propose is simply to have version N+1 of the system be backwards-compatible with version N. If two adjacent versions of a given system aren’t compatible with each other, it is practically impossible to solve versioning issues.</p>
<p>Here’s what happens when versions aren’t compatible:</p>
<blockquote><p>Admins stop the system from accepting any new requests, and wait until all current requests are done processing. They take a backup/snapshot of all relevant parts of the system (like data in the DB). Then, bring down the system – all of it. Install the new version on all machines. Bring everything back up. Let the users back in.</p></blockquote>
<p>If, heaven-forbid, problems were uncovered with the new version (since some problems only appear in production), the admins have to roll back to the previous version – once again bringing everything down.</p>
<p>This scenario is fairly catastrophic for any company that requires not-even high availability, but pretty continuous availability – like public facing web apps.</p>
<p>If adjacent versions were compatible with each other, we could upgrade the system piece-meal – machine by machine, where both the old and new versions will be running side by side, communicating with each other. While the system’s performance may be sub-optimal, it will continue to be available throughout upgrades as well as downgrades.</p>
<p>This isn’t trivial to do.</p>
<p>It impacts how you decide what is (and more importantly, what isn’t) nullable.</p>
<p>It may force you to spread certain changes to features across more versions (aka releases).</p>
<p>As such, you can expect this to affect how you do release and feature planning.</p>
<p>However, if you do not take these factors into account, it’s almost a certainty that your versioning problems will persist and no technology (new or old) will be able to solve them.</p>
<p>Coming next… Units of versioning – inside and outside a service.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2009/04/10/backwards-compatibility-why-most-versioning-problems-arenrsquot/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>MSDN Magazine Smart Client Article</title>
		<link>http://www.udidahan.com/2009/03/28/msdn-magazine-smart-client-article/</link>
		<comments>http://www.udidahan.com/2009/03/28/msdn-magazine-smart-client-article/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 19:16:39 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[ESB]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Pub/Sub]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[Smart Client]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/2009/03/28/msdn-magazine-smart-client-article/</guid>
		<description><![CDATA[
My article on “optimizing a large-scale Software+Services application” has been published in the April edition of MSDN Magazine.
Here’s a short excerpt:
“We had to juggle occasional connectivity, data synchronization, and publish/subscribe all at the same time. We learned that we couldn’t solve all problems either client-side or server-side, but rather that an integrated approach was needed [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://msdn.microsoft.com/en-us/magazine/dd569749.aspx"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; margin: 0px 0px 10px 10px; border-left: 0px; border-bottom: 0px" height="244" alt="image" src="http://www.udidahan.com/wp-content/uploads/MSDNMagazineSmartClientArticle_13E17/image.png" width="189" align="right" border="0" /></a></p>
<p>My article on “optimizing a large-scale Software+Services application” has been published in the April edition of MSDN Magazine.</p>
<p>Here’s a short excerpt:</p>
<blockquote><p>“We had to juggle occasional connectivity, data synchronization, and publish/subscribe all at the same time. We learned that we couldn’t solve all problems either client-side or server-side, but rather that an integrated approach was needed since any changes on one side needed corresponding changes on the other side.”</p></blockquote>
<p><a href="http://msdn.microsoft.com/en-us/magazine/dd569749.aspx">Continue reading… </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2009/03/28/msdn-magazine-smart-client-article/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Building Super-Scalable Web Systems with REST</title>
		<link>http://www.udidahan.com/2008/12/29/building-super-scalable-web-systems-with-rest/</link>
		<comments>http://www.udidahan.com/2008/12/29/building-super-scalable-web-systems-with-rest/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 21:38:58 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Caching]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/2008/12/29/building-super-scalable-web-systems-with-rest/</guid>
		<description><![CDATA[I&#8217;ve been consulting with a client who has a wildly successful web-based system, with well over 10 million users and looking at a tenfold growth in the near future. One of the recent features in their system was to show users their local weather and it almost maxed out their capacity. That raised certain warning [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been consulting with a client who has a wildly successful web-based system, with well over 10 million users and looking at a tenfold growth in the near future. One of the recent features in their system was to show users their local weather and it almost maxed out their capacity. That raised certain warning flags as to the ability of their current architecture to scale to the levels that the business was taking them.</p>
<p> <center><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="139" alt="danger" src="http://www.udidahan.com/wp-content/uploads/image51.png" width="408" border="0"></center>
</p>
<h3>On Web 2.0 Mashups</h3>
<p>One would think that sites like Weather.com and friends would be the first choice for implementing such a feature. Only thing is that they were strongly against being mashed-up Web 2.0 style on the client &#8211; they had enough scalability problems of their own. Interestingly enough (or not), these partners were quite happy to publish their weather data to us and let us handle the whole scalability issue.</p>
<h3>Implementation 1.0</h3>
<p>The current implementation was fairly straightforward &#8211; client issues a regular web service request to the GetWeather webmethod, the server uses the user&#8217;s IP address to find out their location, then use that location to find the weather for that location in the database, and return that to the user. Standard fare for most dynamic data and the way most everybody would tell you to do it.</p>
<p>Only thing is that it scales like a dog.</p>
<h3>Add Some Caching</h3>
<p>The first thing you do when you have scalability problems and the database is the bottleneck is to cache, well, that&#8217;s what everybody says (same everybody as above).</p>
<p>The thing is that holding all the weather of the entire globe in memory, well, takes a lot of memory. More than is reasonable. In which case, there&#8217;s a fairly decent chance that a given request can&#8217;t be served from the cache, resulting in a query to the database, an update to the cache, which bumps out something else, in short, not a very good hit rate.</p>
<p>Not much bang for the buck.</p>
<p>If you have a single datacenter, having a caching tier that stores this data is possible, but costly. If you want a highly available, business continuity supportable, multi-datacenter infrastructure, the costs add up quite a bit quicker &#8211; to the point of not being cost effective (&#8221;You need HOW much money for weather?! We&#8217;ve got dozens more features like that in the pipe!&#8221;)</p>
<p>What we can do is to tell the client we&#8217;re responding to that they can cache the result, but that isn&#8217;t close to being enough for us to scale.</p>
<h3>Look at the Data, Leverage the Internet</h3>
<p>When you find yourself in this sort of situation, there&#8217;s really only one thing to do:</p>
<div style="border-right: black 1px solid; border-top: black 1px solid; float: right; margin-left: 5px; border-left: black 1px solid; width: 220px; border-bottom: black 1px solid; background-color: beige">
<div style="font-size: 12px; margin: 5px">
<p>In order to save on bandwidth, the most precious commodity of the internet, the various ISPs and backbone providers cache aggressively. In fact, HTTP is designed exactly for that. </p>
<p>If user A asks for some html page, the various intermediaries between his browser and the server hosting that page will cache that page (based on HTTP headers). When user B asks for that same page, and their request goes through one of the intermediaries that user A&#8217;s request went through, that intermediary will serve back its cached copy of the page rather than calling the hosting server.</p>
<p>Also, users located in the same geographic region by and large go through the same intermediaries when calling a remote site.</p>
</div>
</div>
<p>Leverage the Internet</p>
<p>The internet is the biggest, most scalable data serving infrastructure that mankind was lucky enough to have happen to it. However, in order to leverage it &#8211; you need to understand your data and how your users use it, and finally align yourself with the way the internet works.</p>
<p>Let&#8217;s say we have 1,000 users in London. All of them are going to have the same weather. If all these users come to our site in the period of a few hours and ask for the weather, they all are going to get the exact same data. The thing is that the response semantics of the GetWeather webmethod must prevent intermediaries from caching so that users in Dublin and Glasgow don&#8217;t get London weather (although at times I bet they&#8217;d like to).</p>
<h3>REST Helps You Leverage the Internet</h3>
<p>Rather than thinking of getting the weather as an operation/webmethod, we can represent the various locations weather data as explicit web resources, each with its own URI. Thus, the weather in London would be <strong>http://weather.myclient.com/UK/London</strong>.</p>
<p>If we were able to make our clients in London perform an HTTP GET on <strong>http://weather.myclient.com/UK/London</strong> then we could return headers in the HTTP response telling the intermediaries that they can cache the response for an hour, or however long we want.</p>
<p>That way, after the first user in London gets the weather from our servers, all the other 999 users will be getting the same data served to them from one of the intermediaries. Instead of getting hammered by millions of requests a day, the internet would shoulder easily 90% of that load making it much easier to scale. <a href="http://www.perkel.com/politics/gore/internet.htm">Thanks Al</a>.</p>
<p>This isn&#8217;t a &#8220;cheap trick&#8221;. While being straight forward for something like weather, understanding the nature of your data and intelligently mapping that to a URI space is critical to building a scalable system, and reaping the benefits of REST.</p>
<h3>What&#8217;s left?</h3>
<p>The only thing that&#8217;s left is to get the client to know which URI to call. A simple matter, really. </p>
<p>When the user logs in, we perform the IP to location lookup and then write a cookie to the client with their location (UK/London). That cookie then stays with the user saving us from having to perform that IP to location lookup all the time. On subsequent logins, if the cookie is already there, we don&#8217;t do the lookup.</p>
<blockquote><p>BTW, we also show the user &#8220;you&#8217;re in London, <font color="#0000ff"><strong><u>aren&#8217;t you</u></strong></font>?&#8221; with the link allowing the user to change their location, which we then update the cookie with and change the URI we get the weather from.</p>
</blockquote>
<h3>In Closing</h3>
<p>While web services are great for getting a system up and running quickly and interoperably, scalability often suffers. Not so much as to be in your face, but after you&#8217;ve gone quite a ways and invested a fair amount of development in it, you find it standing between you and the scalability you seek.</p>
<p>Moving to REST is not about turning on the &#8220;make it restful&#8221; switch in your technology stack (ASP.NET MVC and WCF, I&#8217;m talking to you). Just like with databases there is no &#8220;make it go fast&#8221; switch &#8211; you really do need to understand your data, the various users access patterns, and the volatility of the data so that you can map it to the &#8220;right&#8221; resources and URIs.</p>
<p>If you do walk the RESTful path, you&#8217;ll find that the scalability that was once so distant is now within your grasp.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2008/12/29/building-super-scalable-web-systems-with-rest/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>Scaling Long Running Web Services</title>
		<link>http://www.udidahan.com/2008/07/30/scaling-long-running-web-services/</link>
		<comments>http://www.udidahan.com/2008/07/30/scaling-long-running-web-services/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 12:06:38 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/2008/07/30/scaling-long-running-web-services/</guid>
		<description><![CDATA[While I was at TechEd USA I had an attendee, Will, come up and ask me an interesting question about how to handle web service calls that can take a long time to complete. He has a number of these kinds of requests ranging from computationally intensive tasks to those requiring sifting through large amounts [...]]]></description>
			<content:encoded><![CDATA[<p>While I was at TechEd USA I had an attendee, Will, come up and ask me an interesting question about how to handle web service calls that can take a long time to complete. He has a number of these kinds of requests ranging from computationally intensive tasks to those requiring sifting through large amounts of data. What Will was having problems with was preventing too many of these resource-intensive tasks from running concurrently (causing increased memory usage, paging, and eventually the server becoming unavailable). </p>
<p>For comparison later, here&#8217;s a diagram showing the trivial interaction:</p>
<p><a href="http://www.udidahan.com/wp-content/uploads/image30.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="354" alt="image" src="http://www.udidahan.com/wp-content/uploads/image-thumb26.png" width="484" border="0"></a> </p>
<p>One solution that he&#8217;d tried was to set up the web server to throttle those requests and keep a much smaller maximum thread-pool size for that application pool. The unfortunate side effect of that solution was that clients would get &#8220;turned away&#8221; by a not-so-pleasant Connection Refused exception.</p>
<p>Will had been to my <a href="http://www.udidahan.com/2008/06/06/web-scalability-slides-and-code/">web scalability talk</a> and was curious about how I was using queues behind my web services. I&#8217;ve also heard this question from people just getting started with <a href="http://www.nServiceBus.com">nServiceBus</a> when looking at the Web Services Bridge sample. Here&#8217;s the code that&#8217;s in the sample and in just a second I&#8217;ll tell you why you shouldn&#8217;t do this:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<div class="csharpcode" style="overflow: scroll; width: 95%">
<pre class="alt">[WebMethod]</pre>
<pre><span class="kwrd">public</span> ErrorCodes Process(Command request)</pre>
<pre class="alt">{</pre>
<pre>    <span class="kwrd">object</span> result = ErrorCodes.None;</pre>
<pre class="alt">&nbsp;</pre>
<pre>    IAsyncResult sync = Global.Bus.Send(request).Register(</pre>
<pre class="alt">        <span class="kwrd">delegate</span>(IAsyncResult asyncResult)</pre>
<pre>          {</pre>
<pre class="alt">              CompletionResult completionResult = asyncResult.AsyncState <span class="kwrd">as</span> CompletionResult;</pre>
<pre>              <span class="kwrd">if</span> (completionResult != <span class="kwrd">null</span>)</pre>
<pre class="alt">              {</pre>
<pre>                  result = (ErrorCodes) completionResult.ErrorCode;</pre>
<pre class="alt">              }</pre>
<pre>          },</pre>
<pre class="alt">          <span class="kwrd">null</span></pre>
<pre>          );</pre>
<pre class="alt">&nbsp;</pre>
<pre>    sync.AsyncWaitHandle.WaitOne();</pre>
<pre class="alt">&nbsp;</pre>
<pre>    <span class="kwrd">return</span> (ErrorCodes)result;</pre>
<pre class="alt">}</pre>
</div>
<p>Let me repeat, this is demo-ware. Do not use this in production.</p>
<p>What&#8217;s happening is that in this web service call we&#8217;re putting a message in a queue for some other process/machine to process. When that processing is complete, we&#8217;ll get a message back in our local queue (which you don&#8217;t see) which is correlated to our original request, firing off the callback. We block the web method from completing (using the WaitOne call) thus keeping the HTTP connection to the client open.</p>
<p>The problem here is that we&#8217;re wasting resources (the HTTP connection and the thread) while waiting for a response which, as already mentioned, can take a long time. In B2B or other server to server integration environments there are all sorts of middleware solutions that help us solve these problems, however in Will&#8217;s case browsers needed to interact with this web service. All he had was HTTP.</p>
<h4>HTTP Solutions</h4>
<p>Another attendee who was listening in (sorry I don&#8217;t remember your name) said that he was solving similar problems using polling but that he was having scalability problems as well.</p>
<p>What often surprises my clients when we deal with these same issues is that I <em>do</em> suggest a polling based solution, but one that still uses messaging, and this is what I described to Will:</p>
<p>Since we can&#8217;t actually push a message to a browser over HTTP from our server when processing is complete, the browser itself will be responsible for pulling the response. We still don&#8217;t want to leave costly resources like HTTP connections open a long time, however if the browser is going to polling for a response, we&#8217;ll need some way to correlate those following requests with the original one. What we&#8217;re going to do is use the <a href="http://www.smallmemory.com/almanac/PyaraliEtc98.html">Asynchronous Completion Token</a> pattern, and later I&#8217;ll show how to optimize it for web server technology. </p>
<h4>Basic Polling</h4>
<p><a href="http://www.udidahan.com/wp-content/uploads/image31.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="453" alt="image" src="http://www.udidahan.com/wp-content/uploads/image-thumb27.png" width="574" border="0"></a> </p>
<p>When the browser calls the web service, the web service will generate a Guid, put it in the message that it sends for processing, and return that guid to the browser. When the processing of the message is complete, the result will be written to some kind of database, indexed by that guid. The browser will periodically call another web method, passing in the guid it previously received as a parameter. That web method will check the database for a response using the guid, returning null if no response is there. If the browser receives a null response, it will &#8220;sleep&#8221; a bit and then retry.</p>
<p>One of the problems with this solution is that polling uses up server resources &#8211; both on the web server and our DB; threads, memory, DB connections. A better solution would decrease the resource cost of the polling. Let&#8217;s use the fundamental building blocks of the web to our advantage &#8211; HTTP GET and resources:</p>
<h4>REST-full Polling</h4>
<p>Instead of using a guid to represent the id of the response, let&#8217;s consider the REST principle of &#8220;everything&#8217;s a resource&#8221;. That would mean that the response itself would be a resource. And since every resource has a URI, we might as well use that URI in lieu of the guid. So, instead of our web service returning a guid, let&#8217;s return a URI &#8211; something like:</p>
<p><a href="http://www.acme.com/responses/88ec5359-a5d8-4491-a570-3bfe469f3a64.xml">http://www.acme.com/responses/88ec5359-a5d8-4491-a570-3bfe469f3a64.xml</a></p>
<p>As you can see, the guid is still there. So, what&#8217;s different?</p>
<p><a href="http://www.udidahan.com/wp-content/uploads/image32.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="486" alt="image" src="http://www.udidahan.com/wp-content/uploads/image-thumb28.png" width="574" border="0"></a> </p>
<p>What&#8217;s different is that instead of having the processing code write the response to the database, it writes it to a resource. This can be done by writing some XML to a file on the SAN in the case of a webfarm. Also, the browser wouldn&#8217;t need to call a web service to get the response, it would just do an HTTP GET on the URI. If the it gets an HTTP 404, it would sleep and retry as before. The reason that the SAN is needed is that, as the browser polls, it may have its requests arrive at various web servers so the response needs to be accessible from any one of them. </p>
<blockquote>
<p>Just as an aside, it would be better to free the processing node as quickly as possible and have something else write the response to the SAN. That would be done simply by sending a message from the processing node that would be handled by a different node that all it did was write responses to disk.</p>
</blockquote>
<p>The reason that the URI makes a difference is that serving &#8220;static&#8221; resources is something that web servers do <em>extremely efficiently</em> without requiring any managed resources (like ASP.NET threads). That&#8217;s a big deal.</p>
<p>We&#8217;re still using HTTP connections for the polling but that&#8217;s something whose effect can be mitigated to a certain degree.</p>
<h4>Timed REST-full Polling<a href="http://www.udidahan.com/wp-content/uploads/image33.png"><img style="border-right: 0px; border-top: 0px; margin: 0px 0px 10px 10px; border-left: 0px; border-bottom: 0px" height="221" alt="image" src="http://www.udidahan.com/wp-content/uploads/image-thumb29.png" width="134" align="right" border="0"></a> </h4>
<p>Since various requests can take varying amounts of time to process, it&#8217;s difficult to know at what rate the browser should poll. So, why don&#8217;t we have the web service <em>tell it</em>. As a part of the response to the original web service call, instead of just returning a URI, we could also return the polling interval &#8211; 1 second, 5 seconds, whatever is appropriate for the type of request. This value could easily be configurable [RequestType, PollingInterval].</p>
<p>An even more advanced solution would allow you to change these values dynamically. The advantage that would be gained would be that your operations team could better manage the load on your servers. When a large number of users are hitting your system, you could decrease the rate at which your servers would be polled, thus leaving more HTTP connections for other users. </p>
<h4>Scaling and Adaptive Polling</h4>
<p>You&#8217;d probably also want to scale out the number of processing nodes behind your queue. The nice thing is that you could change the polling interval as you scale the various processing nodes per request type providing better responsiveness for the more critical requests. Once we add virtualization, things get really fun:</p>
<p>We had separate queues per request type, so that we could easily see the load we were under for each type of request. That way, we could scale out the processing nodes per request type as well as change the polling interval. By virtualizing our processing nodes, and writing scripts to monitor queue sizes, we had those scripts automatically provisioning (and de-provisioning) nodes as well as changing the polling interval of the browsers.</p>
<p>This had the enormous benefit of the system automatically shifting resources to provide the appropriate relative allocation for the current load as its macroscopic make-up changed.</p>
<h4>Summary</h4>
<p>Will was well-pleased with the solution which, although more complicated than what he had originally tried, was flexible enough to meet his needs. As opposed to pure server-based solutions, here we make more use of the browser (writing our own Javascript) instead of putting our faith in some Ajax-y library. That&#8217;s not to say that you couldn&#8217;t wrap this up into a library &#8211; in essence, it is a kind of messaging transport for browser to server communication allowing duplex conversations.</p>
<p>In fact, what could be done is to return multiple responses to the browser over a long period of time. In the response that comes back to the browser could be an additional URI where the next response will be. This can be used for reporting the status of a long running process, paging results, and in many other scenarios.</p>
<p>And, one parting thought, could this not be used for all browser to web service communication?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2008/07/30/scaling-long-running-web-services/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>[Podcast] Highly Scalable Web Architectures</title>
		<link>http://www.udidahan.com/2008/06/19/podcast-highly-scalable-web-architectures/</link>
		<comments>http://www.udidahan.com/2008/06/19/podcast-highly-scalable-web-architectures/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 20:42:34 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Caching]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[Pub/Sub]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/19/podcast-highly-scalable-web-architectures/</guid>
		<description><![CDATA[For those people who couldn&#8217;t come to TechEd USA and didn&#8217;t see my talks on how to build highly scalable web architectures, you&#8217;re in luck &#8211; Craig, the man behind the Polymorphic Podcast sat down with me and we chatted about what the problems, common solutions, and effective tactics there are in this space. For [...]]]></description>
			<content:encoded><![CDATA[<p>For those people who couldn&#8217;t come to TechEd USA and didn&#8217;t see my talks on how to build highly scalable web architectures, you&#8217;re in luck &#8211; Craig, the man behind the <a href="http://polymorphicpodcast.com">Polymorphic Podcast</a> sat down with me and we chatted about what the problems, common solutions, and effective tactics there are in this space. For those of you who <em>were</em> at TechEd and still <em>didn&#8217;t</em> come to my talk &#8211; <em>what were you thinking?!</em></p>
<p> <img src='http://www.udidahan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://polymorphicpodcast.com/shows/scaletheweb/">Check it out.</a></p>
<p>Some of this stuff is a bit counter-intuitive (and not readily supported by the tools available in Visual Studio) so please, do feel free to ask questions (in the comments below).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2008/06/19/podcast-highly-scalable-web-architectures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I Hate WSDL</title>
		<link>http://www.udidahan.com/2008/03/28/i-hate-wsdl/</link>
		<comments>http://www.udidahan.com/2008/03/28/i-hate-wsdl/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 16:44:28 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[ESB]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Pub/Sub]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/03/28/i-hate-wsdl/</guid>
		<description><![CDATA[Ted says it really well, and let me add a big +1.
Note to those who didn&#8217;t attend the session: you didn&#8217;t hear me say it, so I&#8217;ll repeat it: I hate WSDL almost as much as I hate Las Vegas. Ask me why sometime, or if I get enough of a critical mass of questions, [...]]]></description>
			<content:encoded><![CDATA[<p>Ted <a href="http://blogs.tedneward.com/2008/03/28/Hangin+In+Vegas.aspx">says it really well</a>, and let me add a big +1.</p>
<blockquote><p><em>Note to those who didn&#8217;t attend the session: you didn&#8217;t hear me say it, so I&#8217;ll repeat it: I hate WSDL almost as much as I hate Las Vegas. Ask me why sometime, or if I get enough of a critical mass of questions, I&#8217;ll blog it. If you&#8217;ve seen me do talks on Web Services, though, you&#8217;ve probably heard the rant: WSDL creates tightly-coupled endpoints precisely where loose coupling is necessary, WSDL encourages schema definitions that are inflexible and unevolvable, and WSDL intrinsically assumes a synchronous client-server invocation model that doesn&#8217;t really meet the scalability or feature needs of the modern enterprise. And that&#8217;s just for starters.</em>
<p><em>I hate WSDL.</em>
<p><em>I still hate Vegas more, though.</em></p>
</blockquote>
<p><a href="http://udidahan.weblogs.us/wp-content/uploads/image11.png"><img style="border-right: 0px; border-top: 0px; margin: 0px 0px 0px 20px; border-left: 0px; border-bottom: 0px" height="156" alt="image" src="http://udidahan.weblogs.us/wp-content/uploads/image-thumb8.png" width="152" align="right" border="0"></a> Web Services, and WSDL by connection have taken hold of the industry like cancer &#8211; inhibiting the minds of otherwise intelligent developers and architects. Whenever I get the &#8220;Web Services Question&#8221; (Does X support Web Services &#8211; where X is some design pattern, tool, and sometimes nServiceBus), I have to suppress an urge to groan &#8211; I&#8217;ve got the question <em>that</em> many times. The other day I was at a client and Sam, their head architect asked me that question. I gave my stock response:</p>
<blockquote><p>&#8220;When you say &#8216;Web Services&#8217;, are you referring to SOAP or WSDL, and is HTTP a necessary component too?&#8221;</p>
</blockquote>
<p>See how good I got at the suppressing thing?</p>
<p>Sam conceded that Web Services over TCP is OK too, so I pressed on with:</p>
<blockquote><p>&#8220;What about UDP? FTP? MSMQ? Is it still &#8216;Web Services&#8217; then? Is the rule then that &#8216;Web Services&#8217; == SOAP?&#8221;</p>
</blockquote>
<p>At that point, Sam was beginning to get a little flustered. </p>
<blockquote><p>&#8220;And what&#8217;s so great about SOAP? Is it the interoperability? Because that&#8217;s just because it&#8217;s based on XSD.&#8221;</p>
</blockquote>
<p>He didn&#8217;t know how to reply. Instead, he walked away from the whiteboard and sat down. I didn&#8217;t let up:</p>
<blockquote><p>&#8220;And what if we want to do something other than Request/Response? How about one request with many responses? How about many requests and one response? And why does this decision need to be rigid? Shouldn&#8217;t we just be able to decide programmatically how many responses we want to return? Wouldn&#8217;t that flexibility be better than creating huge response structures for web methods to return?&#8221;</p>
</blockquote>
<p><a href="http://udidahan.weblogs.us/wp-content/uploads/image13.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="132" alt="image" src="http://udidahan.weblogs.us/wp-content/uploads/image-thumb9.png" width="189" align="right" border="0"></a> Sam made his last stand:</p>
<blockquote><p>&#8220;Look, we can&#8217;t go and do something different from the rest of the industry. Everybody else is doing Web Services. It&#8217;s not like the technology doesn&#8217;t work.&#8221;</p>
</blockquote>
<p>I gave way, a little:</p>
<blockquote><p>&#8220;If you want, we can offer two interfaces. One, the flexible, robust, scalable XSD over messaging based solution. The second, an icky, synchronous Web Services facade which calls into our first interface. </p>
<p>I&#8217;m not saying that the technology doesn&#8217;t work &#8211; but both of us know that every problem has multiple solutions, some are fragile and error prone like WS, others are more elegant and have decades of knowledge behind them like messaging.</p>
<p>But we can do both if you like. How&#8217;s that?&#8221;</p>
</blockquote>
<p><a href="http://udidahan.weblogs.us/wp-content/uploads/image14.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="166" alt="image" src="http://udidahan.weblogs.us/wp-content/uploads/image-thumb11.png" width="244" align="right" border="0"></a> And it was agreed. The entire system would be built on one-way messaging patterns using XSD in cases where interoperability was required. And WS would be layered on, like a tiny little pig on top of a gigantic lipstick &#8230; thing &#8211; hmm, that metaphor isn&#8217;t really working &#8211; well, you get the idea.</p>
<p>I hate WSDL. Never been to Vegas, though.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2008/03/28/i-hate-wsdl/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>QCon London 2008 Recap</title>
		<link>http://www.udidahan.com/2008/03/20/qcon-london-2008-recap/</link>
		<comments>http://www.udidahan.com/2008/03/20/qcon-london-2008-recap/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 09:07:06 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[OO]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/03/20/qcon-london-2008-recap/</guid>
		<description><![CDATA[Well QCon was a blast.
NServiceBus Tutorial
I gave a full day tutorial on nServiceBus and we had a full house! The tutorial was about 90% how to think about distributed systems, and 10% mapping those concepts onto nServiceBus. I made an effort to cram about 3 days of a 5 day training course I give clients [...]]]></description>
			<content:encoded><![CDATA[<p>Well QCon was a blast.</p>
<h3>NServiceBus Tutorial</h3>
<p>I gave a full day tutorial on <a href="http://www.nservicebus.com">nServiceBus</a> and we had a full house! The tutorial was about 90% how to think about distributed systems, and 10% mapping those concepts onto nServiceBus. I made an effort to cram about 3 days of a 5 day training course I give clients into one day, but I think I was only about 85% successful. People didn&#8217;t have the time needed to let things really sink in and ask questions, but the <a href="http://tech.groups.yahoo.com/group/nservicebus/">lively forums</a> and <a href="http://udidahan.weblogs.us/2008/02/25/would-you-spend-a-buck-to-save-a-hundred/">skype conversations</a> available will probably do the trick.</p>
<p><a href="http://jim.webber.name/">Jim Webber</a> after looking at the unit testing features of nServiceBus had this to say:</p>
<blockquote><p>&#8220;Oh my God &#8211; you&#8217;ve created testable middleware! It&#8217;ll never catch on. The vendors won&#8217;t have it.&#8221;</p>
</blockquote>
<p>To which I replied that several vendors were already coming on board with their own implementations of transports and saga persistence. I have absolutely no intention, desire, or (quite frankly) the ability to write an enterprise-class middleware runtime. All I hope to do with nServiceBus is to make it so that developers use what&#8217;s out there in one, middleware-product-agnostic way that will make their code more robust and flexible.</p>
<h3>MEST &amp; Mark &#8211; REST &amp; Stefan</h3>
<p>It was also great finally meeting the head MESTian, <a href="http://markclittle.blogspot.com/">Mark Little</a>, who also happens to work for Redhat as SOA Technical Development Manager and Director of Standards in the JBoss division. It was interesting to see the difference between how I went about messaging in nServiceBus (full peer-to-peer including pub/sub) whereas most of the Java world has the messaging infrastructure handled by something database-like in a deployment/networking kind of perspective. If that&#8217;s the way things are done, then I can definitely appreciate the advantages of <a href="http://udidahan.weblogs.us/2007/06/20/space-based-architecture-%e2%80%93-scalable-but-not-much-to-do-with-soa/">Space-Based Architectures</a>.</p>
<p>And I even got to steal <a href="http://www.innoq.com/blog/st/">Stefan Tilkov</a>&#8217;s RESTful ear for an hour or so before I had to jet back home. It looks like we MESTians and RESTians can be one big happy family. I&#8217;m guessing that our despise of WS connects us all at a deeper level <img src='http://www.udidahan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Core Design Principles</h3>
<p>I also gave a talk about core design principles, &#8220;Intentions &amp; Interfaces &#8211; making patterns concrete&#8221;, and it went over very well especially considering that that was the first time that I gave that talk. You can find the slides <a href="http://www.eos1.dk/qcon-london-2008/slides/UdiDahan_IntentionsAndInterfaces.pdf">here</a>. From the feedback I heard after the talk, I think many people were surprised how many different parts of a system can be designed this way, and how flexible it is without making the code any more complex. The message was this:</p>
<blockquote><p>Make Roles Explicit</p>
</blockquote>
<p>Despite its simplicity, that leads to IEntity, IValidator&lt;T&gt; where T : IEntity, (which I wrote about a year ago &#8211; <a href="http://udidahan.weblogs.us/2007/04/30/generic-validation/">generic validation</a>) and with a bit of Service Locator capabilities, you can add a line of code to your infrastructure that will validate all entities before they&#8217;re sent from the client to the server. </p>
<p>It leads to IFetchingStrategy&lt;T&gt; for improved database loading performance (also a year old &#8211; <a href="http://udidahan.weblogs.us/2007/03/06/better-domain-driven-design-implementation/">better DDD implementation</a> and the <a href="http://udidahan.weblogs.us/2007/09/16/fetching-strategy-nhibernate-implementation-available/">NHibernate implementation</a>). </p>
<p>It&#8217;s also how nServiceBus does message handling &#8211; IMessage, IMessageHandler&lt;T&gt; where T: IMessage, ISaga&lt;T&gt; where T : IMessage.</p>
<h3>San Francisco?</h3>
<p>Just a quick shout to my readers in the San Francisco area, if you&#8217;d be interested in hearing these talks/tutorials, give the organizers of QCon a <a href="mailto:qcon@infoq.com">shout</a> and they&#8217;ll bring me out. That&#8217;s actually what got me to London &#8211; one of the attendees of a talk I gave at Oredev in Sweden last November missed my tutorial there so he put in a request and that did it. (Thanks Jan, I appreciate it!)</p>
<p>If you&#8217;re in a different part of the world and you&#8217;d like to have me give one of these talks, or other ones (I have a fair amount of material on Domain Models/DDD and Occasionally Connected Smart Clients), I&#8217;d be happy to make the trip and see you there as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2008/03/20/qcon-london-2008-recap/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>[Podcast] REST + Messaging = Enterprise Solutions</title>
		<link>http://www.udidahan.com/2008/03/16/podcast-rest-messaging-enterprise-solutions/</link>
		<comments>http://www.udidahan.com/2008/03/16/podcast-rest-messaging-enterprise-solutions/#comments</comments>
		<pubDate>Sun, 16 Mar 2008 12:40:02 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Ask Udi Podcast]]></category>
		<category><![CDATA[ESB]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[Pub/Sub]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/03/16/podcast-rest-messaging-enterprise-solutions/</guid>
		<description><![CDATA[In this podcast we revisit the topic of REST and how to make it work for process-centric enterprise systems. After describing the basic advantages and pitfalls of plain resource thinking, we&#8217;ll look at how mapping messaging concepts to resources provides solutions for transactional, multi-resource processing.
&#160;
Download

Download via the Dr. Dobb’s site
Or download directly here.

Additional References

Podcast: &#8220;REST [...]]]></description>
			<content:encoded><![CDATA[<p>In this podcast we revisit the topic of REST and how to make it work for process-centric enterprise systems. After describing the basic advantages and pitfalls of plain resource thinking, we&#8217;ll look at how mapping messaging concepts to resources provides solutions for transactional, multi-resource processing.
<p>&nbsp;<br />
<h3>Download</h3>
<blockquote>
<p><a href="http://www.ddj.com/architect/206903485">Download via the Dr. Dobb’s site</a></p></blockquote>
<blockquote><p>Or download directly <a href="http://www.dobbsprojects.com/media/newengine/dynamp.php/080313ud01.mp3?podcast=080313ud01.mp3">here</a>.</p>
</blockquote>
<h3>Additional References</h3>
<ul>
<li><a href="http://udidahan.weblogs.us/2006/07/21/podcastthe-rest-vs-web-services-debate/">Podcast: &#8220;REST vs Web Services Debate&#8221; </a>
<li><a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">REST Definition</a>
<li><a href="http://www.ics.uci.edu/%7Efielding/pubs/dissertation/top.htm">Roy Fielding&#8217;s Thesis: &#8220;Architectural Styles and the Design ofNetwork-based Software Architectures&#8221;</a></li>
<li><a href="http://en.wikipedia.org/wiki/HTTP_ETag">ETag Definition</a></li>
</ul>
<h3>Want more?</h3>
<blockquote><p>Check out the <a href="http://udidahan.weblogs.us/ask-udi/">“Ask Udi”</a> archives.</p>
</blockquote>
<h3>Got a question?</h3>
<blockquote><p><a href="mailto:podcast@UdiDahan.com">Send Udi your question to answer on the show.</a></p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2008/03/16/podcast-rest-messaging-enterprise-solutions/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
<enclosure url="http://www.dobbsprojects.com/media/newengine/dynamp.php/080313ud01.mp3?podcast=080313ud01.mp3" length="0" type="audio/mp3" />
		</item>
		<item>
		<title>Distributed Architecture on ARCast.TV Rapid Response</title>
		<link>http://www.udidahan.com/2008/01/14/distributed-architecture-on-arcasttv-rapid-response/</link>
		<comments>http://www.udidahan.com/2008/01/14/distributed-architecture-on-arcasttv-rapid-response/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 23:45:34 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[MSMQ]]></category>
		<category><![CDATA[Podcast]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/01/14/distributed-architecture-on-arcasttv-rapid-response/</guid>
		<description><![CDATA[A while ago, me and Ron Jacobs (virtually) got together and did a couple &#8220;rapid responses&#8221; to questions on the MSDN architecture forums, and I just noticed that they&#8217;re online. The really great thing is that there are transcripts! For your convenience, I&#8217;ve included them here.
By the way, if you&#8217;re looking for more Q&#38;A style [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago, me and Ron Jacobs (virtually) got together and did a couple &#8220;rapid responses&#8221; to questions on the MSDN architecture forums, and I just noticed that they&#8217;re <a href="http://channel9.msdn.com/ShowPost.aspx?PostID=348243#348243">online</a>. The really great thing is that there are transcripts! For your convenience, I&#8217;ve included them here.</p>
<p>By the way, if you&#8217;re looking for more Q&amp;A style info, check out the <a href="/category/ask-udi-podcast/">Ask Udi podcast</a>. If you have a pressing question and need a shorter turn around time than the month or so it usually takes me for the podcast, send me an email to <a href="mailto:OnlineConsultation@UdiDahan.com">OnlineConsultation@UdiDahan.com.</a></p>
<h3>Number 1</h3>
<blockquote class="speaker_3_text"><p><cite class="speaker_3"><strong>Ron:</strong></cite> Hey, welcome back to ARCast Rapid  Response. This is your host Ron Jacobs and today I&#8217;m looking at the MSDN  architecture forum where I see this message from &#8220;theking2.&#8221; Yeah? OK, so  &#8220;king,&#8221; he says, he&#8217;s building a distributed architecture that has a number of  external systems. These external systems interface through a telnet connection  and so they accept commands and return results as ACKS or  NACKS.</p>
<p>Typically these systems have limited resources for the number of  simultaneous sessions you can open, so, five to fifty depending on the system.  What he did to get around this, was, he created some Enterprise Services objects  and some pooled objects that set up these connections and then he has some Web  services. The Web services are going to receive an incoming message. They&#8217;re  going to call these pooled COM+ objects and they&#8217;re going to make the telnet  calls to the external systems. Sounds interesting.</p>
<p>He says, after a year  of production it has become apparent that some of the external systems are not  performing very well. He says the bulk of the requests, but not all, to the  external systems can be done asynchronously. So, he&#8217;s opting for a message  queue-based solution using pseudosynchronous calls whenever a direct response is  needed.</p>
<p>So, the question is, at what layer would message queuing make  most sense?</p>
<p>So, should the clients, this Web service that receives the  message &#8212; should it do a queue? Put a message in the queue and then the COM+  objects would pop off or they have some central Web services that would pop it.  So, the central Web services or these Enterprise Service objects? Or maybe just  a communication at the top of the telnet. He says this is the first time when  he&#8217;s using message queuing.</p>
<p>On the line with me I have Udi Dahan, the  Software Simplist from Israel.</p>
<p>Udi, this is a very interesting  application and my first gut reaction is, does it really matter where you put  the queuing?</p></blockquote>
<blockquote class="speaker_4_text"><p><cite class="speaker_4"><strong>Udi  Dahan:</strong></cite> Well, actually I took a look at it as well and I&#8217;d have  to say that it does because the problem that he&#8217;s trying to solve isn&#8217;t that  clear. We know that there is some sort of performance problem but we&#8217;re not  quite sure where it is. We know that there are long and varying latencies in the  responses but we&#8217;re not really quite sure why.</p>
<p>While we know that their  external system is a bit slow but our choice of where to put the queue will  probably have an impact, obviously on the development model of the clients and  the Web services as well as how those external systems would work. So, I&#8217;d have  to say that choosing the correct place to put the queue is important.</p></blockquote>
<blockquote class="speaker_3_text"><p><cite class="speaker_3"><strong>Ron:</strong></cite> Well, let me interject something  here because what you said just made me think. Now, if the problem is that these  external systems are slow and limited number of connections, the first question  we ought to ask is, does queuing help this situation at all?</p></blockquote>
<blockquote class="speaker_5_text"><p><cite class="speaker_5"><strong>Udi:</strong></cite> Well, that&#8217;s probably a good first  step. I mean every single time someone comes with a solution and then says, &#8220;OK,  what&#8217;s the problem,&#8221; it&#8217;s always a good thing to check that solution  first.</p>
<p>It looks like the problem that he has here has to deal with or the  reason that he wants to use a queue is to do some kind of load leveling. He&#8217;s  getting too many requests or at too high a rate from his clients and external  Web services and external web applications more than his back end systems can  use. So, using a queue as a load leveling mechanism is definitely the right way  to go. So, from that perspective I think that putting a queue somewhere in there  is a good idea.</p></blockquote>
<blockquote class="speaker_3_text"><p><cite class="speaker_3"><strong>Ron:</strong></cite> OK. So then if you put a queue, it  seems to me that it&#8217;s not going to make that much difference which layer you put  the queue, would it?</p></blockquote>
<blockquote class="speaker_5_text"><p><cite class="speaker_5"><strong>Udi:</strong></cite> Well, it might for the main reason  that you really have to look at where his bottleneck is and that&#8217;s his back end  systems. The bottleneck also has to do with the number of connections that can  be opened and the number of sessions that can be opened. The place that I&#8217;d be  looking at doing that is probably between those pooled COM+ objects and his  central Web services for the main reason that that really gives a nice  encapsulation in terms of the Web services towards both his organization&#8217;s  internal services if they are other Web services, web applications or clients  and everybody else that&#8217;s going on out there while keeping that abstraction out  of the way.</p>
<p>So, the choice of using pooled COM objects is one of the ways  he does the load leveling now. One of the problems he has is that it doesn&#8217;t  seem to be doing that much for him because the switches and knobs that are  available in COM+ in order to do that load leveling aren&#8217;t that great. What I&#8217;d  be looking at in his situation is to put a queue in there but on the back side  of that queue, not talking directly to the external system but doing something  with WCF.</p>
<p>WCF has an incredible amount of switches and knobs in order to  do the load throttling and the number of threads that are open. He could also do  that on a large number of URIs in order to sort of split up the load from that  perspective allowing him to cache results quite a bit better. So, that&#8217;s where  I&#8217;d be looking at too. Just throw away those COM+ objects, put WCF in there, use  the MSMQ binding and start configuring things from there.</p></blockquote>
<blockquote class="speaker_3_text"><p><cite class="speaker_3"><strong>Ron:</strong></cite> There&#8217;s a lot of stuff in the  message, but I think his core concern is performance. He mentions  pseudosynchronous calls. I think by that he means, a message comes in to the web  service, he&#8217;s going to drop something on the queue and then hold that message  response until he gets a response back from a queue. So, it&#8217;s sort of  synchronous but sort of not synchronous. So, in effect he&#8217;s kind of waiting on a  queue instead of waiting on the pooled object to make this outbound telnet  call.</p>
<p>I could agree if you said, &#8220;Well, look, our big problem is that we  keep getting time outs because when we go to get a COM+ object from the pool,  COM+ waits for a while and then it says, &#8220;Hey, there&#8217;s no object available&#8217; and  it returns an error,&#8221; then the queue is definitely going to help that problem.  But in terms of the sheer through put or performance of the system, this is not  going to help at all. It&#8217;s going to still be the same performance.</p>
<p>Now if  you said, &#8220;Oh look, we can do some of this work kind of at a later point in  time, &#8221; well queuing doesn&#8217;t allow you to time shift the work. Right? So, if you  said, &#8220;Look we can rethink this solution.&#8221; So you get a message in, we stuff  something in a queue that we&#8217;ll deal with later, and then very quickly return a  response like some kind of a number like, hey &#8220;your transaction number blah,  blah, blah, will be processed later, it&#8217;s queued for processing, &#8221;  whatever.</p>
<p>I mean that introduces a lot of complexity in the system but it  clearly would provide better response at the Web service layer. What do you  think?</p></blockquote>
<blockquote class="speaker_5_text"><p><cite class="speaker_5"><strong>Udi:</strong></cite> Well I think that at the most basic  level, his throughput is dictated by his back end systems. From what he seems to  be describing, every single request that is going through there, has to hit that  back end system. If he has a limited number of back end systems that are  supporting a limited number of connections, that&#8217;s going to limit his throughput  no matter what technology he puts in front of that. So that&#8217;s at the core level.  You just can&#8217;t get away from that.</p>
<p>The one thing that I would agree with  you in your description there is the choice of using those COM+ objects. I mean  COM+ was a great technology when it came out. The problem occurs, of course,  when we start getting into larger and larger delays around the response time and  we start getting all sorts of time out exceptions and things like that. So in  that respect, I definitely say you know, take a step back from there.</p>
<p>But  in terms of everything that he has around there, the queue isn&#8217;t going to make  the back end system run any faster. What it will do is definitely complicate his  system because he&#8217;s taking something that used to be synchronous and making it  asynchronous. Writing Web services in order to handle that, I mean just adding a  bunch of threads in order to listen to queues is not going to make things any  simpler.</p>
<p>However, what it might do is to improve the resource usage of  those Web services, OK? So instead of having those Web services have a bunch of  threads open, waiting for the response coming back from those COM+ pooled  objects, those threads could be relinquished and really just be triggered back  up when a response comes back from the queue.</p>
<p>So I don&#8217;t see an  improvement in the kind of solution that MSMQ or queuing would put in there in  terms of the latency &#8212; how long it would take for a response to get back.  However, I do see an improvement in terms of the resource usage of all the other  players in the system.</p></blockquote>
<blockquote class="speaker_3_text"><p><cite class="speaker_3"><strong>Ron:</strong></cite> I would agree with that. I would  just say though that if you make the Web server that is hosting these Web  services more resource efficient, maybe all you&#8217;re going to do is enable it to  get more requests in queue the more quickly. Ultimately, this solution I think  is going to solve a lot of problems related to time outs and server busy errors  and that sort of thing, thread contentions, but not likely to increase overall  performance.</p>
<p>But I definitely agree though. I would move this solution  forward to WCF. I used to be on the COM+ team. COM+ was rolled into WCF so that  it would have similar capabilities for pooling, instancing behavior,  transactional support, those sorts of things. I would definitely move that  forward into WCF.</p>
<p>OK! So great answer, Udi. Thank you so much for being  on this ARCast Rapid Response.</p></blockquote>
<h3>Number 2</h3>
<blockquote class="speaker_3_text"><p><cite class="speaker_3"><strong>Ron:</strong></cite> Hey this is Ron Jacobs back with  another ARCast.TV Rapid Response. Today I&#8217;m joined by Udi Dahan, the Software  Simplist from Israel.</p>
<p>Udi, I&#8217;m looking at the MSDN Architecture Forum and  here&#8217;s a question from &#8220;blast.&#8221; Blast says he&#8217;s looking for where to put  business rules. He&#8217;s developing a WinForm application. He uses data sets as the  data layer, he says. He&#8217;s thinking about business rules and where to put  them.</p>
<p>He says obviously, the more organized and centralized business  rules are, the better. He&#8217;s tempted to put the business rules in the UI layer  especially with the type data set. It makes a lot of sense there but not all  rules belong on the client. He says some rules belong on the server, perhaps in  a trigger.</p>
<p>So he&#8217;s asking where do you put your rules? How do you think  about this problem, Udi?</p></blockquote>
<blockquote class="speaker_5_text"><p><cite class="speaker_5"><strong>Udi:</strong></cite> Well, it looks like what he&#8217;s doing  here is developing a two-tier client that is using WinForms and using datasets  and speaking directly to the database. That in essence is part of his problem in  that in terms of performance, he&#8217;d like to run more rules in the UI layer so  that the user won&#8217;t be sending garbage to the database.</p>
<p>He also  understands that because he&#8217;s building a multi-user system, there is a limited  capability, in terms of concurrency, of actually having all the rules run  correctly in order to make sure that everything is correct. So, his choice of an  architecture, working two-tier is the main problem of why he has to fragment his  business rules.</p>
<p>If he were to move towards a three-tier solution, that is  put an application server between his smart client and the database, it would be  a lot easier to put those business rules there. Now, once the business rules are  out of the database, because again, we don&#8217;t have to deal with the concurrency  issues once we have an application server and we&#8217;re using transactions there and  we don&#8217;t have any disconnected problems, then what we can do is use those same  DLLs, that same CLR code that runs the business rules, and deploy it client-side  and use it there.</p>
<p>So, in terms of deployment, what we&#8217;d have is we&#8217;d have  the same rules, both running client-side and server-side, whereas from a  development perspective, we&#8217;d have them organized and centralized. That&#8217;s the  way that I&#8217;d go about it.</p></blockquote>
<blockquote class="speaker_3_text"><p><cite class="speaker_3"><strong>Ron:</strong></cite> Yeah, you know, I think  conceptually I agree with you that a multi-tier solution would be a very good  idea here. What I would probably think about conceptually, is breaking down  rules into things that really ought to happen on the client-side. In particular,  rules related to validation of data, so you know that you&#8217;ve got good and  complete data before you ship it off to the server-side. Oftentimes you have to  do that anyway because you have a button that shouldn&#8217;t be enabled until the  data is valid, or something like that.</p></blockquote>
<blockquote class="speaker_5_text"><p><cite class="speaker_5"><strong>Udi:</strong></cite> Absolutely.</p></blockquote>
<blockquote class="speaker_3_text"><p><cite class="speaker_3"><strong>Ron:</strong></cite> Of course, we all know that if you  have middle-tier web services, you must do validation both on the client-side  and the server-side, because you must ensure that the valid data is received on  the web server. So I agree with you that creating an assembly that you deploy on  both sides is a good idea.</p>
<p>I would just expand on what you said a little  bit and think about maybe on the server-side using a workflow foundation and  business rules and workflow as a way to handle a lot of the heavier lifting,  server-side validations and business rules that might require maybe sifting  through more data or whatever kind of things, but server-side business rules  that are more oriented towards business logic, and even if you have very, very  data-intensive roles, then maybe some of those might even happen in the  database. Don&#8217;t you agree?</p></blockquote>
<blockquote class="speaker_5_text"><p><cite class="speaker_5"><strong>Udi:</strong></cite> Oh, absolutely. Absolutely. That&#8217;s  something that I think often gets swept under the rug too much. Things like  unique constraints and things like that are kinds of business rules. They  protect the referential integrity and if we look at the alternatives, sometimes  getting 10 million rows out of the database, in order to do some sort of unique  email validation upon them, that&#8217;s just going to kill your  performance.</p>
<p>There are certain things that it just makes sense to do them  in the database, it&#8217;s just the best way to do it. The hard part, from a  development perspective, is maintaining the coherence of your business rules.  When you say, &#8220;OK, I want a single perspective, what are all the rules in my  system?&#8221;</p>
<p>Even though we might try to keep it all CLR based, some of the  things like unique constraints, like referential integrity, will be in the  database. So, what I sometimes suggest to do is to have a separate solution, in  terms of your development team, where you put all your business  rules.</p>
<p>This includes both the SQL statements for defining your unique  constraints and your referential integrity. Also put in that validation logic,  your workflow that you&#8217;re going to be running server-side. If it&#8217;s AJAX controls  and regular expressions that you&#8217;re going to be doing client-side in order to  validate that data, absolutely make sure you have, from a development  perspective, one place where you can go where you can see everything, because if  you don&#8217;t do that [inaudible] can be running, and when things stop working, you  won&#8217;t know how to debug it.</p></blockquote>
<blockquote class="speaker_3_text"><p><cite class="speaker_3"><strong>Ron:</strong></cite> All right. Well, excellent answer.  Udi, thank you so much.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2008/01/14/distributed-architecture-on-arcasttv-rapid-response/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Service to NServiceBus Integration Sample</title>
		<link>http://www.udidahan.com/2007/12/16/web-service-to-nservicebus-integration-sample/</link>
		<comments>http://www.udidahan.com/2007/12/16/web-service-to-nservicebus-integration-sample/#comments</comments>
		<pubDate>Sun, 16 Dec 2007 22:18:08 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://udidahan.weblogs.us/2007/12/16/web-service-to-nservicebus-integration-sample/</guid>
		<description><![CDATA[After receiving numerous requests to see how to expose a synchronous web service that communicates asynchronously with other services via nServiceBus, I&#8217;ve finally got a sample up.
I&#8217;ve included a direct link here for convenience (webservicebridge.zip).
In this sample, we have a service communicating over msmq, receiving a request message, and based on the value of the [...]]]></description>
			<content:encoded><![CDATA[<p>After receiving numerous requests to see how to expose a <em>synchronous</em> web service that communicates <strong>asynchronously</strong> with other services via nServiceBus, I&#8217;ve finally got a sample up.</p>
<p>I&#8217;ve included a direct link here for convenience (<a href="http://udidahan.weblogs.us/wp-content/uploads/webservicebridge.zip" title="webservicebridge.zip">webservicebridge.zip</a>).</p>
<p>In this sample, we have a service communicating over msmq, receiving a request message, and based on the value of the Id in that message, return either a success or fail result.</p>
<p>A regular web service makes use of that nServiceBus service in order to expose a synchronous API: &#8220;ErrorCodes Process(Request r);&#8221;</p>
<p>The implementation of the synchronous web service does some threading stuff to bridge the synchronous and asynchronous worlds.</p>
<p>And last, we have a regular web app which makes use of the synchronous web service.</p>
<p>____</p>
<p>I&#8217;ve also opened a discussion group for nServiceBus on Yahoo Groups, so you can find that here:</p>
<p><a href="http://tech.groups.yahoo.com/group/nservicebus/">http://tech.groups.yahoo.com/group/nservicebus/</a></p>
<p>I&#8217;m going to try to take the information from the email exchanges I&#8217;ve been having and put them up so that the broader user base can take advantage of it. I won&#8217;t be putting up who sent me the email, or any identifying characteristics either of them or their employers, partners, etc.</p>
<p>Please send further questions about nServiceBus via the discussion group. Specific consultations can continue being sent directly to me &#8211; <a href="mailto:consult@UdiDahan.com">consult@UdiDahan.com</a>.</p>
<p>Finally, if you have any ideas or suggestions for taking nServiceBus forward, please don&#8217;t hesitate to send them my way via the discussion group.</p>
<p>Thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2007/12/16/web-service-to-nservicebus-integration-sample/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Podcast] Migrating from N-Tier to SOA</title>
		<link>http://www.udidahan.com/2007/12/05/podcast-migrating-from-n-tier-to-soa/</link>
		<comments>http://www.udidahan.com/2007/12/05/podcast-migrating-from-n-tier-to-soa/#comments</comments>
		<pubDate>Wed, 05 Dec 2007 21:27:18 +0000</pubDate>
		<dc:creator>thesoftwaresimplist</dc:creator>
				<category><![CDATA[Ask Udi Podcast]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://udidahan.weblogs.us/2007/12/05/podcast-migrating-from-n-tier-to-soa/</guid>
		<description><![CDATA[In this podcast we&#8217;ll be discussing certain methodologies for migrating an architecture from N-Tier to SOA. We&#8217;ll see what parts can be used almost unchanged, and which N-Tier concepts have no place in this new, service-oriented world.
Ketan asks:

Hello Udi,
I am Ketan, working as Analyst Programmer in India. I want some information regarding SOA Architecture. I [...]]]></description>
			<content:encoded><![CDATA[<p>In this podcast we&#8217;ll be discussing certain methodologies for migrating an architecture from N-Tier to SOA. We&#8217;ll see what parts can be used almost unchanged, and which N-Tier concepts have no place in this new, service-oriented world.</p>
<p>Ketan asks:</p>
<blockquote><p>
Hello Udi,</p>
<p>I am Ketan, working as Analyst Programmer in India. I want some information regarding SOA Architecture. I have visited several blogs and sites and I do have enough knowledge regarding technical terms of SOA. I have worked a lot in 3-tier mechanism a lot and now want to switch on SOA Architecture in Visual Studio 2005.</p>
<p>I read your blog post <a href="http://udidahan.weblogs.us/2004/01/17/ill-see-you-when-you-get-there/">How to migrate to SOA</a> and liked the contents and am interested in doing it. Can you please be more precise about how to migrate from 3-tier to SOA? Actually, I have read whole content of above link and you have explained enough. But, still I want you to keep me out from dark. You have described it functionally, but I want some technical description of this process. Please help me in this.</p>
<p>If you can provide me some example/application (in which SOA Architecture has been implemented), then it will be very helpful to me.</p>
<p>Thanks in advance. Waiting for your favorable reply.</p>
<p>Ketan
</p></blockquote>
<h3>Download</h3>
<p><a href="http://www.ddj.com/architect/204700666">Download via the Dr. Dobb&#8217;s site</a></p>
<p>Or download directly <a href="http://www.dobbsprojects.com/media/newengine/dynamp.php/071204ud01.mp3?podcast=071204ud01.mp3">here</a>.</p>
<h3>Additional References</h3>
<ul>
<li>Blog post on <a href="http://udidahan.weblogs.us/2004/01/17/ill-see-you-when-you-get-there/">migrating from layers to services</a></li>
<li>Podcast on <a href="http://udidahan.weblogs.us/2006/05/26/podcast-does-soa-mean-the-end-of-oo/">&#8220;Does SOA mean the end of OO&#8221;?</a></li>
</ul>
<h3>Want more?</h3>
<p>Check out the <a href="/ask-udi/">“Ask Udi”</a> archives.</p>
<h3>Got a question?</h3>
<p><a href="mailto:podcast@UdiDahan.com">Send Udi your question to answer on the show.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2007/12/05/podcast-migrating-from-n-tier-to-soa/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://www.dobbsprojects.com/media/newengine/dynamp.php/071204ud01.mp3?podcast=071204ud01.mp3" length="0" type="audio/mp3" />
		</item>
		<item>
		<title>Asynchronous, High-Performance Login for Web Farms</title>
		<link>http://www.udidahan.com/2007/11/10/asynchronous-high-performance-login-for-web-farms/</link>
		<comments>http://www.udidahan.com/2007/11/10/asynchronous-high-performance-login-for-web-farms/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 16:08:46 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Autonomous Services]]></category>
		<category><![CDATA[Availability]]></category>
		<category><![CDATA[Caching]]></category>
		<category><![CDATA[Data Access]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[ESB]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Pub/Sub]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://udidahan.weblogs.us/2007/11/10/asynchronous-high-performance-login-for-web-farms/</guid>
		<description><![CDATA[Often during my consulting engagements I run into people who say, &#34;some things just can&#8217;t be made asynchronous&#34; even after they agree about the inherent scalability that asynchronous communications pattern bring. One often-cited example is user authentication &#8211; taking a username and password combo and authenticating it against some back-end store. For the purpose of [...]]]></description>
			<content:encoded><![CDATA[<p>Often during my consulting engagements I run into people who say, &quot;some things just can&#8217;t be made asynchronous&quot; even after they agree about the inherent scalability that asynchronous communications pattern bring. One often-cited example is user authentication &#8211; taking a username and password combo and authenticating it against some back-end store. For the purpose of this post, I&#8217;m going to assume a database. Also, I&#8217;m not going to be showing more advanced features like ETags to further improve the solution.</p>
<h3>The Setup</h3>
<p>Just so that the example is in itself secure, we&#8217;ll assume that the password is one-way hashed before being stored. Also, given a reasonable network infrastructure our web servers will be isolated in the <a href="http://en.wikipedia.org/wiki/Demilitarized_zone_(computing)">DMZ</a> and will have to access some application server which, in turn, will communicate with the DB. There&#8217;s also a good chance for something like round-robin load-balancing between web servers, especially for things like user login.</p>
<p>Before diving into the meat of it, I wanted to preface with a few words. One of the commonalities I&#8217;ve found when people dismiss asynchrony is that they don&#8217;t consider a real deployment environment, or scaling up a solution to multiple servers, farms, or datacenters.</p>
<h3>The Synchronous Solution</h3>
<p>In the synchronous solution, each one of our web servers will be contacting the app server for each user login request. In other words, the load on the app server and, consequently, on the database server will be proportional to the number of logins. One property of this load is its data locality, or rather, the lack of it. Given that user U logged in, the DB won&#8217;t necessarily gain any performance benefits by loading all username/password data into memory for the same page as user U. Another property is that this data is very non-volatile &#8211; it doesn&#8217;t change that often.</p>
<p>I won&#8217;t go to far into the synchronous solution since its been <a href="http://www.michaelnygard.com/blog/2007/11/two_ways_to_boost_your_flaggin.html">analysed</a> numerous times before. The bottom line is that the database is the bottleneck. You could use sharding solutions. Many of the large sites have numerous read-only databases for this kind of data, with one master for updates &#8211; replicating out to the read-only replicas. That&#8217;s <a href="http://www.michaelnygard.com/blog/2007/11/two_quick_observations.html">great</a> if you&#8217;re using a nice cheap database like mySql (of LAMP), not so nice if you&#8217;re running Oracle or MS Sql Server.</p>
<p>Regardless of what you&#8217;re doing in your data tier, you&#8217;re there. Wouldn&#8217;t it be nice to close the loop in the web servers? Even if you are using Apache, that&#8217;s going to be less iron, electricity, and cooling all around. That&#8217;s what the asynchronous solution is all about &#8211; capitalizing on the low cost of memory to save on other things.</p>
<h3>The Asynchronous Solution</h3>
<p>In the asynchronous solution, we cache username/hashed-password pairs in memory on our web servers, and authenticate against that. Let&#8217;s analyse how much memory that takes:</p>
<p>Usernames are usually 12 characters or less, but let&#8217;s take an average of 32 to be sure. Using Unicode we get to 64 bytes for the username. Hashed passwords can run between 256 and 512 <em>bits</em> depending on the algorithm, divide by 8 and you have 64 bytes. That&#8217;s about 128 bytes altogether. So we can safely cache 8 million of these with 1GB of memory per web server. If you&#8217;ve got a million users, first of all, good for you <img src='http://www.udidahan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Second, that&#8217;s just 128 MB of memory &#8211; relatively nothing even for a cheap 2GB web server. </p>
<p>Also, consider the fact that when registering a new user we can check if such a username is already taken at the web server level. That doesn&#8217;t mean it won&#8217;t be checked again in the DB to account for <a href="http://udidahan.weblogs.us/2007/01/22/realistic-concurrency/">concurrency issues</a>, but that the load on the DB is further reduced. Other things to notice include no read-only replicas and no replication. Simple. Our web servers are the &quot;replicas&quot;.</p>
<h3>The Authentication Service</h3>
<p>What makes it all work is the &quot;Authentication Service&quot; on the app server. This was always there in the synchronous solution. It is what used to field all the login requests from the web servers, and, of course, allowed them to register new users and all the regular stuff. The difference is that now it publishes a message when a new user is registered (or rather, is validated &#8211; all a part of the internal long-running workflow). It also allows subscribers to receive the list of all username/hashed-password pairs. It&#8217;s also quite likely that it would keep the same data in memory too.</p>
<p>The same message can be used to publish both single updates, and returning the full list when using <a href="http://www.NServiceBus.com">NServiceBus</a>. Let&#8217;s define the message:</p>
<div style="border-right: black 1px solid; padding-right: 1em; border-top: black 1px solid; padding-left: 1em; padding-bottom: 0em; overflow: auto; border-left: black 1px solid; padding-top: 0em; border-bottom: black 1px solid; font-family: courier; background-color: beige">
<p>[Serializable]      <br />public class UsernameInUseMessage : IMessage       <br />{       <br />&#160;&#160;&#160; private string username;       <br />&#160;&#160;&#160; public string Username       <br />&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; get { return username; }       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; set { username = value; }       <br />&#160;&#160;&#160; } </p>
</p>
<p>&#160;&#160;&#160; private byte[] hashedPassword;      <br />&#160;&#160;&#160; public byte[] HashedPassword       <br />&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; get { return hashedPassword; }       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; set { hashedPassword = value; }       <br />&#160;&#160;&#160; }       <br />} </p>
</p></div>
<p>And the message that the web server sends when it wants the full list:</p>
</p>
<div style="border-right: black 1px solid; padding-right: 1em; border-top: black 1px solid; padding-left: 1em; padding-bottom: 0em; overflow: auto; border-left: black 1px solid; padding-top: 0em; border-bottom: black 1px solid; font-family: courier; background-color: beige">
<p>[Serializable]      <br />public class GetAllUsernamesMessage : IMessage       <br />{ </p>
<p>} </p>
</p></div>
<p>And the code that the web server runs on startup looks like this (assuming constructor injection):</p>
<p>&#160;</p>
</p>
<div style="border-right: black 1px solid; padding-right: 1em; border-top: black 1px solid; padding-left: 1em; padding-bottom: 0em; overflow: auto; border-left: black 1px solid; padding-top: 0em; border-bottom: black 1px solid; font-family: courier; background-color: beige">
<p>public class UserAuthenticationServiceAgent      <br />{&#160; <br />&#160;&#160;&#160; public UserAuthenticationServiceAgent(IBus bus)&#160; <br />&#160;&#160;&#160; {&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; this.bus = bus;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; bus.Subscribe(typeof(UsernameInUseMessage));&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; bus.Send(new GetAllUsernamesMessages());       <br />&#160;&#160;&#160; } </p>
<p> }</p></div>
<p>And the code that runs in the Authentication Service when the GetAllUsernamesMessage is received:</p>
</p>
<p>&#160;</p>
</p>
<div style="border-right: black 1px solid; padding-right: 1em; border-top: black 1px solid; padding-left: 1em; padding-bottom: 0em; overflow: auto; border-left: black 1px solid; padding-top: 0em; border-bottom: black 1px solid; font-family: courier; background-color: beige">
<p>public class GetAllUsernamesMessageHandler : BaseMessageHandler&lt;GetAllUsernamesMessage&gt;      <br />{       <br />&#160;&#160;&#160; public override void Handle(GetAllUsernamesMessage message)       <br />&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; this.Bus.Reply(Cache.GetAll&lt;UsernameInUseMessage&gt;());       <br />&#160;&#160;&#160; }       <br />}</p>
</p></div>
<p>&#160;</p>
<p>And the class on the web server that handles a UsernameInUseMessage when it arrives:</p>
</p>
<p>&#160;</p>
</p>
<div style="border-right: black 1px solid; padding-right: 1em; border-top: black 1px solid; padding-left: 1em; padding-bottom: 0em; overflow: auto; border-left: black 1px solid; padding-top: 0em; border-bottom: black 1px solid; font-family: courier; background-color: beige">
<p>public class UsernameInUseMessageHandler : BaseMessageHandler&lt;UsernameInUseMessage&gt;      <br />{       <br />&#160;&#160;&#160; public override void Handle(UsernameInUseMessage message)       <br />&#160;&#160;&#160; {&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; WebCache.SaveOrUpdate(message.Username, message.HashedPassword);&#160; <br />&#160;&#160;&#160; }       <br />}</p>
</p></div>
<p>When the app server sends the full list, multiple objects of the type UsernameInUseMessage are sent in one physical message to that web server. However, the bus object that runs on the web server dispatches each of these logical messages one at a time to the message handler above.</p>
<p>So, when it comes time to actually authenticate a user, this the web page (or controller, if you&#8217;re doing MVC) would call:</p>
</p>
<div style="border-right: black 1px solid; padding-right: 1em; border-top: black 1px solid; padding-left: 1em; padding-bottom: 0em; overflow: auto; border-left: black 1px solid; padding-top: 0em; border-bottom: black 1px solid; font-family: courier; background-color: beige">
<p>public class UserAuthenticationServiceAgent      <br />{       <br />&#160;&#160;&#160; public bool Authenticate(string username, string password)       <br />&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; byte[] existingHashedPassword = WebCache[username];       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (existingHashedPassword != null)       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return existingHashedPassword == this.Hash(password); </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; return false;      <br />&#160;&#160;&#160; }       <br />}</p>
</p></div>
<p>&#160;</p>
<p>When registering a new user, the web server would of course first check its cache, and then send a RegisterUserMessage that contained the username and the hashed password.</p>
</p>
<div style="border-right: black 1px solid; padding-right: 1em; border-top: black 1px solid; padding-left: 1em; padding-bottom: 0em; overflow: auto; border-left: black 1px solid; padding-top: 0em; border-bottom: black 1px solid; font-family: courier; background-color: beige">
<p>[Serializable]      <br />[StartsWorkflow]       <br />public class RegisterUserMessage : IMessage       <br />{       <br />&#160;&#160;&#160; private string username;       <br />&#160;&#160;&#160; public string Username       <br />&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; get { return username; }       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; set { username = value; }       <br />&#160;&#160;&#160; } </p>
</p>
<p>&#160;&#160;&#160; private string email;      <br />&#160;&#160;&#160; public string Email       <br />&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; get { return email; }       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; set { email = value; }       <br />&#160;&#160;&#160; } </p>
</p>
<p>&#160;&#160;&#160; private byte[] hashedPassword;      <br />&#160;&#160;&#160; public byte[] HashedPassword       <br />&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; get { return hashedPassword; }       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; set { hashedPassword = value; }       <br />&#160;&#160;&#160; }       <br />} </p>
</p></div>
<p>&#160;</p>
<p>When the RegisterUserMessage arrives at the app server, a new long-running workflow is kicked off to handle the process:</p>
</p>
<div style="border-right: black 1px solid; padding-right: 1em; border-top: black 1px solid; padding-left: 1em; padding-bottom: 0em; overflow: auto; border-left: black 1px solid; padding-top: 0em; border-bottom: black 1px solid; font-family: courier; background-color: beige">
<p>public class RegisterUserWorkflow :      <br />&#160;&#160;&#160; BaseWorkflow&lt;RegisterUserMessage&gt;, IMessageHandler&lt;UserValidatedMessage&gt;       <br />{       <br />&#160;&#160;&#160; public void Handle(RegisterUserMessage message)       <br />&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; //send validation request to message.Email containing this.Id (a guid)       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; // as a part of the URL       <br />&#160;&#160;&#160; } </p>
<p>&#160;&#160;&#160; /// &lt;summary&gt;      <br />&#160;&#160;&#160; /// When a user clicks the validation link in the email, the web server       <br />&#160;&#160;&#160; /// sends this message (containing the workflow Id)       <br />&#160;&#160;&#160; /// &lt;/summary&gt;       <br />&#160;&#160;&#160; /// &lt;param name=&quot;message&quot;&gt;&lt;/param&gt;       <br />&#160;&#160;&#160; public void Handle(UserValidatedMessage message)       <br />&#160;&#160;&#160; {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; // write user to the DB </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; this.Bus.Publish(new UsernameInUseMessage(      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; message.Username, message.HashedPassword));       <br />&#160;&#160;&#160; }       <br />}</p>
</p></div>
<p>That UsernameInUseMessage would eventually arrive at all the web servers subscribed.</p>
<h3>Performance/Security Trade-Offs</h3>
<p>When looking deeper into this workflow we realize that it could be implemented as two separate message handlers, and have the email address take the place of the workflow Id. The problem with this alternate, better performing solution has to do with security. By removing the dependence on the workflow Id, we&#8217;ve in essence stated that we&#8217;re willing to receive a UserValidatedMessage without having previously received the RegisterUserMessage. </p>
<p>Since the processing of the UserValidatedMessage is relatively expensive &#8211; writing to the DB and publishing messages to <em>all</em> web servers, a malicious user could perform a denial of service (<a href="http://en.wikipedia.org/wiki/Denial-of-service_attack">DOS</a>) attack without that many messages, thus flying under the radar of many detection systems. Spoofing a guid that would result in a valid workflow instance is much more difficult. Also, since workflow instances would probably be stored in some in-memory, replicated data grid the relative cost of a lookup would be quite small &#8211; small enough to avoid a DOS until a detection system picked it up.</p>
<h3>Improved Bandwidth &amp; Latency</h3>
<p>The bottom line is that you&#8217;re getting much more out of your web tier this way, rather than hammering your data tier and having to scale it out much sooner. Also, notice that there is much less network traffic this way. Not such a big deal for usernames and passwords, but other scenarios built in the same way may need more data. Of course, the time it takes us to log a user in is much shorter as well since we don&#8217;t have to cross back and forth from the web server (in the DMZ) to the app server, to the db server.</p>
<p>The important thing to remember in this solution is doing pub/sub. NServiceBus merely provides a simple API for designing the system around pub/sub. And publishing is where you get the serious scalability. As you get more users, you&#8217;ll obviously need to get more web servers. The thing is that you probably won&#8217;t need more database servers <em>just to handle logins</em>. In this case, you also get <a href="http://www.michaelnygard.com/blog/2007/11/architecting_for_latency.html">lower latency</a> per request since all work needed to be done can be done locally on the server that received the request. </p>
<h3>ETags make it even better</h3>
<p>For the more advanced crowd, I&#8217;ll wrap it up with the <a href="http://en.wikipedia.org/wiki/HTTP_ETag">ETags</a>. Since web servers do go down, and the cache will be cleared, what we can do is to write that cache to disk (probably in a background thread), and &quot;tag&quot; it with something that the server gave us along with the last UsernameInUseMessage we received. That way, when the web server comes back up, it can send that ETag along with its GetAllUsernamesMessage so that the app server will only send the changes that occurred since. This drives down network usage even more at the insignificant cost of some disk space on the web servers.</p>
<h3>And in closing&#8230;</h3>
<p>Even if you don&#8217;t have anything more than a single physical server today, and it acts as your web server and database server, this solution won&#8217;t slow things down. If anything, it&#8217;ll speed it up. Regardless, you&#8217;re much better prepared to scale out than before &#8211; no need to rip and replace your entire architecture just as you get 8 million Facebook users banging down your front door.</p>
<p>So, go check out <a href="http://www.NServiceBus.com">NServiceBus</a> and get the most out of your iron.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2007/11/10/asynchronous-high-performance-login-for-web-farms/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>[Podcast] Versioning and SOA&#8211;There is no IDog2</title>
		<link>http://www.udidahan.com/2007/11/09/podcast-versioning-and-soa-there-is-no-idog2/</link>
		<comments>http://www.udidahan.com/2007/11/09/podcast-versioning-and-soa-there-is-no-idog2/#comments</comments>
		<pubDate>Fri, 09 Nov 2007 09:38:08 +0000</pubDate>
		<dc:creator>thesoftwaresimplist</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Ask Udi Podcast]]></category>
		<category><![CDATA[Pub/Sub]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://udidahan.weblogs.us/2007/11/09/podcast-versioning-and-soa-there-is-no-idog2/</guid>
		<description><![CDATA[In this podcast we&#8217;ll look at the issues around versioning and SOA and how the asynchronous nature of messaging obviates the need for previously accepted interface-based versioning practices. 
Jarrod asks:

Hi Udi,
I have some questions around versioning and SOA:
Over the years I&#8217;ve been fairly adamant about the practice of versioning interfaces should a method change be [...]]]></description>
			<content:encoded><![CDATA[<p>In this podcast we&#8217;ll look at the issues around versioning and SOA and how the asynchronous nature of messaging obviates the need for previously accepted interface-based versioning practices. </p>
<p>Jarrod asks:</p>
<blockquote><p>
Hi Udi,</p>
<p>I have some questions around versioning and SOA:</p>
<p>Over the years I&#8217;ve been fairly adamant about the practice of versioning interfaces should a method change be needed.</p>
<p>Hence, IDog and IDog2 </p>
<p>Generally I would also say that a method addition would need a new interface as much as a change to an existing method or property (sometimes requiring completely deprecating the old interface). </p>
<p>With SOA being used more and contract first designs coming down the pipe&#8230;an addition of a method or operation to a contract in SOA does not mean its a breaking change. </p>
<p>So, do you continue to create a new interface and version the name within an SOA environment? Even if its just one method that is being added? </p>
<p>A service contract, in general&#8230;with just a single method in my opinion is a bad design. Sure, there are exceptions to that but I can just see changes made to the service contracts over the course of a few years with many 1-2 method interfaces. </p>
<p>Day 1 : 12 methods on interface IDog</p>
<p>6 months later : 1 new method, create IDog2 which implements IDog</p>
<p>15 months later : 2 new methods, create IDog3 which implements IDog2</p>
<p>Some can argue that if you&#8217;re having to add methods like this, the original design was flawed. That may be&#8230;or you could just be in a volatile business environment in which SOA must adapt.  </p>
<p>So my main questions are: </p>
<p>1) Do you think its the best practice to continue to version interfaces for non-breaking method additions in an SOA environment in which you also have control of the consumers (internal consumers)?  </p>
<p>2)  Do you think its the best practice to continue to version interfaces for non-breaking method additions in an SOA environment in which you do not have control of the consumers (external consumers)? </p>
<p>3) If the answer to the above is yes, is a single method on a new interface acceptable? </p>
<p>4) If you know of a problem in an existing interface on a method and have control of the consumers &#8211; do you &#8220;fix&#8221; the method and redeploy to the consumers? Or do you deprecate the entire interface and begin anew?</p>
<p>I&#8217;m interested in seeing your responses <img src='http://www.udidahan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Jarrod
</p></blockquote>
<p><b>Download</b></p>
<p><a href="http://ddj.com/architect/202803620">Download via the Dr. Dobb&#8217;s site</a></p>
<p>Or download directly <a href="http://www.dobbsprojects.com/media/newengine/dynamp.php/071107ud01.mp3?podcast=071107ud01.mp3">here</a></p>
<p><b>Additional References</b></p>
<ul>
<li><a href="http://udidahan.weblogs.us/2006/09/05/podcast-autonomous-services-and-pubsub/">Podcast on Autonomous Services and Pub/Sub</a></li>
<li><a href="http://www.pluralsight.com/blogs/craig/archive/2006/04/06/21176.aspx">Blog post on &#8220;The Perils of WSDL first&#8221;</a></li>
</ul>
<p><b>Want more?</b></p>
<p>Check out the <a href="/ask-udi/">&#8220;Ask Udi&#8221; archives</a>.</p>
<p><b>Got a question?</b></p>
<p><a href="mailto:podcast@UdiDahan.com">Send Udi your question to answer on the show.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2007/11/09/podcast-versioning-and-soa-there-is-no-idog2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://www.dobbsprojects.com/media/newengine/dynamp.php/071107ud01.mp3?podcast=071107ud01.mp3" length="15111074" type="audio/mp3" />
		</item>
		<item>
		<title>[Podcast] Durable Services with WCF, WF, and NServiceBus</title>
		<link>http://www.udidahan.com/2007/10/23/podcast-durable-services-with-wcf-wf-and-nservicebus/</link>
		<comments>http://www.udidahan.com/2007/10/23/podcast-durable-services-with-wcf-wf-and-nservicebus/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 21:17:40 +0000</pubDate>
		<dc:creator>thesoftwaresimplist</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Ask Udi Podcast]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://udidahan.weblogs.us/2007/10/23/podcast-durable-services-with-wcf-wf-and-nservicebus/</guid>
		<description><![CDATA[In this podcast we&#8217;ll look at the issues around Durable Services, what makes them stateful or stateless, as well as how WCF and WF can be used to implement them. Finally, we&#8217;ll compare solutions based on .NET 3.5 and on NServiceBus&#8211;covering aspects such as transactions and persistent time-outs. 
Suresh asks:

Hi Udi,
I&#8217;ve been reading about the [...]]]></description>
			<content:encoded><![CDATA[<p>In this podcast we&#8217;ll look at the issues around Durable Services, what makes them stateful or stateless, as well as how WCF and WF can be used to implement them. Finally, we&#8217;ll compare solutions based on .NET 3.5 and on NServiceBus&#8211;covering aspects such as transactions and persistent time-outs. </p>
<p>Suresh asks:</p>
<blockquote><p>
Hi Udi,</p>
<p>I&#8217;ve been reading about the coming &#8220;durable services&#8221; that will be available with the next version of WCF. I also have been listening to your podcasts and reading your blog posts about NServiceBus where you talk about long-running workflows. It sounds like both of these technologies are trying to solve the same problem.</p>
<p>Do durable services do away with long-running workflow? If so, does that mean we don&#8217;t need Workflow Foundation either? If not, what is the connection between them.</p>
<p>If you could shed some light on the matter that would be great.</p>
<p>Suresh
</p></blockquote>
<p><b>Download</b></p>
<p><a href="http://www.ddj.com/architect/202600413">Download via the Dr. Dobb&#8217;s site</a></p>
<p>Or download directly <a href="http://www.dobbsprojects.com/media/newengine/dynamp.php/071022ud01.mp3?podcast=071022ud01.mp3">here</a></p>
<p><b>Additional References</b></p>
<ul>
<li>Blog post on <A href="http://www.winterdom.com/weblog/2007/06/28/WorkflowServicesInOrcas.aspx">Workflow Services in Orcas</A></li>
<li>Blog post on <A href="http://weblogs.asp.net/gsusx/archive/2007/06/14/orcas-durable-services.aspx">Orcas Durable Services</A></li>
<li>Blog post on <a href="https://www.gazitt.com/blog/PermaLink,guid,a8383226-a0dd-48c5-9fea-33d5da159d17.aspx">.NET Framework 3.5 Beta1 is Live on the Web</a></li>
</ul>
<p><b>Want more?</b></p>
<p>Check out the <a href="/ask-udi/">&#8220;Ask Udi&#8221; archives</a>.</p>
<p><b>Got a question?</b></p>
<p><a href="mailto:podcast@UdiDahan.com">Send Udi your question to answer on the show.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2007/10/23/podcast-durable-services-with-wcf-wf-and-nservicebus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.dobbsprojects.com/media/newengine/dynamp.php/071022ud01.mp3?podcast=071022ud01.mp3" length="16231213" type="audio/mp3" />
		</item>
		<item>
		<title>InfoQ interview on NServiceBus</title>
		<link>http://www.udidahan.com/2007/09/07/infoq-interview-on-nservicebus/</link>
		<comments>http://www.udidahan.com/2007/09/07/infoq-interview-on-nservicebus/#comments</comments>
		<pubDate>Fri, 07 Sep 2007 13:07:24 +0000</pubDate>
		<dc:creator>thesoftwaresimplist</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[ESB]]></category>
		<category><![CDATA[MSMQ]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://udidahan.weblogs.us/2007/09/07/infoq-interview-on-nservicebus/</guid>
		<description><![CDATA[The good folks from InfoQ interviewed me recently about NServiceBus. You can find the full interview here.
Here are some choice tidbits:
&#8220;For any developer who architects using SOA principles, on the basis for using NServiceBus over some other methodology or some other so-called enterprise service bus:&#8221;

NServiceBus makes it difficult to work in ways that will hurt [...]]]></description>
			<content:encoded><![CDATA[<p>The good folks from <a href="http://www.infoq.com">InfoQ</a> interviewed me recently about <a href="http://www.NServiceBus.com">NServiceBus</a>. You can find the full interview <a href="http://www.infoq.com/news/2007/09/nservicebus">here</a>.</p>
<p>Here are some choice tidbits:</p>
<p>&#8220;For any developer who architects using SOA principles, on the basis for using NServiceBus over some other methodology or some other so-called enterprise service bus:&#8221;</p>
<blockquote><p>
NServiceBus makes it difficult to work in ways that will hurt your scalability. Since the asynchronous messaging patterns are brought to the fore, developers will, by default, avoid the temporal coupling so prevalent in most Web Service implementations. Other methodologies make so many other options just as easy to use that developers can make mistakes that will hurt their scalability and availability and only find out about those mistakes in production . </p>
<p>Another thing NServiceBus does differently is to totally isolate all workflow code from all technologies. This makes it easy to unit-test workflow classes, making it possible to iterate quickly on the development of key business processes. These portable .NET POJOs give developers the flexibility to host their workflows in whatever runtime they want.
</p></blockquote>
<p>&#8220;Having noticed NServiceBus is built with MSMQ in mind or as an option, when asked why this choice of direction: &#8221;</p>
<blockquote><p>
The core of NServiceBus is not dependent on MSMQ. The extensibility points of NServiceBus allow you to plug in your own communication transport, subscription storage, and workflow persister. I&#8217;ve already implemented a transport over MSMQ, and another over WCF&#8217;s NetTCP binding. Developers can use those as-is or write their own. Many of the SOA products currently out there are much more tied to HTTP, so this is something of a break from the common practice. </p>
<p>I chose to use MSMQ since it is one of the two main Microsoft communications technologies that enables parties to communicate in a disconnected fashion (SQL Server Service Broker is the other). MSMQ has a much more accessible API in that it is directly available as a part of the .NET Framework whereas Service Broker currently isn&#8217;t. I consider disconnected communications a critical part of any SOA infrastructure since the Tenet of Service Autonomy does not allow us to assume that the service with which we wish to communicate is currently available.
</p></blockquote>
<p>Is there anything you&#8217;d like to know about NServiceBus? Drop me a comment below.</p>
<p>Thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2007/09/07/infoq-interview-on-nservicebus/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Generic WCF Transport available for NServiceBus</title>
		<link>http://www.udidahan.com/2007/08/30/generic-wcf-transport-available-for-nservicebus/</link>
		<comments>http://www.udidahan.com/2007/08/30/generic-wcf-transport-available-for-nservicebus/#comments</comments>
		<pubDate>Thu, 30 Aug 2007 23:26:25 +0000</pubDate>
		<dc:creator>thesoftwaresimplist</dc:creator>
				<category><![CDATA[ESB]]></category>
		<category><![CDATA[MSMQ]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Pub/Sub]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://udidahan.weblogs.us/2007/08/30/generic-wcf-transport-available-for-nservicebus/</guid>
		<description><![CDATA[After trying a bunch of different directions it appears like I&#8217;ve found one that works. I didn&#8217;t think that I could make use of the top ServiceModel stuff, but I was wrong. Many thanks to Tomas Restrepo for making me rethink my basic assumptions.
I&#8217;ve also put in a bit of effort in setting up a [...]]]></description>
			<content:encoded><![CDATA[<p>After trying a bunch of different directions it appears like I&#8217;ve found one that works. I didn&#8217;t think that I could make use of the top ServiceModel stuff, but I was wrong. Many thanks to <a href="http://www.winterdom.com/weblog/">Tomas Restrepo</a> for making me rethink my basic assumptions.</p>
<p>I&#8217;ve also put in a bit of effort in setting up a bunch of configuration files allowing you to try the various transports for the example code. Please go through the Readme as it contains the detailed instructions. There are currently config files setting up non-WCF MSMQ, NetTCP, Basic HTTP, and WS Dual.</p>
<p>If you do go the MSMQ route, the example will run the long-running workflow code. The reason the example code won&#8217;t do that for the WCF cases is that I haven&#8217;t figured out yet the best way for a service to send a message back to itself, especially for the connected bindings. Any thoughts on this would be most appreciated.</p>
<p>Also, I&#8217;m open to hearing what directions you think the next version should go in. I&#8217;m currently thinking about including message transformation. Either that are doing a Multicast bus over a UDP transport.</p>
<p>This is a non-backwards-compatible update. In order to propertly integrate with the WCF philosophy I had to change the ITransport interface for Unicast transports. The meaning of this change is that transports are now expected to do their own threading and transaction management, while the bus object now joins the context that comes from the transport.</p>
<p><a href='http://udidahan.weblogs.us/wp-content/uploads/nservicebus-v10.zip'>Download here.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2007/08/30/generic-wcf-transport-available-for-nservicebus/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NServiceBus Distributed Topology Q&amp;A</title>
		<link>http://www.udidahan.com/2007/08/25/nservicebus-distributed-topology-qa/</link>
		<comments>http://www.udidahan.com/2007/08/25/nservicebus-distributed-topology-qa/#comments</comments>
		<pubDate>Sat, 25 Aug 2007 08:37:26 +0000</pubDate>
		<dc:creator>thesoftwaresimplist</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[BizTalk]]></category>
		<category><![CDATA[Dependency Injection]]></category>
		<category><![CDATA[ESB]]></category>
		<category><![CDATA[MSMQ]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Pub/Sub]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://udidahan.weblogs.us/2007/08/25/nservicebus-distributed-topology-qa/</guid>
		<description><![CDATA[I&#8217;ve been receiving more and more questions about how NServiceBus fits in distributed systems and wanted to share them:

My question is about distributed topology.
The EAI-hub-and-spoke model is all about the central server.   It’s useful sometimes, but there are a lot of reasons why I’m not gung-ho on using a hub as the center [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been receiving more and more questions about how NServiceBus fits in distributed systems and wanted to share them:</p>
<blockquote><p>
My question is about distributed topology.</p>
<p>The EAI-hub-and-spoke model is all about the central server.   It’s useful sometimes, but there are a lot of reasons why I’m not gung-ho on using a hub as the center of the integration universe.  </p>
<p>The ESB distributed model puts code on the endpoints.  That code solves some of the messaging problems that apps face, so that apps don’t have to face them. It also solves some of the messaging problems that enterprises face, so that enterprises don’t have to face them.  (I need both).</p>
<p>Those problems include simple coding and deployment model, pub-sub routing, reliable transport, simple transformation, and orchestration.  I wonder which of these you can do in your tool, and which you are planning to do.  </p>
<p>I’m also interested in management.  How do you insure that the endpoints are correctly configured?  Do you have a central configuration store?  How do you propagate changes from the center to the messaging endpoints?
</p></blockquote>
<p>And here&#8217;s my response:</p>
<p>The important parts of NServiceBus that are independent of the distributed topology are the API and the connection to long-running workflow. This code is indeed on the endpoint. However, if you wanted to you could easily connect to something like BizTalk and do whatever you wanted there. This general idea though is to support the ESB distributed model since <a href="udidahan.weblogs.us/2007/06/30/no-such-thing-as-a-centralized-esb/">there&#8217;s no such things as a centralized ESB</a>.</p>
<p>In terms of the capabilities you’ve mentioned, I’ve seen developers pick up the coding model in a day or two. The deployment model is just a bunch of DLLs you deploy with each endpoint. Dependency Injection is supported by www.SpringFramework.net but you can replace that with something else easily as another implementation of the ObjectBuilder interfaces. </p>
<p>Currently pub/sub routing is supported over regular point-to-point transports in a transport agnostic way. You also have the ability to have subscriptions be persisted so that even if a server restarts (and clients don’t, and can’t know about that) all the subscriptions will be remembered. </p>
<p>The reliable transport that is currently supported is MSMQ, with the option of defining per-message type if you want durable messaging (using the [Recoverable] attribute). </p>
<p>In terms of orchestration you get a nice model for long-running workflow that gets kicked off by messages decorated with the [StartsWorkflow] attribute, and messages that implement the IWorkflowMessage interface get automatically routed to the persistent workflow instance. You have the ability to change the storage of workflow instances easily as well. Workflows are simple classes which are easily unit-testable in that they expose a “void Handle(T message);” method for every message type (T) that is involved in the workflow.</p>
<p>I haven’t done anything in terms of simple transformation yet but am currently looking for the right place in the message processing pipeline to put it. I also haven’t done anything yet in terms of management. </p>
<p>What is currently being done management-wise on the projects that use it are the commercial options for managing configuration files in distributed environments coupled with the regular ability to restart windows services and IIS applications. I haven’t seen anything lacking in that solution yet.</p>
<hr size="1" />
<p>If you have any questions, please don&#8217;t hesitate to send them my way &#8211; <a href="mailto:NServiceBus@UdiDahan.com">NServiceBus@UdiDahan.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2007/08/25/nservicebus-distributed-topology-qa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why I wrote NServiceBus</title>
		<link>http://www.udidahan.com/2007/08/25/why-i-wrote-nservicebus/</link>
		<comments>http://www.udidahan.com/2007/08/25/why-i-wrote-nservicebus/#comments</comments>
		<pubDate>Sat, 25 Aug 2007 08:28:28 +0000</pubDate>
		<dc:creator>thesoftwaresimplist</dc:creator>
				<category><![CDATA[ESB]]></category>
		<category><![CDATA[MSMQ]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Pub/Sub]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://udidahan.weblogs.us/2007/08/25/why-i-wrote-nservicebus/</guid>
		<description><![CDATA[I&#8217;ve been asked if I have a document describing the architecture of NServiceBus, so since I don&#8217;t have one yet, this post will be the start.
First of all, there were two major forces that drove me to write NServiceBus. First of all I wanted to formalize the way Service Layer classes were written when using [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been asked if I have a document describing the architecture of NServiceBus, so since I don&#8217;t have one yet, this post will be the start.</p>
<p>First of all, there were two major forces that drove me to write NServiceBus. First of all I wanted to formalize the way Service Layer classes were written when using asynchronous messaging (regardless of Web Services). And second I wanted to formalize a communications API which supported pub/sub so that I could freely move between transports – whether they inherently supported pub/sub or not (the fact that Indigo did not falls under this).</p>
<p>From there it was filling in the details. Until finally I made the step to formalize the way long-running workflow connects to asynchronous messaging. That’s the third pillar as far as I’m concerned about ESBs. Using MSMQ I do enable Shared Subscriptions like Sonic does.</p>
<p>I try to stay away from the vendor side of ESB definitions and just deal with what capabilities such a library should provide. As such, it is inherently distributed – running on each server/client.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2007/08/25/why-i-wrote-nservicebus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using NServiceBus from a Win/Web Client</title>
		<link>http://www.udidahan.com/2007/08/21/using-nservicebus-from-a-winweb-client/</link>
		<comments>http://www.udidahan.com/2007/08/21/using-nservicebus-from-a-winweb-client/#comments</comments>
		<pubDate>Tue, 21 Aug 2007 09:22:30 +0000</pubDate>
		<dc:creator>thesoftwaresimplist</dc:creator>
				<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://udidahan.weblogs.us/2007/08/21/using-nservicebus-from-a-winweb-client/</guid>
		<description><![CDATA[Here&#8217;s another question I&#8217;ve received about how to use NServiceBus in various architectures. Sai asks:

1. In a webservice scenario, Is it the webservice which is the client?
2. Will a bus locate the WS or WS locate the bus?
3. How will the WS pass a message to the bus?
4. How will a WS subscribe to a [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s another question I&#8217;ve received about how to use NServiceBus in various architectures. Sai asks:</p>
<blockquote><p>
1. In a webservice scenario, Is it the webservice which is the client?<br />
2. Will a bus locate the WS or WS locate the bus?<br />
3. How will the WS pass a message to the bus?<br />
4. How will a WS subscribe to a bus?<br />
5. Will it be possible to show an example project where you are using a WS and a bus and a WinForm/WebForm as the client?
</p></blockquote>
<p>1. The answer is a bit dependent on how you use web services today. If you don&#8217;t care about the client of your webservice (as in you have a public web service), then yes, the web service would be the client in my example. If you are using web services today to connect your win client to a back end server, then you would in essence be replacing the classic web service stack with NServiceBus, possibly using an implementation of ITransport which uses web services for transporting the messages.</p>
<p>2. The &#8220;bus&#8221; object which you use to communicate does not need to be &#8220;located&#8221;. Its just a regular object you use within your process on the same thread as your regular code. If the bus needs to communicate with a regular web service, you would use a transport that supports web services as stated above. In the configuration of such a transport object you would probably include the URI of the web service.</p>
<p>3. Sending a message is just creating an instance of a class which implements the IMessage interface and calling the &#8220;Send&#8221; method on the bus object.</p>
<p>4. You have to look at a web service as just some code that is running in a process hosted by IIS &#8211; therefore subscribing to message types is the same as in the example code. The important part to understand is what it means to subscribe to a message type. All it means is that when the publisher will call the &#8220;Publish&#8221; method on his end, a message will be sent to the endpoint your bus is listening on. When that message arrives, the bus will attempt to dispatch it to a message handler. If you don&#8217;t have a message handler which can handle that message type, nothing will happen.</p>
<p>5. I&#8217;ll get an example up soon. In a web client scenario, your ASP.NET application would be the client shown in the example code.</p>
<p>Please feel free to send me questions, either in the comments or to <a href="mailto:NServiceBus@UdiDahan.com">NServiceBus@UdiDahan.com</a>. I&#8217;m more than happy to answer them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2007/08/21/using-nservicebus-from-a-winweb-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Podcast] Can We Do Away with Services and Just Leave the Messaging?</title>
		<link>http://www.udidahan.com/2007/08/11/podcast-can-we-do-away-with-services-and-just-leave-the-messaging/</link>
		<comments>http://www.udidahan.com/2007/08/11/podcast-can-we-do-away-with-services-and-just-leave-the-messaging/#comments</comments>
		<pubDate>Sat, 11 Aug 2007 09:18:38 +0000</pubDate>
		<dc:creator>thesoftwaresimplist</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Ask Udi Podcast]]></category>
		<category><![CDATA[Autonomous Services]]></category>
		<category><![CDATA[EDA]]></category>
		<category><![CDATA[ESB]]></category>
		<category><![CDATA[Pub/Sub]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://udidahan.weblogs.us/2007/08/11/podcast-can-we-do-away-with-services-and-just-leave-the-messaging/</guid>
		<description><![CDATA[This week we have a comment from a fellow SOA blogger, Jack van Hoof:

ESB&#8217;s are a lot about messaging and therefore a better name might be &#8220;Enterprise Data Bus&#8221;. It&#8217;s the asynchronous messaging that needs such an infrastructure with persistency and mediation facilities. All the WS-* standards are about messaging as well, leveraging the message [...]]]></description>
			<content:encoded><![CDATA[<p>This week we have a comment from a fellow SOA blogger, <a href="http://soa-eda.blogspot.com">Jack van Hoof</a>:</p>
<blockquote><p>
ESB&#8217;s are a lot about messaging and therefore a better name might be &#8220;Enterprise Data Bus&#8221;. It&#8217;s the asynchronous messaging that needs such an infrastructure with persistency and mediation facilities. All the WS-* standards are about messaging as well, leveraging the message itself to tell the infrastructure how it has to be handled. </p>
<p>I think WS-* will make it possible to have the ESB evolve from a vendor-product to a concept implemented in the operating systems an network devices that understand WS-*. Then you can leave the prefix &#8220;Enterprise&#8221; and we will be ready for an univeral asynchronous data bus over the Internet (or any other network you like). This will help breaking the current &#8220;services centric&#8221; idea of SOA into a &#8220;messages centric&#8221; perspective.</p>
<p>What are your thoughts?
</p></blockquote>
<p><a href="http://www.ddj.com/web-development/201306152">Download via the Dr. Dobb&#8217;s site</a></p>
<p>Or download directly <a href="http://www.dobbsprojects.com/media/newengine/dynamp.php/070808ud01.mp3?podcast=070808ud01.mp3">here</a>.</p>
<p><u>Additional References:</u></p>
<ul>
<li><a href="http://udidahan.weblogs.us/2006/06/02/podcast-does-an-soa-require-an-esb/">Podcast on if you need an ESB for SOA</a></li>
<li><a href="http://udidahan.weblogs.us/2007/03/29/podcast-enterprise-service-discovery/">Podcast on Enterprise Service Discovery</a></li>
<li><a href="http://soa-eda.blogspot.com/2006/11/esb-as-global-dataspace.html">Blog post on ESBs as a global dataspace</a></li>
<li><a href="http://soa-eda.blogspot.com/2006/06/brave-new-world-with-ws.html">Blog post about what the brave new world of WS-* brings us</a></li>
</ul>
<p><b>Want more?</b> Check out the <a href="/ask-udi/">&#8220;Ask Udi&#8221; archives</a>.</p>
<p><b>Got a question?</b> Have Udi answer it on the podcast &#8211; <a href="mailto:podcast@UdiDahan.com">podcast@UdiDahan.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2007/08/11/podcast-can-we-do-away-with-services-and-just-leave-the-messaging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.dobbsprojects.com/media/newengine/dynamp.php/070808ud01.mp3?podcast=070808ud01.mp3" length="13990964" type="audio/mp3" />
		</item>
		<item>
		<title>[Podcast] Using WCF for Entity and Activity Services to Implement Business Services</title>
		<link>http://www.udidahan.com/2007/07/17/podcast-using-wcf-for-entity-and-activity-services-to-implement-business-services/</link>
		<comments>http://www.udidahan.com/2007/07/17/podcast-using-wcf-for-entity-and-activity-services-to-implement-business-services/#comments</comments>
		<pubDate>Tue, 17 Jul 2007 14:00:08 +0000</pubDate>
		<dc:creator>thesoftwaresimplist</dc:creator>
				<category><![CDATA[Ask Udi Podcast]]></category>
		<category><![CDATA[Autonomous Services]]></category>
		<category><![CDATA[ESB]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://udidahan.weblogs.us/2007/07/17/podcast-using-wcf-for-entity-and-activity-services-to-implement-business-services/</guid>
		<description><![CDATA[This week we return to the topic of Entity, Activity, and Process services and compares their usages as top-level SOA elements and as implementation details of the application architecture inside a business service.
And the question that this answers is:

Hi Udi,
We&#8217;ve been having some discussions about how to implement our latest project using SOA and this [...]]]></description>
			<content:encoded><![CDATA[<p>This week we return to the topic of Entity, Activity, and Process services and compares their usages as top-level SOA elements and as implementation details of the application architecture inside a business service.</p>
<p>And the question that this answers is:</p>
<blockquote><p>
Hi Udi,</p>
<p>We&#8217;ve been having some discussions about how to implement our latest project using SOA and this is what we came up with: </p>
<p>Every activity is a method, which is broken into a class ( Think separation of concerns ), so we get high reusability.<br />
On top of those classes we have decided to put a WCF layer, so you can expose the method as a web method. If an activity needs data, then it will access a entity service via WCF. To make the activities useful for the business we put them in a class which we have called processes ( a process layer). A process contains one or more activities and is able to call other processes and activities aren&#8217;t allowed to call processes or other activities.  On top of each process we have decided to put a WCF so the UI can access them. </p>
<p>So it&#8217;s pretty close to what you wrote about in the Microsoft Architecture Journal except that we don&#8217;t have direct call to the entity services, we wrap it up in an activity before the call, which is wrapped in a WCF-host. Much like the definitions in Ontology and Taxonomy of Services in a Service-Oriented Architecture</p>
<p>I would love to hear your comments and thoughts about this architecture. </p>
<p>With thanks, Ingo
</p></blockquote>
<p><a href="http://www.ddj.com/dept/webservices/201001690">Download via the Dr. Dobbs&#8217; site</a>.</p>
<p>Or download directly <a href="http://www.dobbsprojects.com/media/newengine/dynamp.php/070716ud01.mp3?podcast=070716ud01.mp3">here</a>.</p>
<p><u>Additional References:</u></p>
<ul>
<li><a href="http://msdn2.microsoft.com/en-us/arcjournal/bb491121.aspx">Ontology and Taxonomy of Services in a Service-Oriented Architecture</a></li>
<li><a href="http://udidahan.weblogs.us/2007/02/20/autonomous-services-and-enterprise-entity-aggregation/">Udi&#8217;s Architecture Journal article on Autonomous Services<br />
</a></li>
<li><a href="http://udidahan.weblogs.us/2007/04/18/podcast-how-to-structure-net-solutions-and-components/">Podcast on how to structure .NET solutions and components</a></li>
<li><a href="http://udidahan.weblogs.us/2007/06/08/entity-services-rollup/">Blog post covering a discussion on Entity Services</a></li>
</ul>
<p><b>Want More?</b></p>
<p>Check out the <a href="/ask-udi/">&#8220;Ask Udi&#8221; archives</a>.</p>
<p><b>Got a question?</b></p>
<p>Send Udi your question and have him answer it on the show: <a href="mailto:podcast@UdiDahan.com">podcast@UdiDahan.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2007/07/17/podcast-using-wcf-for-entity-and-activity-services-to-implement-business-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.dobbsprojects.com/media/newengine/dynamp.php/070716ud01.mp3?podcast=070716ud01.mp3" length="10951162" type="audio/mp3" />
		</item>
		<item>
		<title>NBus now supporting long running workflow</title>
		<link>http://www.udidahan.com/2007/07/12/nbus-now-supporting-long-running-workflow/</link>
		<comments>http://www.udidahan.com/2007/07/12/nbus-now-supporting-long-running-workflow/#comments</comments>
		<pubDate>Thu, 12 Jul 2007 23:05:10 +0000</pubDate>
		<dc:creator>thesoftwaresimplist</dc:creator>
				<category><![CDATA[ESB]]></category>
		<category><![CDATA[MSMQ]]></category>
		<category><![CDATA[Pub/Sub]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://udidahan.weblogs.us/2007/07/12/nbus-now-supporting-long-running-workflow/</guid>
		<description><![CDATA[This is a backwards-compatible update to the last drop of my messaging infrastructure &#8211; NBus. For more information on what it&#8217;s about read what such an infrastructure should do.
This update includes support for long-running workflows and includes persistent timer functionality. Workflow persistence is abstracted behind an IWorkflowPersister. The current drop includes an in-memory persister, but [...]]]></description>
			<content:encoded><![CDATA[<p>This is a backwards-compatible update to <a href="http://udidahan.weblogs.us/2007/07/07/download-vnext-of-the-messaging-infrastructure/">the last drop of my messaging infrastructure &#8211; NBus</a>. For more information on what it&#8217;s about read <a href="http://udidahan.weblogs.us/2007/04/22/basic-messaging-infrastructure/">what such an infrastructure should do</a>.</p>
<p>This update includes support for long-running workflows and includes persistent timer functionality. Workflow persistence is abstracted behind an IWorkflowPersister. The current drop includes an in-memory persister, but you could easily implement it over a database, or a <a href="http://udidahan.weblogs.us/2007/05/05/using-spaces-with-web-services/">distributed in-memory datagrid / space</a>.</p>
<p>Other important details. To have a message kick off a workflow, just put the StartsWorkflow attribute on it. To define a message type as being involved in workflows, have it implement IWorkflowMessage instead of just IMessage. If you do these two things, the infrastructure will be able to generically dispatch messages to your workflow; you will not have to write any message handlers for your workflow, just the workflow class itself. This is done by implementing IWorkflow&lt;T&gt; for every message type received.</p>
<p>Persistent timers are activated from within your workflow like so:</p>
<p>this.reminder.ExpireIn(TimeSpan.FromSeconds(5), this, state);</p>
<p>As always, dependency injection is used &#8211; via my simple ObjectBuilder. The implementation provided delegates to Spring, but, once again, that can be easily substituted with whatever you want.</p>
<p><a href="http://udidahan.weblogs.us/wp-content/uploads/nbus_with_workflow.zip" title="nbus_with_workflow.zip">Download (509 KB)</a> (sometimes problematic with IE, try FireFox before emailing me).</p>
<p>Finally, I&#8217;m leaning towards changing the name to NServiceBus. Anyone against, please leave a comment. Questions and comments are more than welcome.</p>
<p>Next step: implementing a WCF transport.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2007/07/12/nbus-now-supporting-long-running-workflow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Podcast] Passing Data Between Layers in SOA Model/Smart Client Application</title>
		<link>http://www.udidahan.com/2007/07/12/podcast-passing-data-between-layers-in-soa-modelsmart-client-application/</link>
		<comments>http://www.udidahan.com/2007/07/12/podcast-passing-data-between-layers-in-soa-modelsmart-client-application/#comments</comments>
		<pubDate>Thu, 12 Jul 2007 22:37:18 +0000</pubDate>
		<dc:creator>thesoftwaresimplist</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Ask Udi Podcast]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Smart Client]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://udidahan.weblogs.us/2007/07/12/podcast-passing-data-between-layers-in-soa-modelsmart-client-application/</guid>
		<description><![CDATA[This week we discuss the different options that are available for passing data between a client and a service, as well as common pitfalls around trying to use the same objects for both presentation to the user and persistence to the database.
Download via the Dr. Dobb&#8217;s site.
Or download directly here.
And here&#8217;s the question that gets [...]]]></description>
			<content:encoded><![CDATA[<p>This week we discuss the different options that are available for passing data between a client and a service, as well as common pitfalls around trying to use the same objects for both presentation to the user and persistence to the database.</p>
<p><a href="http://ddj.com/dept/webservices/201001098">Download via the Dr. Dobb&#8217;s site.</a></p>
<p>Or download directly <a href="http://www.dobbsprojects.com/media/newengine/dynamp.php/070712ud01.mp3?podcast=070712ud01.mp3">here</a>.</p>
<p>And here&#8217;s the question that gets us started:</p>
<blockquote><p>
Hello there, </p>
<p>We are developing an application in .NET Smart Client application which connects to a WCF service and then to the data access layer.  The issue we have here is on the type of data which can be passed between the client side and web service. </p>
<p>1. Can it be a dataset (No!), custom entity or XML or anything else ? </p>
<p>     Which is the best one ?</p>
<p>2. Ofcourse , a dataset can&#8217;t be used coz it can&#8217;t be used in non-.NET environment?</p>
<p>3. If we go for custom-entity or XML how do we ensure the changes happen to the data during client-side actions ? For example, binding the XML or custom entity to a data grid can be done.  But if user makes any changes to the same,  how do we identify ?</p>
<p>4. If we use custom entities / XM L, the same can not be passed to the Data Access Application Block which invokes the data objects.</p>
<p>Note : All the above are based on assumption without using a translator in between any of the layers.</p>
<p>Please provide a better solution if you have come across any.
</p></blockquote>
<p><u>Additional References:</u></p>
<ul>
<li><a href="http://udidahan.weblogs.us/2007/03/28/podcast-datasets-web-services/">Podcast on using DataSets with Web Services</li>
<li><a href="http://udidahan.weblogs.us/2007/03/30/entity-framework-disconnected-problems-solutions/">Blog post on tracking changes to objects on the client side</a></li>
<li><a href="/ask-udi/">Looking for more of the &#8220;Ask Udi&#8221; podcast?</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2007/07/12/podcast-passing-data-between-layers-in-soa-modelsmart-client-application/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
<enclosure url="http://www.dobbsprojects.com/media/newengine/dynamp.php/070712ud01.mp3?podcast=070712ud01.mp3" length="15111103" type="audio/mp3" />
		</item>
	</channel>
</rss>
