Book Image

Applied Architecture Patterns on the Microsoft Platform

Book Image

Applied Architecture Patterns on the Microsoft Platform

Overview of this book

Every day, architects and developers are asked to solve specific business problems in the most efficient way possible using a broad range of technologies. Packed with real-world examples of how to use the latest Microsoft technologies, this book tackles over a dozen specific use case patterns and provides an applied implementation with supporting code downloads for every chapter. In this book, we guide you through thirteen architectural patterns and provide detailed code samples for the following technologies: Windows Server AppFabric, Windows Azure Platform AppFabric, SQL Server (including Integration Services, Service Broker, and StreamInsight), BizTalk Server, Windows Communication Foundation (WCF), and Windows Workflow Foundation (WF). This book brings together – and simplifies – the information and methodology you need to make the right architectural decisions and use a broad range of the Microsoft platform to meet your requirements. Throughout the book, we will follow a consistent architectural decision framework which considers key business, organizational, and technology factors. The book is broken up into four sections. First, we define the techniques and methodologies used to make architectural decisions throughout the book. In Part I, we provide a set of primers designed to get you up to speed with each of the technologies demonstrated in the book. Part II looks at messaging patterns and includes use cases which highlight content-based routing, workflow, publish/subscribe, and distributed messaging. Part III digs into data processing patterns and looks at bulk data processing, complex events, multi-master synchronization, and more. Finally, Part IV covers performance-related patterns including low latency, failover to the cloud, and reference data caching.
Table of Contents (26 chapters)
Applied Architecture Patterns on the Microsoft Platform
Credits
Foreword
About the Authors
About the Reviewer
Preface

Preface

Back in May 2009, I had a lengthy chat with Ewan Fairweather who was a technical reviewer on my first book. We talked about the host of products that Microsoft had either released or planned to release, and how it seemed increasingly difficult for an architect to keep up with such a constant stream of new offerings. It's one thing to read a press release or a whitepaper and get the marketing spin on a product, but it's something else to truly grasp their ideal use cases and challenges. Ewan and I agreed that it would be a useful exercise to try to craft around a dozen enterprise IT use cases and evaluate which Microsoft product is truly the best fit for each scenario. Thus, a book idea was born.

To make an educated choice on which product should form the foundation of your solution architecture, you need to have an accurate picture of the strengths and weaknesses of the product, as well as see it in action. In this book, we will give you a solid overview of the core technologies in the Microsoft application platform, evaluate a range of business problems, and use a consistent decision-making process to choose the right technology to implement a solution and actually build the solution using the ideal product.

I started down a path of creating a fancy flowchart which, based on a distinct set of choices, could direct you to a proper Microsoft application platform technology. However, decisions about the core technology of a solution cannot be driven from a single fork of a flowchart. How do you realistically eliminate a product from consideration by asking a single question such as "is batch processing needed?" Decision point? There are a myriad of additional factors to consider prior to eliminating BizTalk Server or embracing SQL Server Integration Services for batch processing, for instance. Instead of a single, rigid decision matrix or single flowchart, we chose to create a decision framework that takes into account the essential areas of interest when comparing a product against the needs of your project.

In the first part of the book, we do a short dive into the core technologies demonstrated in the book. These "primers" provide a background about WCF/WF, Windows Server AppFabric, BizTalk Server, SQL Server, and the Windows Azure platform. Each primer will tell you a bit about what a product is for and how to use it. You should then have enough working knowledge to thoroughly digest the rest of the book.

The rest of the chapters follow a specific structure. Each chapter starts with the description of a fictional, but realistic, customer use case. We then offer some background on the customer and find out about the problem they wish to solve. Following the use case, you will find an evaluation of the type of pattern that best fits the customer's requirements. We then consider and evaluate multiple solutions against our decision framework. After the best choice is made, the remainder of the chapter describes the actual construction of a solution.

I have put together a great team of authors that bring a diverse set of experiences with the Microsoft platform stack. We started our effort with extensive discussions about common problems we come across on projects and which topics might be of most interest to our readers. We ended this first phase of evaluation with dozens of pattern candidates, and through prioritization, bartering, and a little pleading, we finally narrowed it down to the thirteen you find here. There are clearly many many more "common" problems that we all encounter each day, but we hoped to identify ones where the product choices weren't always clear.

The biggest challenge with a book like this is balancing the inherent bias that we technologists have towards products that we are most familiar with. It is apt then, that this is the same problem that architects and developers regularly have on their own projects. For example, if you are a SQL Server specialist, then most problems look like they can be solved with a SQL Server-based solution. Much like good project teams where multiple viewpoints can help create the appropriate solution architecture, our authors constantly challenged each other to ensure that expertise in one area did not cloud our judgment in another.

What this book covers

Chapter 1, Solution Decision Framework, outlines where to locate solution requirements and how to consistently evaluate key dimensions of a solution prior to selecting an underlying technology.

Chapter 2, Windows Communication Foundation and Windows Workflow 4.0 Primer, provides a background about WCF/WF technologies and typical scenarios to use WCF and Windows Workflow.

Chapter 3, Windows Server AppFabric Primer, explains the capabilities of Windows Server AppFabric and its components.

Chapter 4, BizTalk Server Primer, describes what BizTalk Server is, when to use it, and how to build a simple solution.

Chapter 5, SQL Server and Data Integration Tools Primer, contains a broad overview of the SQL Server products that address data integration and data management.

Chapter 6, Windows Azure Platform Primer, has an introduction into Microsoft cloud technologies including Windows Azure, SQL Azure and Windows Azure Platform AppFabric.

Chapter 7, Simple Workflow, covers a use case that involves aggregating data from multiple sources and presenting a unified response.

Chapter 8, Content-Based Routing, looks at how to effectively transmit data to multiple systems that perform similar functions.

Chapter 9, Publish-Subscribe, addresses a scenario where a message must be reliably sent to multiple endpoints.

Chapter 10, Repair/Resubmit with Human Workflow, builds a process for easy human interaction with failed messages inside a system.

Chapter 11, Remote Message Broadcasting, demonstrates a scenario where traditional polling solution is augmented to support real-time updates.

Chapter 12, Debatching Bulk Data, explains how to take giant sets of data and insert them into databases for analysis.

Chapter 13, Complex Event Processing, addresses website click stream analysis and creating actionable business events.

Chapter 14, Cross-Organizational Supply Chain, demonstrates how to build a supply chain solution to integrate systems in a purchase order scenario.

Chapter 15, Multiple Master Synchronization, covers methods for arriving at a single version of truth from multiple, often conflicting master data sources.

Chapter 16, Rapid Flexible Scalability, looks at creating temporary environments that can be easily created and contracted as needed.

Chapter 17, Low Latency Request-Reply, contains a retail scenario where high performing query services are established.

Chapter 18, Handling Large Session and Reference Data, discusses usage of distributed caching to scale large workloads in web applications.

Chapter 19, Website Load Burst and Failover, looks at leveraging the Windows Azure platform's elastic resources and high service level for building a low cost solution.

Chapter 20, Wrap Up, is a brief summary of the key points addressed in the book.

What you need for this book

The following software products are used in this book:

  • BizTalk Server 2010 and ESB Toolkit 2.1

  • .NET Framework 4.0 (which includes Windows Communication Foundation and Windows Workflow Foundation)

  • SQL Server 2008 R2

  • StreamInsight 1.0

  • Windows Server AppFabric

  • Windows Azure Platform

  • Visual Studio 2010

Who this book is for

This book is for the busy architect, developer, or manager who needs to advance their knowledge of the Microsoft application platform space. If you last evaluated the Microsoft platform offerings in 2009, then you are woefully out-of-date. Don't worry, it happens to the best of us. I'd like to hope that flipping through this book will increase your confidence when trying to figure out a consistent way to choose which Microsoft product to use.

If you are a developer looking to transfer your skills into architecture, then this book can help you take a big-picture approach to pattern detection in use cases and apply a broad range of evaluation criteria to product selection. Alternately, you may just want to get a short primer on the latest Microsoft technology.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "Data is stored in the custom region June6_UserReviews of the ReviewsCache".

A block of code is set as follows:

SyncOrchestrator orchestrator = new SyncOrchestrator();
orchestrator.LocalProvider = source;
orchestrator.RemoteProvider = destination;
orchestrator.Direction = SyncDirectionOrder.UploadAndDownload; //bidirectional sync
orchestrator.Synchronize();

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

SEND ON CONVERSATION @RecvReqDlgHandle
MESSAGE TYPE [//SOAbook/SampleQueue/ReplyMessage]
(@ReplyMsg);
END CONVERSATION @RecvReqDlgHandle;
END
SELECT @ReplyMsg AS SentReplyMsg;
COMMIT TRANSACTION;
GO

Any command-line input or output is written as follows:

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Right-click on the BizTalk project and select Properties".

Note

Warnings or important notes appear in a box like this.

Note

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to, and mention the book title via the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book on, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Note

Downloading the example code for this book

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.