I've been thinking for a while that I should do some posts on building a resource manager -- not just what the interfaces are, but also what the implications and obligations are and what is entailed in meeting them. The longer I've thought about it, the more that I've realized that it really can't be one post -- instead it needs to be a set, starting with some of the behind the scenes principles.
So, this isn't going to be the 'how to write a resource manager' post -- it's going to be the 'what topics do I need to think about?' post. This one will be followed by sections on each of those topics -- at least that's my plan.
At one level a resource manager is simple: it encapsulates some resource and provides a 'transactionally perfect' view of it. Doing this means that it has to isolate changes appropriately; it has to vote in the commitment process; and it has to recover from any intervening failures. Once the design has covered these points, then there's room to discuss optimizations available through the System.Transactions or MSDTC interfaces, and how you might decide between a full resource manager or a compensator (e.g. a COM+ CRM).
This drove my set of topics. My first ones are fairly 'meta', but I believe that they're important to get the design and implementation right. They are:
- What is isolation, what does it need to do, and how can I implement it?
- How should I think about and plan for faults and failures? Which ones do I need to handle? What should my strategy be for recovering from them?
- What should I do about durability? How should I think about logging? What are the naming restrictions around durable resources?
- What are my responsibilities during the two phase commitment process?
- What if I want to handle unrecoverable resources (also known as real world actions)?
- How do I emulate a COM+ CRM?
Finally, then, my plan is to bring it all together by building up a resource manager that uses System.Transactions and System.IO.Log (available in WCF). This will be a fairly long series of articles, and I will undoubtedly be covering other topics in amongst them.
Posted
Jan 21 2006, 11:30 AM
by
jim-johnson