Blog Home  Sign In RSS 2.0 Atom 1.0 CDF  

  def Softwaremaker() :
         return "William Tay", "<Challenging Conventions />"

  knownType_Serialize, about = Softwaremaker()
 

 Thursday, November 15, 2007

With the impending release of the Microsoft BizTalk Server Adapter Pack (Beta 2 available here), there are some confusions as to the differences between the BizTalk Adapter Pack, Microsoft's WCF Line of Business (LOB) Adapter SDK, and of course, the (older) BizTalk Adapter Framework.

In a nutshell, the BizTalk Adapter Pack is written and developed on top of the WCF LOB Adapter SDK (which is free and freely downloadable). The value-add is that the LOBs that it can integrate with ootb are SAP (mySAP Business Suite), ORACLE (Oracle Database) and SIEBEL (Siebel eBusiness Applications). Of course, a lot of grunt work is taken away from you, as explained here.

One of the confusing part is the play of the words "BizTalk" in the product name. As I have explained above, built on the WCF LOB Adapter SDK, these adapters are host agnostic i.e. they are not tied to a specific product like BizTalk. You can use it with BizTalk 2006 R2 specifically (The WCF LOB adapters cannot be used in BizTalk Server versions prior to BizTalk Server 2006 R2) but you can use it outside of BizTalk as well (some configuration work required, such as the Add Adapter Reference plug-in, etc) but this also means you do not have to buy BizTalk for it, if you dont have to.

This SDK is based on Windows Communication Foundation (WCF, previously - Indigo), and it surfaces an adapter to an LOB system as a WCF binding. For an adapter consumer, the adapter can be accessed like a typical WCF service; the consumer does not have to learn a new programming model. The same adapter developed can be reused in multiple .NET applications including custom .NET applications, Microsoft® BizTalk® Server 2006 R2, Microsoft Office SharePoint® Server 2007 SP1, and Microsoft SQL Server™ Integration Services (SSIS) through adapter development provided. In addition, the adapter provides metadata browse, search, and retrieval functionality for the adapter consumer to selectively generate WCF contracts that reflect live type modeling of the LOB system.

Confusions from customers and partners alike usually stem from the the primary differences between WCF LOB Adapter SDK and the BizTalk Adapter Framework. I will hereby summarized it in the following table:

Feature WCF LOB Adapter SDK BizTalk Server Adapter Framework

API

.NET 3.0 Assembly, provides help classes for metadata processing, connection management, and messaging

COM, provides basic support for adapter operations.

Adapter exposure

  • Exposed as WCF binding; available to any application that can consume a WCF binding including BizTalk Server 2006 R2 (using the WCF adapter)

  • Exposed only to BizTalk Server; not reusable by other applications.

Tools

Adapter Code Generation Wizard, metadata browser for Visual Studio 2005

n/a

Extensibility

Yes (as WCF channel extension)

No

If you are knee-deep into writing, shipping and selling adapters for BizTalk, I strongly urge you to visit the Adapters' Team Blog here.

Thursday, November 15, 2007 2:04:07 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer  Comments [0]
  • Blog reactions

  •  Saturday, October 13, 2007

    I know I havent been posting deep technical stuff that I used to do. Contrary to what people think my current role entails, keeping abreast of the technology landscape is what I am supposed to do and what I enjoy and so when colleagues joked with me when was the last time I booted up Visual Studio, for example, I enjoyed seeing their shocked faces when I told them: "oh - just last night. why you asked ?" .

    I dont dwell deep like I used to but I still code up decent projects which I implement within my own developmental testing environment (yes, I have one running latest versions of Active Directory, SharePoint, Exchange and all the other goodies), driving the houshold crazy when I think of new and different ways to document expenses, publish a Book or CD library, home automation projects using all sorts of different technologies (yes, that includes Ruby-on-Rails) or in my new Windows Mobile 6 Device. Of course, I admit I dont post topics deep like I used to. It is not so much the content but more so, the limiting factor of time.

    Recently, I was involved in some internal technical discussions with regards to the issue of scale comparisions between Windows Communication Foundation (WCF, previously - Indigo) and ASMX. Below are some discussions:

    If you have a web service that is going to be IO bound, you would definitely want it to be scalable and almost every resource in the world tells you to implement ASP.NET asynchronous pattern (BeginSomething/EndSomething, etc) on it so to go easy on the thread pool. ASP.NET uses an IAsyncHttpHandler to handle the request, which means the worker threads are not blocked while the IO-bound operation executes somewhere else. Sounds good so far.

    If you make a WCF version of it with webHttpBinding (which actually means you can invoked it AJAX-style) following the same async pattern for the methods, you may find that each invocation of the WCF service eats up two threads – one for its ASP.NET HttpModule.ProcessRequest and the other for the actual IO. Ouch! You may think that this means your WCF implementation may end up eating all threads reserved for ASP.NET, which would indeed scale down the server

    Is this true OR are we missing the complete picture ?

    While the scenarios explained above are reasonable observations, it doesnt paint the complete picture. WCF does perform better scalability than ASMX.

    • Threading:
      For ASMX, when a request comes in, it would be queued up immediately for async ASMX. So the thread is released for that request and a new thread will pick up the work item later.

    For WCF, when a request comes in, we queue it up in WCF and let an IO thread handle the request. At the same time, the request thread-pool thread is held to wait for the request to complete.

    Yes, WCF uses more threads than async ASMX. But there is a reason for this. Using asynchronous ASMX is dangerous and not really a good practice (and I have hinted at this many times in the many Web Service/ASMX presentations I have done over the past few years). While it does well at what it is supposed to do, it does trick the developer into a "false sense of security". Essentially, if you dont know how the ASP.NET blackbox works, you may find yourself thrown against the car wall when you take a hidden, unsuspecting corner at high speeds. It does not provide enough throttling for client loads. Basically the server takes all items and queue them up for later processing. The server does not have a good throttling mechanism to control the number of work items. To everyone else, it seems that the server is quite friendly to all clients. However, if the number of clients is unbounded, this is really bad. First of all, the server working set would grow unlimited due to unlimited requests queued up. Secondly, many client requests would become obsolete when it’s picked up by the server from the queue. The latter accounts for a a good set of problematic scenarios I have come across in my past consulting gigs with regards to high-load and high-transactional ASMX asynchronous implementations before I joined the borg.

    Think of it as a side of the brain (that tells you that you are about to be full) not functioning properly when you sit down at a buffet table. You eat and eat and eat without knowning when to stop and then your ingestion/digestion system starts kicking in, you actually hit the wall. Hard. Literally.

    • Server Throughput
      When you measure scalability, the most important measurement is the server throughput. That is, how many requests the server can handle per time unit? For async ASMX, it would be pretty fast at the initial phase. However, like the ingestion/digestion analogy I was referring to above - Once the server is in a steady phase (as when CPU is fully loaded), the throughput will go down because the server capacity has reached. You can compare the data between async ASMX and sync ASMX over the long run to see what I mean.

    Also you would see higher memory usage of the async approach.

    • ASP.NET Throttling
      That said, ASP.NET does have a throttling mechanism that is used for sync ASMX, which is the threadpool thread limit. The number of threads used to handle requests are bounded (http://support.microsoft.com/kb/821268). WCF uses this fact to throttle incoming requests. You can always change the configuration settings to increase number of threads to be used to allow more work items to be queued up.

    The max number of threads follows the following formula:
    MaxWorkerThreads x #CPU – MinFreeThreads
    This is 12 by default on a single-proc machine.

    • Two-level Throttling for WCF
      WCF leverages the ASP.NET threadpool throttling to throttle client requests. At the same time, WCF has its own item queue throttling. The former is throttled by the setting mentioned in the immediate above point, while the latter is controlled by WCF throttling settings (maxConcurrentCalls etc). ASP.NET can automatically adjust threads based on CPU loads so that you would always get full load of the server.

    In this way, you may experience client failures because the requests are rejected at ASP.NET layer beforehand. So you can increase the ASP.NET throttling to get better experience. But eventually you would still be bounded by the physical server capacity, no matter whether you use async ASMX, sync ASMX, or WCF as mentioned above.

    There is improvement work done in .NET 3.0 SP1 and of course, .NET 3.5 (beta 2 here), with the use of prioritized item queues. Do expect even-better WCF performance even in some of the common scenarios. Fine tuning minWorkerThreads will even give us even better results.

    Thanks to Wenlong for helping out with the guidance and explanation. The complete scenario and the design principles for it will be published in greater detail in a MSDN whitepaper later. Do watch out for it.

    Friday, October 12, 2007 10:40:28 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer  Comments [0]
  • Blog reactions

  •  Saturday, August 25, 2007

    It was not so long ago when I made my intentions known that the .svc extension in Windows Communication Foundation (WCF, previously - Indigo) is really a clutz. It is obstrusive and really unnatural, especially when it comes to RESTful Web Services.

    In a closed door meeting with the product group folks back in 2005, before WCF rolled out and way before I joined the borg, I was told that this is a issue not with WCF itself, but by its web host - Microsoft Internet Information Server (IIS)

    There are some attempts to hack around it but one of the best I have seen is to do URL Re-Writing: Off Jon Flanders here. You can see from the bottom of his post via Christian Weyer that this still will not work with IIS6 (damned legacies) but this will give you a good excuse to move to a Better, Leaner and Meaner IIS7, which is a complete rewrite of its predecessor. About time, I say.

    Saturday, August 25, 2007 6:06:02 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Disclaimer  Comments [8]
  • Blog reactions

  •  Tuesday, August 21, 2007

    Following up on this, here are some more aggregated shareable details with regards to the Compact Framework 3.5:

    Feature

    Desktop WCF

    Compact WCF

    Bindings:

     

     

    ·         BasicHttpBinding

    Yes

    Yes

    ·         CustomBinding

    Yes

    Yes

    ·         WindowsMobileMailBinding

    N/A

    Yes

    ·         ExchangeWebServiceMailBinding

    Yes, via NetCF install

    Yes

    Formatters:

     

     

    ·         SoapFormatter

    Yes

    Yes

    ·         BinaryFormatter

    Yes

    No

    Encoders:

     

     

    ·         TextMessageEncoder

    Yes

    Yes