Building Composite Application Services with Windows Server AppFabric Rick G. Garibay @rickggaribay
About Me General Manager, Connected Systems Practice at Neudesic Microsoft MVP, Connected Systems Microsoft Connected Technology Advisor President, Co-Founder Phoenix Connected Systems User Group (PCSUG) Nearly 12 years professional experience developing Microsoft solutions across industry verticals http://rickgaribay.net Twitter: @rickggaribay
Agenda Trends in Application Design & Infrastructure Performance & Scale Hosting Composition Transcending Trust Boundaries Roadmap
TRENDS IN APPLICATION DESIGN & INFRASTRUCTURE
Trends in Application Infrastructure 2010+ 2000s 1990s 1980s 1970s Cloud SOA Web Client-Server Mainframe? WinFX N-Tier architectures, ESB, Data Warehousing ASP.NET Web servers COM+ Two tier architectures, message queuing
Composable Applications Reservation Request Reservation Review Reservation Approval
Expose Data Legacy LOB Packaged Apps Trading Partners Data Legacy LOB Packaged Apps Trading Partners
Compose (Orchestration and Workflow) Data Legacy LOB Packaged Apps Trading Partners
Consume (Productivity & Innovation) Web 2.0 Packaged Apps Portal Devices and People Data Legacy LOB Packaged Apps Trading Partners
Composite App Challenges Performance & Scale Hosting Composition Transcending Trust Boundaries Web Applications Services Deployment Configuration Monitoring Troubleshooting Long-Running Apps Async Processing Connecting the dots Firewalls Identity Access Control
Hosting Options ServiceHost WorkflowServiceHost HTTP, TCP, IP, MSMQ ServiceHost WorkflowServiceHost HTTP, TCP, IP, MSMQ Auto-Start Start, Stop, Pause Self- Hosting Windows Service IIS 7/WAS IIS Message-based Activation Process isolation (App Pools) HTTP, TCP, IP, MSMQ Message-based Activation Process isolation (App Pools) HTTP only
Server Manager Windows Server AppFabric Visual Studio IIS Manager WF and WCF IIS Manager Modules Management APIs (PowerShell command-lets) AppFabric Runtime Services and Components System Center IIS/WAS
PERFORMANCE & SCALE
Performance and Scale - Challenges Database round trips take time Database resources are scarce Database partitioning is hard Roll-your-own caching requires effort and adds risk
Using AppFabric Cache from ASP.NET DEMO 1 PERFORMANCE AND SCALE
Performance and Scale Summary Free up database server for important queries No code to put Session state in AppFabric Cache Simple API for interacting with cache from apps Local cache gives big raw performance boost Can scale as large as you need High availability built in
HOSTING
Service Hosting - Challenges Services are a different management and config story than web apps Monitoring & troubleshooting is difficult How can I tell at a glance that everything is OK? How busy is my server? Are there any errors? Versioning
AppFabric Dashboard
Single Cockpit
Services hosted in AppFabric use messagebased activation The AutoStart feature improves host responsiveness Initializes the worker process before the first message is received AutoStart
Instance Restart Client A Client B WFService Instance (Running) WFService Instance (Running) Instance Restart Unlocked Locked
Instance Lock Retry Client A Client B WFService Instance (Running) WFService Instance (Running) Unlocked Locked
Configuring Lock Management
Deployment with Web Deploy From Visual Studio: Developers can create new applications that are hosted in AppFabric Developers can publish and debug applications From IIS Manager: Can refine application configurations and export packages Can import packages to set up new machines MSDeploy features Can automate with PowerShell
Deploying from Visual Studio
AppFabric Deployment & Monitoring DEMO 2 - SERVICE HOSTING
Service Hosting Summary Scripted Deploy reduces time and risk Integrated into IIS (where ITPros are comfortable) Dashboard health at a glance Better Logging/Eventing quicker troubleshooting Less frequent escalation to developers
COMPOSING SERVICES
Composing Services Buy Comprehensive BPM solutions are out there. Most overshoot the need in terms of features and complexity. Established Application Servers are out there. All of them are expensive.
Composing Services Build Provide visibility into state of process Escalations/reminders Writing lots of plumbing code that doesn t solve business problems Persistence storing the state of a transaction while waiting for responses Data clean up Async is hard Correlation of requests and responses
Composing Services WF helps with composition, but WF requires some additional work to configure hosting, persistence management, monitoring, and scaling Lacks management tools Deployment is difficult
Workflow Tracking OOB provides EtwTrackingParticipant Can build own TrackingParticipant Tracking Profiles control verbosity Logs the following events: Workflow status changes Activity status changes Custom user data And more Runtime Workflow Extensions Scheduler Persistence Provider Tracking Participant
Tracking Profiles Define what tracked events are recorded workflowinstance activitystate - track variable & argument values defined on activity activityscheduled cancelrequested faultpropagation bookmarkresumption customtracking Default.NET 4 tracking profile defined in machine.config AppFabric defines other tracking profiles Troubleshooting End to End Health Monitoring Errors Only Off
Event Tracing for Windows ETW General purpose, high speed, buffered tracing provided by OS Observe through Event Viewer Enable Diagnostic & Debug logs Configured with Tracking Profiles Volume and Source of events Track variable & argument values
AppFabric Monitoring Observe in IIS Manager Dashboard Tracked Events Tracked Events Query Editor AppFabric EventCollector receives ETW events & writes them to SQL database Configured with Tracking Profiles Level Manually edit config for variables / arguments Enable WCF Diagnostic Tracing & Message Logging (still write to svclog files)
AppFabric Tracking Configuration
Building Resilient Workflows Compensation - undo completed work Cancellation - graceful stop Unhandled Exception action:
Workflow Persistence AppFabric provides SqlWorkflowInstanceStore You can build own PersistenceProvider Controlled by host or by Persist activity in a workflow No-Persist Zones Enables efficient resource use and load balancing Host: AppFabric IIS exe Runtime Workflow Extensions Scheduler Persistence Provider Tracking Participant Custom Extension
Persistence Configuration
Versioning Workflow Services No support for updating workflow definitions One approach: Use WCF Routing Service Configure it to route to correct version of workflow service Client v1 Client v2 Router Service Orders XAMLX v1 Orders XAMLX v2
Routing Service Easy to configure routing implementation Routing and filtering based on predefined or custom heuristics Filter by action, address, header or body content Useful for: Content-based routing Versioning Partitioning ServiceA Client Routing Service Filter Tables Config Filters ServiceB
Workflow Services Running in AppFabric DEMO 3 - COMPOSING SERVICES
Composing Services Summary Easier Installation/Deployment Integrated logging with WCF Scale through shared persistence database Not just for long-running helps with Async and multi-threaded Focus on Business logic, not plumbing
CONNECTING ACROSS TRUST BOUNDARIES
Connecting Across Trust Boundaries Firewalls are difficult to change Different security domains/technologies Eventing/Callback is difficult Securely connect through firewalls Azure AppFabric.. Support WCF Relay Bindings Simplifies connectivity across security trust boundaries Supports Protocol tunneling Provides Elastic scale
Connecting Across Trust Boundaries - Takeaways Securely connect through firewalls Easy WCF Relay Bindings Simplifies connectivity across security trust boundaries Protocol tunneling Elastic scale
Windows Server AppFabric Management Tools IIS Manager Modules PowerShell Services Workflows Persistence Hosting Monitoring Caching Persistence Windows Server AppFabric IIS/WAS.NET Framework Runtime Databases Monitoring Windows Server
ROADMAP
Transforming the Data Center Benefits Investments
AppFabric Windows Server AppFabric Improves performance, availability, scale, and management of web and composite applications Faster web apps made easy Simplified composite applications Enterprise Performance and Availability Windows Azure AppFabric Enables secure federated application connectivity across on-premises and cloud Service Bus secure, cross firewall communications fabric Access Control claims based, federated authorization
Fidelity with On-Premise & Cloud
Workloads Faster web apps made easy Simplified composite applications Enterprise performance and availability Easily connect.net apps to LOB systems Productivity enhancements: Mapping, TPM management Updated Platform Support Cloud-based services that build on what you know Elastic scale use as much or as little as you need Secure, reliable connectivity with your existing apps
Summary Application Infrastructure can: Help you harness the benefits of the cloud today Both on premises and off premises Composite Apps are great, but there are challenges Windows Server AppFabric provides: Performance and scale through distributed cache Hosting for Services Support for Workflow Services Windows Azure AppFabric provides Connectivity through Firewalls Access Control across trust boundaries
Resources AppFabric Dev Center http://www.msdn.microsoft.com/appfabric WCF Dev Center http://www.msdn.microsoft.com/wcf WF Dev Center http://www.msdn.microsoft.com/wf
Building Composite Application Services with Windows Server AppFabric Rick G. Garibay @rickggaribay