Building Windows ® DNA Applications Today Using Information Server (IIS), Microsoft ® Transaction Server (MTS), And Microsoft Messaging Queue (MSMQ) Joe.

Slides:



Advertisements
Similar presentations
Introduction to .NET Framework
Advertisements

Tahir Nawaz Introduction to.NET Framework. .NET – What Is It? Software platform Language neutral In other words:.NET is not a language (Runtime and a.
Netscape Application Server Application Server for Business-Critical Applications Presented By : Khalid Ahmed DS Fall 98.
IIS Technologies.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
Distributed components
Technical Architectures
1 Today: Introduction to ASP- Part 1 Explain the client/server architecture Explain Web-based client/server applications Understand the essentials of Active.
15 Chapter 15 Web Database Development Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
DATABASE APPLICATION DEVELOPMENT SAK 3408 The Web and DBMS.
AP 12/00 From Object-Oriented Programming to Component Software OO Languages: –Ada, Smalltalk, Java, C++ Class versus Object: –Express existence of objects.
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
Advanced Distributed Software Architectures and Technology group ADSaT 1 Application Architectures Ian Gorton, Paul Greenfield.
14 Chapter 14 Databases and The Internet Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Lecture The Client/Server Database Environment
Slide 1 of 9 Presenting 24x7 Scheduler The art of computer automation Press PageDown key or click to advance.
The Client/Server Database Environment
Client/Server Architectures
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Beyond DHTML So far we have seen and used: CGI programs (using Perl ) and SSI on server side Java Script, VB Script, CSS and DOM on client side. For some.
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
Databases and the Internet. Lecture Objectives Databases and the Internet Characteristics and Benefits of Internet Server-Side vs. Client-Side Special.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
3/8/00asp00 1 Active Server Pages from Microsoft Nancy McCracken Northeast Parallel Architectures Center at Syracuse.
Meir Botner David Ben-David. Project Goal Build a messenger that allows a customer to communicate with a service provider for a fee.
CIS 375—Web App Dev II Microsoft’s.NET. 2 Introduction to.NET Steve Ballmer (January 2000): Steve Ballmer "Delivering an Internet-based platform of Next.
IN PARTNERSHIP WITH Systems Advisers Group Axapta Overview Microsoft Business Solutions - Imran Ali.
Internet, intranet, and multimedia database processing l Database processing across local and wide area networks l Alternative architectures for distributing.
Integration Broker PeopleTools Integration Broker Steps –Introduction & terminologies –Application Server PUB/SUB services (Application Server)
M1G Introduction to Database Development 6. Building Applications.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
CS480 Computer Science Seminar Introduction to Microsoft Solutions Framework (MSF)
Tools for “ Webifying ” Databases Chet Seymour Melanie Rasmusson Scott Licht.
DEV-5: Introduction to WebSpeed ® Stephen Ferguson Sr. Training Program Manager.
Csi315csi315 Client/Server Models. Client/Server Environment LAN or WAN Server Data Berson, Fig 1.4, p.8 clients network.
Active Server Pages and Application Service Providers Architecture for 2000 and beyond Krishen Kota Denali Technologies
What is database?  Any Method for access info into Application from DataBase?  ODBC is standard for Accessing Data.  Problem with ODBC:  Information.
Distributed Transaction & Long-running transactions Rossen Zhivkov Freelance SharePoint Consultant January 19 th, 2008 Sofia, Bulgaria Krasimir Parushev.
Databases JDBC (Java Database Connectivity) –Thin clients – servlet,JavaServer Pages (JSP) –Thick clients – RMI to remote databases –most recommended way.
3-Tier Client/Server Internet Example. TIER 1 - User interface and navigation Labeled Tier 1 in the following graphic, this layer comprises the entire.
Distribution and components. 2 What is the problem? Enterprise computing is Large scale & complex: It supports large scale and complex organisations Spanning.
Building High Performance, Robust Server Applications with Internet Information Server 5.0 Van Van IIS - Program Manager Microsoft Corporation.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
Everything You Want To Know About Script But Were Afraid To Ask… Mark Carroll Drew Lytle Script Technologies Microsoft Corporation.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
7-1 Active Server and ADO Colorado Technical University IT420 Tim Peterson.
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
1 LM 6 Database Applications Dr. Lei Li. Learning Objectives Explain three components of a client-server system Describe differences between a 2-tiered.
E-commerce Architecture Ayşe Başar Bener. Client Server Architecture E-commerce is based on client/ server architecture –Client processes requesting service.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
Active Server Pages v.s. Java Server Pages Presenters: Lan Guo Qunying Fan Pei-Xun Wu Date:
Agenda for Today  DATABASE Definition What is DBMS? Types Of Database Most Popular Primary Database  SQL Definition What is SQL Server? Versions Of SQL.
ASP – Web Programming Class  Ravi Anand. ASP – Active Server Pages What is ASP? - Microsoft Technology - Can Run using IIS/PWS/Others - Helps us create.
The Object-Oriented Thought Process Chapter 13
Running a Forms Developer Application
Netscape Application Server
Distribution and components
Chapter 9 – RPCs, Messaging & EAI
PHP / MySQL Introduction
#01 Client/Server Computing
Web Development Using ASP .NET
#01 Client/Server Computing
Presentation transcript:

Building Windows ® DNA Applications Today Using Information Server (IIS), Microsoft ® Transaction Server (MTS), And Microsoft Messaging Queue (MSMQ) Joe Homnick And Shervin Shakibi

Agenda  What is a Windows DNA application?  Designing a three-tier architecture  Building business logic components  Incorporating transaction services  Using message queuing  Scalability and performance

Windows DNA Application  Scalable High performance/high availability High performance/high availability  Fault-tolerant Handle hardware and network failures Handle hardware and network failures  Extensible Modular design Modular design Integrates with existing back end Integrates with existing back end  “End-to-end” application solution

Internet Information Server, MTS, And MSMQ  Infrastructure services Scripting and component hosting Scripting and component hosting Transaction capabilities Transaction capabilities Asynchronous communication Asynchronous communication Security and administration Security and administration  Structured framework that allows the development of distributed applications using Web technology Inherently a three-tier architecture Inherently a three-tier architecture

Three-Tier Application  Presentation User interface User interface Simple data validation Simple data validation  Middle tier/business logic Business rules Business rules Consolidate data from multiple sources Consolidate data from multiple sources  Data services Data integrity rules Data integrity rules Not just RDBMS - , file system… Not just RDBMS - , file system…

Presentation Business logic Data services Internet Explorer Others Internet Information Server and ASP MTS DCOM SQL Server Oracle Microsoft Exchange MSMQ Components HTTP HTTP Three-Tier Web Architecture

Exploration Airlines Demonstration

How Do I Build A Windows DNA Application Today?

ExAir Ticket Submission  What happens when the user hits the “Finish” button? An Active Server Page (ASP) is called using a standard HTTP request, and is passed all of the relevant order information An Active Server Page (ASP) is called using a standard HTTP request, and is passed all of the relevant order information Business Logic is performed on the server; success or failure of the ticket ordering operation is determined Business Logic is performed on the server; success or failure of the ticket ordering operation is determined Appropriate HTML is returned to client Appropriate HTML is returned to client

Active Server Pages  ASP is server-side script embedded in html Invocation through standard HTTP requests results in no firewall problems Invocation through standard HTTP requests results in no firewall problems  Can target any browser on any platform ASP runs on the server -> returns HTML ASP runs on the server -> returns HTML  Multiple Scripting Languages Supported Visual Basic ® Scripting Edition, JScript ®, PERL, REXX, Python… Visual Basic ® Scripting Edition, JScript ®, PERL, REXX, Python…  Automatically supports use of “Session” and “Application” metaphors

ExAir Business Logic  ASP is the critical glue that binds the user interface on the browser with the business logic on the server  ASP alone does not provide the code modularity, maintainability, and scalability that business apps require  We recommend that ASP is used to call MTS-enabled COM components to perform business logic, then send back the appropriate HTML response

Business Logic With COM  Business Logic Components in COM can be written with a variety of languages Visual Basic, C++, Java ™, Cobol, Pascal Visual Basic, C++, Java ™, Cobol, Pascal  COM components provide: Encapsulation of internal details Encapsulation of internal details Modularity for code reuse Modularity for code reuse Intellectual Property Security Intellectual Property Security  Can be compiled and used from ASP Can be several times faster than ASP Can be several times faster than ASP

Building A COM Component Visual Basic Demo

ExAir Business Logic  How can we abstract the order processing elements of ExAir?  Two fundamental actions take place Order information must be updated in local ExAir Databases Order information must be updated in local ExAir Databases Remote subcontracting firm must be informed of passenger’s food selection Remote subcontracting firm must be informed of passenger’s food selection  We’ll write two COM Components

ExAir Business Logic  ExAir.Order Calculate price of ticket; decrement user’s balance in “Accounts” database table Calculate price of ticket; decrement user’s balance in “Accounts” database table Insert record into “Orders” table Insert record into “Orders” table Subtract available seats in “Flights” table Subtract available seats in “Flights” table  ExAir.Food Insert record into “FoodPref” table owned by ExAir’s food service subcontractor Insert record into “FoodPref” table owned by ExAir’s food service subcontractor

Public Sub BookFood( ByVal OrderID As Long, ByVal FlightID As String, ByVal FoodPref As String ) ‘ In the event of an error, jump to error handler On Error GoTo ErrorHandler Dim adoConn As New ADODB.Connection Dim adoCmd As New ADODB.Command ‘ Open ADO Database Connection adoConn.Open (”ExAirFoodContractor") adoCmd.ActiveConnection = adoConn ExAir.Food

adoCmd.CommandText = "INSERT into FoodPref (OrderID, FlightID, FoodType) Values (OrderID, FlightID, FoodPref)” FlightID, FoodType) Values (OrderID, FlightID, FoodPref)” ‘ Execute SQL Command adoCmd.Execute Exit Sub ErrorHandler: Err.Raise Number:=911, Source:=”ExAir.Food", Description:=Err.Description Err.Raise Number:=911, Source:=”ExAir.Food", Description:=Err.Description End Sub ExAir.Food

<% var objOrder = Server.CreateObject(“ExAir.Order”); var objFood = Server.CreateObject(“ExAir.Food”); orderID = objOrder.BookFlight( Session(“USER”), Request.QueryString(“Flight”), Request.QueryString(“Flight”), Request.QueryString(“Num”), Request.QueryString(“Num”), Request.QueryString(“Class”) ); Request.QueryString(“Class”) ); objFood.BookFood( orderID, Request.QueryString(“Flight”), Request.QueryString(“FoodPref”) ); Request.QueryString(“FoodPref”) );%> ExAir Submit.asp

Transaction Services  There is a major problem with our application - what if there is a failure?  How do we coordinate updates across multiple data sources from multiple vendors? How do we roll back changes?  How do we resolve concurrency, deadlock, and atomicity between multiple clients and servers?

Accounts Orders Flights Food preference ExAir.Order ExAir.Food Submit.asp Non-Transacted Order

Accounts Orders Flights Food preference ExAir.Order ExAir.Food Submit.asp Non-Transacted Order

Accounts Orders Flights Food preference ExAir.Order ExAir.Food Submit.asp Non-Transacted Order

Accounts Orders Flights Food preference ExAir.Order ExAir.Food Submit.asp Non-Transacted Order

Accounts Orders Flights Food preference ExAir.Order ExAir.Food Submit.asp Non-Transacted Order

Accounts Orders Flights Food preference ExAir.Order ExAir.Food Submit.asp System failure! Non-Transacted Order

Accounts Orders Flights Food preference ExAir.Order ExAir.Food Submit.asp Non-Transacted Order

Transaction Services  MTS provides required infrastructure Units of work --> single atomic entity Units of work --> single atomic entity All work commits or all work rolls back All work commits or all work rolls back  Two-phase commit with remote servers SQL Server ™, Oracle, DB2, Informix, MSMQ SQL Server ™, Oracle, DB2, Informix, MSMQ  Built into Internet Information Server 4.0 with Transacted ASP Link between the Web and MTS Link between the Web and MTS

Accounts Orders Flights Food preference ExAir.Order ExAir.Food Submit.asp Transacted Order

Accounts Orders Flights Food preference ExAir.Order ExAir.Food Submit.asp TX Transacted Order

Accounts Orders Flights Food preference ExAir.Order ExAir.Food Submit.asp TX Transacted Order

Accounts Orders Flights Food preference ExAir.Order ExAir.Food Submit.asp TX Transacted Order

Accounts Orders Flights Food preference ExAir.Order ExAir.Food Submit.asp TX Transacted Order

Accounts Orders Flights Food preference ExAir.Order ExAir.Food Submit.asp TX Transacted Order

Accounts Orders Flights Food preference ExAir.Order ExAir.Food Submit.asp System failure! TX Transacted Order

Accounts Orders Flights Food preference ExAir.Order ExAir.Food Submit.asp TX Transacted Order

Accounts Orders Flights Food preference ExAir.Order ExAir.Food Submit.asp TX Transacted Order

Accounts Orders Flights Food preference ExAir.Order ExAir.Food Submit.asp Transacted Order

On Error GoTo ErrorHandler Dim adoConn As New ADODB.Connection Dim adoCmd As New ADODB.Command Dim ctxObjectAs ObjectContext Set ctxObject = GetObjectContext adoConn.Open (" ExAirFoodContractor ") adoCmd.ActiveConnection = adoConn adoCmd.CommandText = "INSERT into FoodPref (OrderID, FlightID, FoodType) Values (OrderID, FlightID, FoodPref)” ExAir.Food (Transacted)

' Execute SQL Command adoCmd.Execute ' If everything worked, mark as successful and exit ctxObject.SetComplete Exit Sub ErrorHandler: ‘ If failure, abort transaction ‘ If failure, abort transaction ctxObject.SetAbort ctxObject.SetAbort Err.Raise Number:=911, Source:="ExAir.Food", Description:=Err.Description Err.Raise Number:=911, Source:="ExAir.Food", Description:=Err.Description ExAir.Food (Transacted)

<% var objOrder = Server.CreateObject(“ExAir.Order”); var objFood = Server.CreateObject(“ExAir.Food”); orderID = objOrder.BookFlight( Session(“USER”), Request.QueryString(“Flight”), Request.QueryString(“Flight”), Request.QueryString(“Num”), Request.QueryString(“Num”), Request.QueryString(“Class”) ); Request.QueryString(“Class”) ); objFood.BookFood ( orderID, Request.QueryString(“Flight”), Request.QueryString(“FoodPref”) ); Request.QueryString(“FoodPref”) );%> Submit.asp (Transacted)

<% // If the Transaction Committed, ASP will call this Event Handler function OnTransactionCommit() {Response.Clear();Response.Redirect(“Success.asp”);} // If the Transaction Aborted, ASP will call this Event Handler function OnTransactionAbort() {Response.Clear();Response.Redirect(“Failure.asp”);}%> Submit.asp (Transacted)

Message Queuing  Notifying the remote food subcontractor is currently done using a database insert  This causes several problems Network failures will cause order abort Network failures will cause order abort Latency will kill scalability Latency will kill scalability  Does the subcontractor notification have to be synchronous? What about the transaction model? What about the transaction model? How can we guarantee that the food contractor will eventually be notified? How can we guarantee that the food contractor will eventually be notified?

Message Queuing  Applications are not directly connected Communicate through queued messages Communicate through queued messages  Reliable queues survive application, system, and network failures Messages will queue until network connectivity is restored Messages will queue until network connectivity is restored  MSMQ can participate in MTS transactions MSMQ will guarantee that a message will be delivered (once and only once) when a transaction commits MSMQ will guarantee that a message will be delivered (once and only once) when a transaction commits

Message Queuing  Ideal for “time-independent” work Eliminates “resource shortage” errors Eliminates “resource shortage” errors An alternative to long-lock hold times An alternative to long-lock hold times  Synchronous versus Deferred Integrity Business policy needs to determine how workflow progresses Business policy needs to determine how workflow progresses  What about deferred problems? Requires application-level undo of a prior committed transaction Requires application-level undo of a prior committed transaction Consider how banks handle bad checks Consider how banks handle bad checks

Remote SQL MSMQ Food app Browser Internet Information Server and ASP MTS SQL Server MSMQ Components Exploration Airlines

Browser SQL Server MSMQ Internet Information Server and ASP MTS Components Remote SQL MSMQ Food app

Browser SQL Server MSMQ Internet Information Server and ASP TX 1 MTS Components Remote SQL MSMQ Food app Exploration Airlines

Browser SQL Server MSMQ Internet Information Server and ASP TX 1 MTS Components Remote SQL MSMQ Food app

Exploration Airlines Browser SQL Server MSMQ Internet Information Server and ASP TX 1 MTS Components Remote SQL MSMQ Food app

Exploration Airlines Browser SQL Server MSMQ Internet Information Server and ASP TX 1 MTS Components Remote SQL MSMQ Food app

Exploration Airlines Browser SQL Server MSMQ Internet Information Server and ASP TX 1 MTS Components Remote SQL MSMQ Food app

Exploration Airlines Browser SQL Server MSMQ Internet Information Server and ASP MTS Components Remote SQL MSMQ Food app

Exploration Airlines Browser SQL Server MSMQ Internet Information Server and ASP MTS Components Remote SQL MSMQ Food app

Exploration Airlines Browser SQL Server MSMQ Internet Information Server and ASP MTS Components Remote SQL MSMQ Food app

Exploration Airlines Browser SQL Server MSMQ Internet Information Server and ASP MTS Components Remote SQL MSMQ Food app TX 2

Exploration Airlines Browser SQL Server MSMQ Internet Information Server and ASP MTS Components Remote SQL MSMQ Food app TX 2

Exploration Airlines Browser SQL Server MSMQ Internet Information Server and ASP MTS Components Remote SQL MSMQ Food app TX 2

Exploration Airlines Browser SQL Server MSMQ Internet Information Server and ASP TX 2 MTS Components Remote SQL MSMQ Food app

Exploration Airlines Browser SQL Server MSMQ Internet Information Server and ASP MTS Components Remote SQL MSMQ Food app

Exploration Airlines Browser SQL Server MSMQ Internet Information Server and ASP MTS Components Remote SQL MSMQ Food app

On Error GoTo ErrorHandler Dim infoSnd As New MSMQQueueInfo Dim infoRespAs New MSMQQueueInfo Dim queryAs New MSMQQuery Dim Msg As New MSMQMessage Dim qSend As MSMQQueue Dim ctxObject As ObjectContext Set ctxObject = GetObjectContext ‘ Open Destination Queue (* using explicit queue name) qinfoSend.PathName = ”FoodContractor\ExAirFoodPref" Set qSend = infoSnd.Open (MQ_SEND_ACCESS, MQ_DENY_NONE) ExAir.Food (MSMQ)

' Construct Message Msg.Label = “ExAir Food Order” Msg.Body = Str(OrderID) & ”;" & FlightID & “;” & FoodPref ‘ Set Encryption Msg.PrivLevel = MQMSG_PRIV_LEVEL_BODY ‘ Use Lookup Response Queue (* using DS instead of explicit name) Set qInfos = query.LookupQueue(Label := “Food Response”) qInfos.Reset Set infoResp = qInfos.Next ‘ Identify App Specific Response Queue Set Msg.ResponseQueueInfo = infoResp ExAir.Food (MSMQ)

‘ Send Message to Remote Queue Msg.Send qSend, MQ_MTS_TRANSACTION ‘ Close queue qSend.Close ‘ If everything succeeded, mark as successful and exit ctxObject.SetComplete Exit Sub ErrorHandler: ‘ If error occurred, abort transaction ctxObject.SetAbort ExAir.Food (MSMQ)

Exploration Airlines Using MSMQ

How Do We Know It Scales?  Don’t wait until deployment to worry about scalability - by then it maybe too late!  Stress test during development WebCat - utility on the Internet Information Server resource kit WebCat - utility on the Internet Information Server resource kit WebLoad - very good third party utility WebLoad - very good third party utility  A Web application’s scalability is bounded by its weakest link Stress, examine, optimize…then repeat Stress, examine, optimize…then repeat

Call To Action  Install the Windows NT ® 4.0 Option Pack Start building simple components in the language of your choosing Start building simple components in the language of your choosing  Begin a pilot Windows DNA application  Write killer DNA application