Comments
litl_phil wrote: While it's nice that Google and Acer share the vision of cloud-based computing, it's also worth noting that we at litl already have a webbook on the market (available at litl.com) that runs our own cloud-based OS. Unlike Chrome, litlOS is focused on creating a new and better web experience for the home, so we don't have the usual browser interface, we have our own innovative UI. In conjunction with easel mode (litl's inverted-V position) and our growing cohort of litl channels (special apps t...
Cloud Computing
Conference & Expo
November 2-4, 2009 NYC
Register Today and SAVE !..


2008 West
DIAMOND SPONSOR:
Data Direct
SOA, WOA and Cloud Computing: The New Frontier for Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
GOLD SPONSORS:
Appsense
User Environment Management – The Third Layer of the Desktop
Cordys
Cloud Computing for Business Agility
EMC
CMIS: A Multi-Vendor Proposal for a Service-Based Content Management Interoperability Standard
Freedom OSS
Practical SOA” Max Yankelevich
Intel
Architecting an Enterprise Service Router (ESR) – A Cost-Effective Way to Scale SOA Across the Enterprise
Sensedia
Return on Assests: Bringing Visibility to your SOA Strategy
Symantec
Managing Hybrid Endpoint Environments
VMWare
Game-Changing Technology for Enterprise Clouds and Applications
Click For 2008 West
Event Webcasts

2008 West
PLATINUM SPONSORS:
Appcelerator
Get ‘Rich’ Quick: Rapid Prototyping for RIA with ZERO Server Code
Keynote Systems
Designing for and Managing Performance in the New Frontier of Rich Internet Applications
GOLD SPONSORS:
ICEsoft
How Can AJAX Improve Homeland Security?
Isomorphic
Beyond Widgets: What a RIA Platform Should Offer
Oracle
REAs: Rich Enterprise Applications
Click For 2008 Event Webcasts
Everyone wants to lower their capital expenditures and increase operational efficiency - it's a sign of the times. The economy of the past 12 - 18 months has forced all organizations to do more with less and become more efficient. While everyone can identify with the request to do more with less, th...
SYS-CON.TV
SOA Patterns: Basic Structural Patterns – Part 2
The Transactional Service Pattern

It is important to notice the difference between setting the transaction scope from the endpoint/edge onward or setting it from the sender, which is external to the service. The difference may not seem important, but it is - since in the former case you increase the reliability of the service and the latter case increases coupling in the system and can cause you a lot of headaches. When you extend a transaction beyond the service boundary, you are making a leap of faith since the other service runs on its own machine, it has its own SLA, etc. Holding internal resources for something beyond the service trust boundary is risky.

Let's look at what's needed to implement a transactional service.

Technology Mapping
The technology mapping section takes a brief look at what it means to implement the pattern using existing technologies and mentions places technologies implement the pattern.

Implementing a Transactional Service can be easy if the message transport is transaction aware. Examples for transaction-aware infrastructure can be found in most ESBs such as Sonic ESB and Iona Artix, and also in messaging middleware like MSMQ, any JMS implementation, or SQL Server Service Broker. If you are using a transactional message transport, you can implement the Transactional Service Pattern by just creating a transaction on that resource. You may need to make the transaction distributed if, for example, you also perform database updates within the same unit of work. Then you just read a message from the ESB or messaging middleware, process it, send reactions or other  messages generated by the process to outgoing or destination queues, and commit the transaction, if everything was successful.

Note that since you would usually use more than one resource in the transaction, for instance, a queue for the message and a database to save any state changes after handling that message, you will most likely need a distributed transaction. In .NET 2.0 and up you can open a TransactionScope object (defined in System.Transactions) to transparently move to a distributed transaction if needed.

If the message transport doesn't support transactions, only acknowledge after you've saved the message into some transactional repository such as a queue or a table. You still run the risk of handling a message without acknowledging the service consumer, so you need to be ready for the possibility of getting the request again in case the ack was lost or never sent. In case of a failure, you will also need compensation logic if you sent messages to other services within the transaction that handled the incoming message.

Poison Messages
When we read a message in a transactional manner, we need to pay attention to identify and handle poison messages. A poison message is a message that is faulty in some way that makes the service crash or always aborts the transaction when it is handled. The problem is that if you read the poison message inside a transaction, the crash causes the message to return to the queue, where it nicely waits until your service recuperates enough to read it again and repeat the cycle. Some technology options like messaging products may have a mechanism to identify and discard poison messages. You need to make sure the mechanism is there and that it takes care of all your crash scenarios or at least be aware of this and deal with it yourself.

A technology that seems related is WS-ReliableMessaging. However, despite its name, the protocol is only concerned with delivering the message safely from point to point; in a sense WS-ReliableMessaging is sort of like TCP for HTTP. There is no durability promise or any transactional trait imbued in the protocol. Many ESBs, which are transactional, support this protocol so you can have the best of both worlds of using a standard protocol and transactional handling of messages.

Other related protocols are WS-Coordination and its "siblings" WS-AtomicTransaction and WS-BusinessActivity. Let's focus on WS-AtomicTransaction. WS-AtomicTransaction basically defines a protocol to orchestrate a distributed transaction between services. As a general rule I would not recommend using this as it introduces a lot of coupling between services. For instance, in the scenario in Figure 8 - do we really want to lock resources while we wait for the supplier that is external to our company and may, for example, treat our orders with low priority?

When you use a transaction-aware middleware the situation is a little different. Instead of one transaction that spans between services, you have three little transactions, one that the sending services and the middleware performs internally to guarantee delivery and the last one between the middleware and the reader - this is a coupling to the infrastructure that you can isolate in an Edge Component.

Quality Attribute Scenarios
The quality attribute scenarios section talks about the architectural benefits of utilizing patterns from the requirements perspective. Most of the architectural requirements are described from the perspective of quality attributes (scalability, flexibility, performance etc.) through the use of scenarios where these attributes are manifested. The scenarios can also be used as references for situations where the pattern is applicable.

The transactional semantics that Transactional Service induces can simplify both coding and testing. In addition, it can greatly enhance the reliability and robustness of the service. The code becomes simple since the promise of "all or nothing" helps keep developers focused on delivering the business value rather than thinking about edge cases and other related distractions.

Here are a couple of examples for scenarios that can point you to looking at the Active Service Pattern.

Quality Attribute (level1)

Quality Attribute (level2)

Sample Scenario

Reliability

Data lows

under all conditions, a message acknowledged by the system will not be lost

Testability

Coverage rate

get 95% or better  test coverage for all scenarios

The Transactional Service Pattern saves us coding because transactions don't have as many edge cases as you have when you write non-transactional code. Another pattern that can save writing code is the Workflodize Pattern, which is discussed in Part 3.

•   •   •

This article is based on the book SOA Patterns (http://www.manning.com/rotem) scheduled to print February 2009. This article is courtesy of Manning Publications (http://www.manning.com). The ebook is available and sold exclusively through Manning Publications.

About Arnon Rotem-Gal-Oz
For the past 10 years Arnon Rotem-Gal-Oz has been an architecture and system designer of large distributed systems including C4ISR systems, IP customer care and billing systems, and BI engines. He has experience with a variety of technologies (.Net, J2EE, CORBA, COM+, X-Windows) on diverse platforms (Unix, Windows, Dos, AS/400). He currently works for Rafael as the Biometric line development manager.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

SOA World Latest Stories
If you are like me, you are regularly receiving unsolicited email from various quarters, telling you about the latest and greatest SEO solutions on the planet. Just buy the book, or guide, or download the promotional whitepaper and this expert will offer you the latest "Secrets" to sea...
There's a lot of talk about how we need to focus on our buyers' issues and provide them educational insights to help them learn what they need to know to make buying decisions. Heck, I say it in my book...in several places, I think. I've said it on this blog, and I'll continue to say i...
This past weekend I set out explore some of the extension capabilities of Google Wave. One of the weaknesses that have been identified by many is the lack of integration with email. For me, in particular, because Wave is new, many Waves are being orphaned as those playing and testing o...
More good news for cloud computing! Google last week released its once mysterious Chrome Operating System to open source. Chrome OS, available in 2010 – is a web-based operating system that promises to boot up super-fast on a netbook – way faster than the time it takes to start your ba...
In CloudBerry Lab we are striving to make our customer service better. In this competitive market with the abundance of free offerings this is the only way to stay afloat. One of the ways to keep customers happy is to be very responsive when it comes to support request resolution. Shou...
We talk a lot about social media on Marketing Trenches. And for good reason – Social media seems to be at least one item on the agenda for about 90% of the meetings we have these days. Everyone wants to run 100 miles an hour to do something on Facebook, LinkedIn and Twitter. I wrote...
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON Featured Whitepapers
ADS BY GOOGLE