<?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>John Bennett&#039;s blog &#187; soa</title>
	<atom:link href="http://jtbennett.com/blog/tag/soa/feed" rel="self" type="application/rss+xml" />
	<link>http://jtbennett.com/blog</link>
	<description>Software and web development</description>
	<lastBuildDate>Tue, 08 Feb 2011 00:50:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<meta xmlns="http://www.w3.org/1999/xhtml" name="robots" content="noindex,follow" />
		<item>
		<title>Identifying the services within a service oriented CMS</title>
		<link>http://jtbennett.com/blog/2010/07/identifying-the-services-within-a-service-oriented-cms</link>
		<comments>http://jtbennett.com/blog/2010/07/identifying-the-services-within-a-service-oriented-cms#comments</comments>
		<pubDate>Mon, 26 Jul 2010 14:52:43 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[msnbc]]></category>
		<category><![CDATA[soa]]></category>

		<guid isPermaLink="false">http://jtbennett.com/blog/2010/07/identifying-the-services-within-a-service-oriented-cms</guid>
		<description><![CDATA[In my previous post I talked about avoiding a database oriented architecture (DOA) and choosing a service oriented architecture (SOA) for our content management system (CMS). The next big question is: How do we divide our CMS into large-grained sets &#8230; <a href="http://jtbennett.com/blog/2010/07/identifying-the-services-within-a-service-oriented-cms">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a title="Credit: Nick Sherman" href="http://www.flickr.com/photos/nicksherman/"><img style="float: right" title="Dividing the service pie" border="0" alt="Dividing the service pie" align="right" src="http://jtbennett.com/blog/wp-content/uploads/2010/07/4480673517_3e35ac3d99_d1.jpg" width="244" height="184"></a>In my previous post I talked about avoiding a <a href="http://jtbennett.com/blog/2010/07/database-oriented-architecture-is-doa">database oriented architecture</a> (DOA) and choosing a service oriented architecture (SOA) for our content management system (CMS).</p>
<p>The next big question is: How do we divide our CMS into large-grained sets of discrete functionality – business services? </p>
<p>A good CMS cleanly separates content from presentation.&nbsp; Even simple blog-oriented CMSs have this separation.&nbsp; This blog is currently hosted in <a href="http://wordpress.org/">WordPress</a>.&nbsp; By simply downloading a different WordPress theme, I can change not only colors and fonts, but the entire structure of the site.&nbsp; I can add widgets to the sidebar, change the header image, show either full posts or excerpts on the main page, add buttons to share on Twitter and Facebook, change URLs or move pages around into an entirely different hierarchical structure – all without touching the content of a single post.</p>
<p>With a large news-oriented CMS, this separation is even more important.&nbsp; We deliver news not just to browsers, but to all kinds of applications and devices – from iPads to Bing Maps and Google Earth, from Microsoft Surface tables to a 70s-style arcade game machine in Rockefeller Center.&nbsp; But our reporters and editors shouldn’t have to worry about – or even be aware of – all of that.&nbsp; They just need to worry about crafting great stories.</p>
<p>Thus, the most obvious business services within our CMS are what we call <strong>Editorial</strong> and <strong>Delivery</strong>.</p>
<p>As a news organization, we not only deliver the news – we consume it in enormous quantities.&nbsp; Feeds like the AP, UPI, Agence France-Presse, and hundreds of other text and photo sources all flow in 24 hours a day.&nbsp; Then there are data sources like weather, stock market tickers, lottery results, etc.; it all has to be gathered, organized, searched, categorized, edited, and made available for publishing.&nbsp; Elections produce enormous amounts of data that we need to sort, search, and aggregate.&nbsp; All of this functionality makes up the <strong>Ingest</strong> business service.</p>
<p>One type of ingested content absent from the list above is video.&nbsp; NBC News (a parent of ours) is one of the largest producers of video news content in the world.&nbsp; We support the websites for msnbc.com, cnbc.com, todayshow.com, plus shows like Rachel Maddow, Countdown, Dateline, Nightly News, Meet the Press, and more.&nbsp; Video is different from text and photo content in many ways:&nbsp; sheer file size, bandwidth consumption, encoding standards (and the computing powered needed for encoding), editing tools, advertising model, etc.</p>
<p>As a result of this complexity, video is a technical and editorial specialty unto itself.&nbsp; I’m no expert in video, so I’ll leave the detailed discussion to others.&nbsp; But as a major functional area that has to integrate with everything else in our CMS, <strong>Video </strong>is a business service.</p>
<p>Our other parent (Microsoft) gives us access to a wealth of technology.&nbsp; Not only the platform building blocks of Windows Server, ASP.NET, WCF, etc.; but also cool stuff like the ability to scan huge amounts of content and determine the most important people, places and concepts mentioned.&nbsp; And to automatically determine which stories, photos, and videos are related to one another.&nbsp; Check out the Related and Topics areas near the bottom of a <a href="http://www.msnbc.msn.com/id/38382217/ns/technology_and_science-wireless/">story page</a> to see what I mean.&nbsp; Like video, we want this capability integrated with many other parts of the system, yet it is more or less a world unto itself.&nbsp; This is the <strong>Topics </strong>business service.</p>
<p>With any non-trivial system, we also need to concern ourselves with day to day operations and maintenance.&nbsp; How do we easily deploy to and configure all those servers in multiple data centers?&nbsp; How do we monitor them and get notified when something isn’t working?&nbsp; How do we get detailed troubleshooting data for a server or process gone awry?&nbsp; While some of these capabilities need to be part of the implementation of every service, the data aggregation, monitoring and notifications are business functionality that forms the <strong>Operations</strong> service.</p>
<p>In future posts, I’ll dig into these services and their component applications, focusing first on the Delivery service.</p>
]]></content:encoded>
			<wfw:commentRss>http://jtbennett.com/blog/2010/07/identifying-the-services-within-a-service-oriented-cms/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Database Oriented Architecture is DOA</title>
		<link>http://jtbennett.com/blog/2010/07/database-oriented-architecture-is-doa</link>
		<comments>http://jtbennett.com/blog/2010/07/database-oriented-architecture-is-doa#comments</comments>
		<pubDate>Sun, 11 Jul 2010 16:37:05 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[msnbc]]></category>
		<category><![CDATA[soa]]></category>

		<guid isPermaLink="false">http://jtbennett.com/blog/2010/07/database-oriented-architecture-is-doa</guid>
		<description><![CDATA[As we began work on a new CMS for msnbc.com, one of the major pain points with the existing system that we wanted to address was its database oriented architecture – or DOA.&#160;&#160; No, not the popular video game (searching &#8230; <a href="http://jtbennett.com/blog/2010/07/database-oriented-architecture-is-doa">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.imdb.com/title/tt0094933/"><img style="margin: 0px 0px 0px 5px; float: right" title="D.O.A movie poster from IMDB" border="0" alt="D.O.A movie poster from IMDB" align="right" src="http://jtbennett.com/blog/wp-content/uploads/2010/07/MV5BMTMxNDk4NDEzNF5BMl5BanBnXkFtZTYwNTc2NDg5._V1._SX216_SY325_1.jpg" width="164" height="244"></a>
<p>As we began work on a new CMS for msnbc.com, one of the major pain points with the existing system that we wanted to address was its database oriented architecture – or DOA.&nbsp;&nbsp; No, not the popular video game (searching for DOA is borderline NSFW).&nbsp; Rather, “dead on arrival” – the morbid term for an ambulance patient who doesn’t survive the trip to the hospital.</p>
<p>A multitude of dependencies on a single central database is, indeed, DOA.&nbsp; First, it doesn’t scale well up to billions of page views per month, or make it easy to achieve redundancy across data centers.&nbsp; Doing so requires all sorts of magic with clusters, mirroring, replication, etc. – in other words, expensive hardware and even more expensive people.&nbsp; (The reason it has worked up to now is our top-notch operations team.)</p>
<p>Second, all of those dependencies mean that changes to the database schema are effectively impossible.&nbsp; </p>
<p>A CMS like ours isn’t a single application.&nbsp; It’s an ecosystem of applications, built by different teams over a long period of time and performing a wide variety of functions: filtering and aggregating hundreds of inbound news wires in different formats, encoding all the video from one of the largest news organizations in the world, supporting journalists on tight deadlines around the clock, and – oh, yeah – serving up all that content to millions of people a day.&nbsp; </p>
<p>Most of those applications create or manipulate content that is stored in the central database.&nbsp; Thus, any change to the database is likely to have side-effects.&nbsp; A change to support one application, simple on its own, turns out to require a major refactoring effort in an unrelated application.&nbsp; Fixing bugs becomes a game of <a href="http://www.addictinggames.com/whackamole.html">whack-a-mole</a>; new features become more expensive and take longer and longer to release.&nbsp; Worse, a great new feature may not get built at all.</p>
<p>This isn’t really a problem with databases, of course.&nbsp; It’s a problem with dependency management.&nbsp; But it is exacerbated by the fact that accessing a database is inherently a blocking operation – you have to wait for the result.&nbsp; Any single resource that must be available all the time in order for any other part of the system to function correctly is going to cause these types of problems.</p>
<p>For all of these reasons, we opted instead for a service oriented architecture (SOA).&nbsp; That doesn’t mean simply exposing everything as a web service.&nbsp; It means partitioning the system into “business services” – large grained, autonomous sets of functionality.&nbsp; Being autonomous includes having one’s own private database (assuming there is some data for that service to persist).&nbsp; Private means private – the database is not shared with other services.</p>
<p>SOA is not exactly a radical choice, but it does require a radical change in thinking – for developers, for admins, even for end users.&nbsp; It requires letting go of 100% consistency 100% of the time in favor of eventual consistency, letting go of “one database to rule them all,” and accepting that maintaining multiple, service-specific versions of the data won’t be the end of the world.</p>
<p>It takes a lot of time and constant effort to completely change your world view.&nbsp; It’s not unlike a procedural developer being introduced to object orientation.&nbsp; It takes a lot of practice, and dozens of “Aha!” moments to cross the conceptual chasm.&nbsp; As an organization, we’re still in mid-air.&nbsp; I expect we’ll eventually land safely on the other side, and not wind up DOA.</p>
<p>In a future post, I’ll write about how we drew the boundaries between our business services.</p>
]]></content:encoded>
			<wfw:commentRss>http://jtbennett.com/blog/2010/07/database-oriented-architecture-is-doa/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Business services, EDA and asynchronous messaging</title>
		<link>http://jtbennett.com/blog/2009/04/business-services-eda-and-asynchronous-messaging</link>
		<comments>http://jtbennett.com/blog/2009/04/business-services-eda-and-asynchronous-messaging#comments</comments>
		<pubDate>Sun, 12 Apr 2009 16:10:00 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[eda]]></category>
		<category><![CDATA[soa]]></category>

		<guid isPermaLink="false">http://173.203.71.169/blog/2009/04/business-services-eda-and-asynchronous-messaging/</guid>
		<description><![CDATA[Business services are not the same thing as web services.&#160; A business service is a high-level concept: a large-grained, cohesive set of business functionality.&#160; Everywhere you see the word &#8220;service&#8221; in this post you should think &#8220;big chunk of business &#8230; <a href="http://jtbennett.com/blog/2009/04/business-services-eda-and-asynchronous-messaging">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Business services are not the same thing as web services.&nbsp; A business service is a high-level concept: a large-grained, cohesive set of business functionality.&nbsp; Everywhere you see the word &#8220;service&#8221; in this post you should think &#8220;big chunk of business functionality&#8221;.&nbsp; Each business service is likely implemented as a set of smaller-grained components (some of which might be web services).&nbsp; Business service is very macro.&nbsp; Web service is very micro.</p>
<p>In an event-driven architecture (EDA), business services communicate with one another through asynchronous messaging, in order to reduce the coupling between them.&nbsp; By communicating asynchronously, a business service can continue to operate (for some period of time) without any contact with other business services.&nbsp; That&#8217;s where their &#8220;autonomous&#8221; quality comes from.</p>
<p>For example, a retailer might have an Inventory service, an Order service, an Inventory service, a Billing service, and a Shipping service.&nbsp; The Order service can take orders even if the other services are unavailable.&nbsp; When those services become available, queued messages can be exchanged &#8212; inventory gets allocated, orders get shipped and customers get billed.</p>
<p>Suppose an order is placed over the web.&nbsp; The Order service might publish an OrderReceived message.&nbsp; The Inventory service would then publish either an InventoryAssignedToOrder or an ItemOutOfStock message, depending on what was actually available.&nbsp; The Order service would subscribe to those types of messages.&nbsp; If it received the first, it would then publish an OrderApproved message.&nbsp; If it received the second, it might take other action, such as sending an email to the customer.</p>
<p>You may have noticed that we just created a messaging protocol.&nbsp; That is, the Order service must correlate multiple messages related to the same business process, and keep track of state related to those messages.&nbsp; Within the Order service, the logic would be something like this:</p>
<ul>
<li>When an order is placed (in an inbound web request), save it, publish an OrderReceived message, and send the customer a response message that the order was successfully received.
<li>When an InventoryAssignedToOrder message is received, look up the order and record the assigned inventory quantity next to the quantity ordered.
<li>When inventory has been assigned for all quantities of all products in the order, publish an OrderApproved message.
<li>When an ItemOutOfStock message is received, send an email to the customer.
<li>When an hour passes after sending an OrderReceived message, if not all quantities in the order have been assigned inventory and no ItemOutOfStock message has been received, publish an OrderDelayed message. </li>
</ul>
<p>This is a <strong>saga</strong> &#8212; a long-running process within a single service that requires the service to correlate messages and track state across those messages.&nbsp; Note that this is just one side of the equation.&nbsp; The Inventory service might have its own saga.&nbsp; </p>
<p>Notice how each of the saga&#8217;s business rules start with &#8220;When&#8221;.&nbsp; These rules are what make the architecture <strong>event-driven</strong>.&nbsp; Notice also how simple the rules are.&nbsp; Especially interesting is that the technical implementation maps almost directly to the business rules.&nbsp; We would create an OrderProcessingSaga class, which has methods for Handle&lt;OrderReceived&gt;(), Handle&lt;InventoryAssignedToOrder&gt;(), etc.&nbsp; The simple logic of each method is described in one of the bullets above.&nbsp; (The final bullet is implemented in Handle&lt;Timeout&gt;().)</p>
<p>How would we accomplish the same process in a synchronous RPC (remote procedure call) architecture?&nbsp; In RPC (like typical HTTP-based web services), a request is issued and the requestor waits for the response. </p>
<ul>
<li>When an order is placed (in an inbound web request), save it.&nbsp; The inbound connection remains open.
<li>The Order service opens a new connection to the Inventory service.&nbsp; The connection remains open while the Inventory service determines whether inventory is available for all the quantities in the order.&nbsp; The response to the Order service includes data on any product SKUs that are out of stock.&nbsp; The response is sent and the connection from Order service to Inventory service is closed.
<li>The Order service looks for any out of stock SKUs in the response.&nbsp; Based on that, it creates the appropriate message (&#8220;order confirmed&#8221; or &#8220;items out of stock&#8221;), sends the customer a response message. </li>
</ul>
<p>At first glance this might seem no different than the message-based process above.&nbsp; But there are a number of problems with the RPC approach that reach across most of the -ilities:</p>
<p><strong>Reliability.</strong>&nbsp; Even with all the redundant hardware in the world, at some point the Inventory service will be down.&nbsp; During that time, no orders can be accepted.&nbsp; If each of the two services has 99% uptime, the total uptime for the system from the customer&#8217;s perspective is 99% x 99% = 98.01%.&nbsp; The system as a whole is <em>less reliable the least reliable component.&nbsp; </em>To get the system to 99% uptime, both services need uptime of at least 99.5%.&nbsp; That means a greater investment in hardware, maintenance, etc.</p>
<p>In the message-based approach, the Order service can happily process orders without the Inventory service for up to an hour (or whatever rule is applied in the saga).&nbsp; The services are not temporally coupled &#8212; they don&#8217;t always have to be running at the same time.&nbsp; From the customer&#8217;s perspective, the uptime is 99%.&nbsp; </p>
<p>The Inventory service can be taken down for maintenance.&nbsp; Perhaps it could be deployed to two cheap servers instead of to an expensive active-passive cluster.&nbsp; All without affecting the uptime of the Order service.</p>
<p><strong>Performance.</strong>&nbsp; In the RPC approach, the customer submits an order and then waits: while the Order service records the order, while the Order service contacts the Inventory service, while the Inventory service responds, and while the Order service figures out what message to return.&nbsp; What if the Inventory service takes 5 seconds to determine whether inventory is available?&nbsp; The customer sees a spinning ball.&nbsp; In the message-based approach, the customer waits only for the Order service to record the order.&nbsp; A response is them immediately sent to the customer.&nbsp; </p>
<p>Now add the latency of communication between the services.&nbsp; If they are in different data centers, that could add half a second to the customer&#8217;s wait time in the RPC approach.&nbsp; It adds zero time in the message-based approach.</p>
<p><strong>Scalability.</strong>&nbsp; In the RPC approach, connections between the customer and the Order service remain open for longer (as described above).&nbsp; Let&#8217;s say the Order service receives 10 orders/second.&nbsp; If the connection remains open for 2 seconds, the Order service has to support 20 simultaneous connections.&nbsp; If the message-based approach reduced the connection time to 1 second, the Order service only has to support 10 simultaneous connections &#8212; for the same volume of orders.&nbsp; This disparity can become much worse under real-world traffic peaks.&nbsp; Customer requests may wind up queuing (decreasing performance further) or even timing out.</p>
<p>The same problem occurs between the Order service and the Inventory service, as connections are consumed there in the same proportion.</p>
<p><strong>Transparency.</strong>&nbsp; Take another look at the logic for the RPC and message-based approaches.&nbsp; In which one is the business logic more readily apparent?&nbsp; Which one would do you think a sales rep would more easily understand?&nbsp; I believe that the message-based approach wins handily on both counts.&nbsp; As mentioned above, the business logic maps almost directly to the actual implementation classes and methods.&nbsp; While a good RPC design can also have this quality, transparency is very natural and very easy in the message-based approach.</p>
<p><strong>Maintainability.</strong>&nbsp; Let&#8217;s add shipping to our business process.&nbsp; In the RPC approach, during the order request, just after we assign the inventory to the order, we would open a connection to the Shipping service, ask it to ship the order, wait for its response, and then send the response to the customer.&nbsp; With this third service, we&#8217;ve exacerbated all of the reliability, performance and scalability issues described above.&nbsp; </p>
<p>All three systems have to be running.&nbsp; At 99% uptime for each service, our overall our system is now down to 97.03% uptime.&nbsp; We don&#8217;t want to ship the order unless we actually have all products in stock, so we have to wait for the request to the Inventory service to return before we talk to the Shipping service.&nbsp; Our connections from the customer are now up to 3 seconds each, and our Order service has to support 30 simultaneous connections.</p>
<p>What happens when we&#8217;ve assigned inventory and then the call to the shipping service fails?&nbsp; We have to free the inventory somehow, so we place the whole order request in a transaction.&nbsp; That transaction flows across each service call, so that if shipping fails the inventory assignment is rolled back.&nbsp; The transaction management adds half a second to the customer&#8217;s wait time, and we&#8217;re up to needing 35 simultaneous connections on our Order service.</p>
<p>In the message-based approach, we create a new saga within the Shipping service.&nbsp; It has a rule saying: When an OrderApproved message is received, try to ship the order.&nbsp; If successful, publish an OrderShipped message; otherwise publish an OrderFailed message.</p>
<p>We add rules to the OrderProcessingSaga:&nbsp; When an OrderShipped message is received, update the order status; and when an OrderFailed message is received, update the order status and send an email to the customer.&nbsp; </p>
<p>And we add a rule to the Inventory service&#8217;s saga:&nbsp; When an OrderFailed message is received, release any inventory assigned to the order.</p>
<p>We haven&#8217;t had to make a single change to the processing logic for the customer&#8217;s initial request to place the order.&nbsp; We haven&#8217;t had to create distributed transactions, because the business rules in the various sagas handle failures correctly.&nbsp; We haven&#8217;t reduced our system uptime.&nbsp; We haven&#8217;t lengthened the time a customer waits for a response, and therefore we don&#8217;t have to support more simultaneous connections from customers.</p>
<h3>Conclusions</h3>
<p>The business process described here is pretty simple.&nbsp; Real world processes get much more complicated:&nbsp; Add a credit check before assigning inventory.&nbsp; Bill the customer after the order ships, after getting sales tax computation from an external service.&nbsp; Substitute an equivalent product if the one ordered has been discontinued.&nbsp; Yikes!&nbsp; </p>
<p>If you read &#8220;service-oriented&#8221; as &#8220;synchronous RPC-style web services,&#8221; you&#8217;ll quickly be in big trouble with a system of any significant size.&nbsp; However, if you read &#8220;service-oriented&#8221; as &#8220;event-driven, autonomous business services communicating with asynchronous message across service boundaries,&#8221; you&#8217;ll have a much better chance of actually enjoying the maintenance of your system.&nbsp; I&#8217;ll take the latter, thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://jtbennett.com/blog/2009/04/business-services-eda-and-asynchronous-messaging/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is a service?</title>
		<link>http://jtbennett.com/blog/2008/10/what-is-a-service</link>
		<comments>http://jtbennett.com/blog/2008/10/what-is-a-service#comments</comments>
		<pubDate>Mon, 20 Oct 2008 02:37:00 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[soa]]></category>

		<guid isPermaLink="false">http://173.203.71.169/blog/2008/10/what-is-a-service/</guid>
		<description><![CDATA[In last week&#8217;s training, one of the biggest &#8220;Aha!&#8221; moments for me was an answer to the simple question &#8220;What is a service?&#8221; As someone who consumes a lot of guidance from Microsoft&#8217;s p&#38;p team, and looks to gurus like &#8230; <a href="http://jtbennett.com/blog/2008/10/what-is-a-service">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://jtbennett.com/blog/udi-dahan-s-distributed-systems-course/">last week&#8217;s training</a>, one of the biggest &#8220;Aha!&#8221; moments for me was an answer to the simple question &#8220;What is a service?&#8221;</p>
<p>As someone who consumes a lot of guidance from Microsoft&#8217;s <a href="http://msdn.microsoft.com/en-us/practices/default.aspx">p&amp;p team</a>, and looks to gurus like <a href="http://blogs.msdn.com/drnick/">Nicholas Allen</a>, <a href="http://dasblonde.net/">Michele Leroux Bustamante</a> and <a href="http://www.idesign.net/idesign/DesktopDefault.aspx?tabindex=3&amp;tabid=5">Juval Lowy</a> for all sorts of WCF insights, my working definition of a service has been a very technical one.&nbsp; A service is a cohesive set of functionality described by a contract.&nbsp; In WCF terms, it&#8217;s a .NET interface decorated with a [ServiceContract] attribute, along with one or more implementations of that interface.</p>
<p>One of <a href="http://www.udidahan.com/">Udi</a>&#8216;s major themes in the training was how writing code is usually the easy part.&nbsp; It&#8217;s design that can be hard, and good design is always closely related to the business problem you are solving.&nbsp; The &#8220;Aha!&#8221; for me was that a service in SOA has very little to do with technology &#8212; a service is a <em>business</em> concept.&nbsp; <em>Business services</em> are what SOA is all about.&nbsp; Apparently my mistake is <a href="http://www.udidahan.com/2006/02/26/common-soa-pitfalls/">not uncommon</a>.</p>
<p><a href="http://bill-poole.blogspot.com/">Bill Poole</a> has written a series of excellent posts on SOA.&nbsp; I highly recommend them as a primer on <a href="http://bill-poole.blogspot.com/2008/06/business-services.html">business services</a>, including how they relate to <a href="http://bill-poole.blogspot.com/2008/03/web-services-defined.html">web services</a>.&nbsp; (In fact, you should just go back to his first post from early 2008 and read them all.&nbsp; It&#8217;s well worth a couple hours of your time.)&nbsp; From Bill:</p>
<blockquote><p><em>So &#8211; the primary concern in SOA is the identification and definition of the architecture&#8217;s constituent services. When applying SOA in a business context we are concerned with identifying business services. A business service serves a specific business purpose, and is defined strictly in business terms.</em></p>
<p><em>We define the responsibilities of a business service in terms of the cohesive business area/capability the service supports, and we define the interactions with other services in terms of the business events and operations exposed by the service, as well as the service level agreements provided by the service and the policies imposed by the service on its consumers.</em></p>
</blockquote>
<p>A business service is conceptual and maps to a business capability, not to a development artifact.&nbsp; It&#8217;s the &#8220;Shipping service&#8221;, not IShippingService.&nbsp; Asynchronous messaging is the <strong>only</strong> way that the Shipping service interacts with other business services &#8212; as a subscriber (PaymentReceived message) or as a publisher (OrderShipped message).&nbsp; Its internal implementation may include web services that talk to one another synchronously or asynchronously, or that wrap legacy, COTS, or external systems (like an SAP shipping module or a UPS-provided web service).&nbsp; But those web services are not accessible by anything outside of the Shipping service.</p>
<p>The promised benefits of SOA seems much more realizable when you think in terms of business services.</p>
<p>Take <em>loose coupling</em> as one example.&nbsp; We all know that it&#8217;s a good thing, and we are told that web services help us achieve it.&nbsp; But how loose is the coupling between a web service and its clients?&nbsp; As long as I don&#8217;t change the web service contract, I can change the implementation of the service without affecting any of its clients.&nbsp; There is no direct binary dependency on the service or its interface.</p>
<p>Alas, in the real world, if I change the business rules inside my web service in any significant way, it&#8217;s likely that I&#8217;ll also have to change the way that clients use it in subtle or not-so-subtle ways.&nbsp; The subtle ones are where the real headaches are, especially when I try to get reuse by having multiple clients accessing my web service from slightly different business contexts.</p>
<p>If the client is using synchronous RPC-style calls to the service, it is temporally coupled to the service &#8212; it&#8217;s has to wait for the service to finish its work before it can continue.&nbsp; Even if the service uses asynchronous, one-way operations, all too frequently it is receiving what Bill calls <em>command messages,</em> where the client is instructing the service to take some action.&nbsp; That&#8217;s a form of coupling, as well &#8212; the client can&#8217;t fulfill its responsibilities without the service.</p>
<p>Business services interact with other business services solely through asynchronous messaging &#8212; primarily <em>event messages</em>.&nbsp; That&#8217;s about as loose as it gets.</p>
<p>None of this is to say that web services are bad in any way.&nbsp; They&#8217;re a powerful tool in our developer toolbox, and I love what WCF does for me.&nbsp; But web services are an implementation detail <em>within </em>business services.</p>
]]></content:encoded>
			<wfw:commentRss>http://jtbennett.com/blog/2008/10/what-is-a-service/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Udi Dahan&#8217;s distributed systems course</title>
		<link>http://jtbennett.com/blog/2008/10/udi-dahan-s-distributed-systems-course</link>
		<comments>http://jtbennett.com/blog/2008/10/udi-dahan-s-distributed-systems-course#comments</comments>
		<pubDate>Mon, 20 Oct 2008 01:32:00 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[soa]]></category>

		<guid isPermaLink="false">http://173.203.71.169/blog/2008/10/udi-dahan-s-distributed-systems-course/</guid>
		<description><![CDATA[Last week, I had the opportunity to attend Udi Dahan&#8216;s Advanced Distributed Systems Design using SOA &#38; DDD in Austin, TX.&#160; I learned a ton and gained a much clearer understanding of SOA and how to design systems using that &#8230; <a href="http://jtbennett.com/blog/2008/10/udi-dahan-s-distributed-systems-course">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Last week, I had the opportunity to attend <a href="http://www.udidahan.com/">Udi Dahan</a>&#8216;s <a href="http://www.headspringsystems.com/soa/">Advanced Distributed Systems Design using SOA &amp; DDD</a> in Austin, TX.&nbsp; I learned a ton and gained a much clearer understanding of SOA and how to design systems using that architectural style.&nbsp; I&#8217;ll be blogging more about the subject over the next couple of weeks.</p>
<p>This post is just to say a big thanks to Udi and to Headspring for sponsoring the course.&nbsp; It was a great week, and I was lucky to meet a bunch of great people.&nbsp; In addition to Udi: <a href="http://codebetter.com/blogs/aaron.jensen/default.aspx">Aaron Jensen</a>, Jacob Lewallen, <a href="http://www.lostechies.com/blogs/jimmy_bogard/default.aspx">Jimmy Bogard</a>, <a href="http://geekswithblogs.net/bcaraway/Default.aspx">Blake Carroway</a>, <a href="http://www.lostechies.com/blogs/hex/">Eric Hexter</a>, and some other very nice guys.&nbsp; It was a bit humbling to be in a small room with all of that intellectual horsepower.</p>
<p>I&#8217;ll <a href="http://codebetter.com/blogs/aaron.jensen/archive/2008/10/19/udi-dahan-s-soa-bootcamp.aspx">echo Aaron</a> and say that if you ever have the chance to take this course &#8212; or just to talk to Udi and absorb some of what&#8217;s in his big brain &#8212; do it!&nbsp; And now that he&#8217;s an expert on <a href="http://en.wikipedia.org/wiki/Chicken_fried_steak">chicken fried steak</a>, don&#8217;t forget to ask him about that, too.</p>
]]></content:encoded>
			<wfw:commentRss>http://jtbennett.com/blog/2008/10/udi-dahan-s-distributed-systems-course/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

