Presentation is loading. Please wait.

Presentation is loading. Please wait.

Advanced Distributed Software Architectures and Technology group ADSaT 1 Microsoft Middleware Technology Paul Greenfield ADSaT CSIRO.

Similar presentations


Presentation on theme: "Advanced Distributed Software Architectures and Technology group ADSaT 1 Microsoft Middleware Technology Paul Greenfield ADSaT CSIRO."— Presentation transcript:

1 Advanced Distributed Software Architectures and Technology group ADSaT 1 Microsoft Middleware Technology Paul Greenfield ADSaT CSIRO

2 Advanced Distributed Software Architectures and Technology group ADSaT 2 COM, MTS & COM+ An evolving component technology –Components not objects –Designed for practical code re-use –COM for local components –DCOM for remote components –MTS for transactional components –COM+ integrating and extending MTS –ActiveX and OLE for adding confusion

3 Advanced Distributed Software Architectures and Technology group ADSaT 3 COM Just one Component Object Model Language-neutral, binary model –Use any language to write components VB, C++, Java, Delphi, C, Perl, … –Call from any language, inc. scripts Components are … –Reusable software building blocks –Defined, contracted, stable behaviour

4 Advanced Distributed Software Architectures and Technology group ADSaT 4 COM Interfaces Components implement interfaces –Interfaces define behaviour –Components have multiple interfaces –Clients only access interfaces Not objects and no access to internals –Interfaces are immutable Should be defined once and never changed Give stability in distributed systems –Polymorphism through interfaces No class inheritance in COM itself

5 Advanced Distributed Software Architectures and Technology group ADSaT 5 Component Example Kangaroo component class Supports Hopping and Eating behaviour Dim BigHopper as IHop Dim BigEater as IEat Set BigHopper = new CKangaroo Set BigEater = BigRed BigHopper.Hop “over log” BigEater.Graze “grass”

6 Advanced Distributed Software Architectures and Technology group ADSaT 6 COM Run-time COM objects can be in … –A library (DLL) ‘in-process server’ –A separate program ‘out-of-process’ Objects accessed through stubs and proxies

7 Advanced Distributed Software Architectures and Technology group ADSaT 7 Distributed COM Took COM into distributed computing –Exactly the same programming model –Components can be remote

8 Advanced Distributed Software Architectures and Technology group ADSaT 8 COM/DCOM Practicalities How does a client find a server? –Through the registry on the client Registry set up when client app installed –No ‘name server’ … until COM+ Are there really libraries of COM components that can be re-used? –Office, Visio, SAP, ActiveX controls, … Much additional flexibility –And subsequent (seeming) complexity…

9 Advanced Distributed Software Architectures and Technology group ADSaT 9 Building COM Code Good tool support –MS C++ with MFC/ATL, VB, J++, Delphi, … –Templates, wizards and run-times –Compilers know about components and their interfaces

10 Advanced Distributed Software Architectures and Technology group ADSaT 10 Moving from the Desktop Addressing the enterprise market –Challenging mainframes and UNIX –Addressing questions of availability, scalability, integrity, security –Keep ease of programming and admin Build enterprise apps in VB? Avoid need for complex tuning and admin Response was MTS –Brought transactions to COM

11 Advanced Distributed Software Architectures and Technology group ADSaT 11 MS Application Model Windows DNA –Three tier architecture –Client layer Web based using scripting (ASP) Traditional client applications –Business logic layer Transactional business components –Data access layer Components enforce data integrity

12 Advanced Distributed Software Architectures and Technology group ADSaT 12 Application Layers Order component Customer component Payment component Order component Goods component Stock component Delivery component MTSMTS DCOM/COMDCOM/COM Web server Scripted Web pages Business Logic Layer Data Access Layer Client Access Layer User interface app Print invoicesPrint ship requests Background processes

13 Advanced Distributed Software Architectures and Technology group ADSaT 13 MTS and Transactions MTS added transactions to COM –Simple programming model Write code as if it was all that was running on the system COM/MTS will ensure isolation Minimal coding changes needed –add commit/abort –Full ACID properties Using XA-compliant databases etc Full support for distributed transactions

14 Advanced Distributed Software Architectures and Technology group ADSaT 14 MTS Programming Encourages stateless programming –Methods are complete business transactions –Transaction starts when method called and ends when it returns –No state left on server after method returns, except in databases… Other models possible –Client controlled transactions –Stateful objects

15 Advanced Distributed Software Architectures and Technology group ADSaT 15 MTS and Server Objects MTS deletes server objects when transaction commits –Client still thinks it has a server object –Server object created anew if needed ‘Just-in-time activation’ Makes it impossible to keep state in server objects and so violate ACID properties –Reduces resource usage on server –Server objects recycled in COM+

16 Advanced Distributed Software Architectures and Technology group ADSaT 16 MTS Architecture Application ‘packages’ –Collection of libraries (DLLs) –Each package has its own server process Multiple threads within each process Failing application code isolated Can also run application code ‘in-line’ –Method calls run on threads No tuning parameters Low overhead No binding from client to thread

17 Advanced Distributed Software Architectures and Technology group ADSaT 17 MTS Architecture MTS Process Application Packages Clients

18 Advanced Distributed Software Architectures and Technology group ADSaT 18 MTS Administration

19 Advanced Distributed Software Architectures and Technology group ADSaT 19 MTS Security COM security based on NT security –ACLs on components, interfaces, … –Based on users and groups MTS has role-based security –Rights assigned to ‘roles’ ‘manager’, ‘clerk’, ‘teller’, … Access to interfaces, packages, … Separates security policy from admin –Roles assigned to users and groups

20 Advanced Distributed Software Architectures and Technology group ADSaT 20 MTS Performance Stateless transactional applications –Minimal server resources used Database connection pooling –ODBC and OLE DB Method calls run on any thread –Minimal waiting unlike some OTMs –No tuning or rebinding needed

21 Advanced Distributed Software Architectures and Technology group ADSaT 21 MTS Performance Stock on-line application –Both application and SQL/Server database running on Dell 2x 400MHz Pentium II with 512MB –Application coded in … C++ (ODBC), Visual Basic (ADO), J++ (ADO) –Two versions Using Keytable (heavy database locking) Using Identity (avoids contention on Keytable)

22 Advanced Distributed Software Architectures and Technology group ADSaT 22 C++ Sample STDMETHODIMP CStocks::UpdateAccount(long subAccNo, long sCredit) { HRESULT hr = S_OK; SubscriberAccount sub ; hr = sub.Update(subAccNo, sCredit) ; if (m_spObjectContext) if FAILED(hr) m_spObjectContext->SetAbort(); else m_spObjectContext->SetComplete(); return hr; }

23 Advanced Distributed Software Architectures and Technology group ADSaT 23 C++ Sample HRESULT SubscriberAccount::Update(long pAccNo, long pCredit) { HRESULT hr; SQLHENV henv= NULL; SQLHDBC hdbc= NULL; SQLHSTMT hstmt= NULL; hr = GetSQLHandles(henv, hdbc, hstmt); if (FAILED(hr)) return hr;// ODBC handle allocations failed RETCODE retCode; SDWORD cbNumLen = 0, cbNTS = SQL_NTS ; SQLCHAR stmt [MAX_STMT_LEN] ; sprintf ((CHAR *) stmt, "UPDATE SUBACCOUNT SET SUB_CREDIT = %ld WHERE SUB_ACCNO = %ld", pCredit, pAccNo ); retCode = SQLExecDirect ( hstmt, stmt, SQL_NTS ) ; if (retCode != SQL_SUCCESS && retCode != SQL_SUCCESS_WITH_INFO) return error("SubAccount Update", henv, hdbc, hstmt); ReleaseSQLHandles(henv, hdbc, hstmt); return S_OK; }

24 Advanced Distributed Software Architectures and Technology group ADSaT 24 VB Sample Public Sub update(pAccNo As Long, pCredit As Long) On Error GoTo ErrorHandler Dim conn As New ADODB.Connection Dim cmd As New ADODB.Command conn.Open DSNString Set cmd.ActiveConnection = conn cmd.CommandText = "update SubAccount set sub_credit=" & _ pCredit & " where sub_accno=" & pAccNo cmd.Execute conn.Close Set conn = Nothing GetObjectContext.SetComplete Exit Sub ErrorHandler:.... Err.Raise Err.Number,, Err.Description GetObjectContext.SetAbort End Sub

25 Advanced Distributed Software Architectures and Technology group ADSaT 25 MTS Performance

26 Advanced Distributed Software Architectures and Technology group ADSaT 26 MTS Performance How many clients can be supported? –2 second average response time –No wait time between requests –Application and database on same box VB Keytable 200 clients VB Identity 300 clients C++ Keytable 350 clients C++ Identity 500 clients

27 Advanced Distributed Software Architectures and Technology group ADSaT 27 MTS Response Times

28 Advanced Distributed Software Architectures and Technology group ADSaT 28 MTS Performance Performance limited by processor Run with remote database –Doubles available processor power –Needs 100M LAN Results for C++ and Identity –800 clients with 2 sec response time –430tps

29 Advanced Distributed Software Architectures and Technology group ADSaT 29 MTS Performance

30 Advanced Distributed Software Architectures and Technology group ADSaT 30 MTS Scalability Good up to the capacity of the box –$20,000 of hardware will support 800 concurrent clients – thousands of users But what if we want to support tens of thousands of very active users? –Bigger boxes – scale up Commodity 8x servers, Itanium, GHz chips Proprietary SMP boxes – Unisys, Sequent,.. –More boxes – scale out Share workload over many servers

31 Advanced Distributed Software Architectures and Technology group ADSaT 31 Scale Out Stateless, transactional applications –No binding between clients and servers –Transactions can go to any server Need load balancing support to share workload over available servers –Web server-based –Write-your-own –COM+ load balancing coming soon Moved to Windows 2000 Application Server

32 Advanced Distributed Software Architectures and Technology group ADSaT 32 Integration Integrating with non-COM/MTS code –COMTI for full integration with CICS servers –Support for CICS clients expected –Bridges between COM, CORBA, EJB, …

33 Advanced Distributed Software Architectures and Technology group ADSaT 33 Sample System

34 Advanced Distributed Software Architectures and Technology group ADSaT 34 COM+ The Windows 2000 version of COM –Features of MTS folded back into mainstream COM and extended –COM GUI administration tool –Asynchronous method calls –Load balancing –Publish-subscribe events –Compensating resource manager –Object pooling –Performance improvements

35 Advanced Distributed Software Architectures and Technology group ADSaT 35 COM+ Administration

36 Advanced Distributed Software Architectures and Technology group ADSaT 36 COM+ Features Asynchronous methods –Client can call method and continue –Method call turned in queued message –Uses MSMQ (Microsoft Message Queue) Compensating Resource Managers –Allow use of non-transactional resources within a transaction –Write code to back out changes Called if transaction aborts

37 Advanced Distributed Software Architectures and Technology group ADSaT 37 COM+ Features Publish/Subscribe –Event-based programming model –Publish events and subscribers notified Use of Windows 2000 features –Reduced use of registry –Use of Active directory to find servers –Use of standard Windows Installer

38 Advanced Distributed Software Architectures and Technology group ADSaT 38 COM+ Load Balancing Scale-out by spreading workload over multiple computer systems –Router knows what servers are available and how busy they are –Client calls router to find a server –Client gets component reference and calls methods as normal –Router only involved at component creation time no overhead on calls

39 Advanced Distributed Software Architectures and Technology group ADSaT 39 COM+ Component Load Balancing Client Response time tracker Router Create object Call object’s methods Pass request to server Create object and pass back reference COM + CLB balancing load across multiple systems

40 Advanced Distributed Software Architectures and Technology group ADSaT 40 COM+ Performance Object Pooling –Server-side objects are pooled and recycled on activation Lowers cost of object creation/activation Dynamic thread pool –Adjusts no. of server threads with load Faster but still evaluating how much –Good improvements so far –Tests hitting limits on database server Expect improvements with Win2K db server

41 Advanced Distributed Software Architectures and Technology group ADSaT 41 COM+ Performance

42 Advanced Distributed Software Architectures and Technology group ADSaT 42 COM+ Performance

43 Advanced Distributed Software Architectures and Technology group ADSaT 43 COM+ Performance

44 Advanced Distributed Software Architectures and Technology group ADSaT 44 COM+ Performance Ported application MTS -> COM+ –Reduced application processor usage –300tps, 600 users with local db –400tps, 800 users with remote db Object pooling –Pool objects rather than connections –400tps, 800 users with local db –450tps, 900 users with remote db

45 Advanced Distributed Software Architectures and Technology group ADSaT 45 TPCC Performance? TPCC figures for Windows 2000, COM+ and SQL/Server 2000 –Top 2 places on TPCC performance list 227,000 TPMC – 96 processors - $19/tpmc 152,000 TPMC – 64 processors - $19/tpmc ‘shared nothing’ partitioned database –Then UNIX boxes About 135,000 TPMC at $50 - $100+ /tpmc

46 Advanced Distributed Software Architectures and Technology group ADSaT 46 MTS and COM+ Microsoft’s transactional middleware –Good tool integration for ease of use C++, VB, Java – coding, debugging –Performance good and getting better –Very scalable for the right applications Scale-up limited compared to UNIX? Scale-out requires right architectures –Good value for money… Comes as part of NT and Windows 2000


Download ppt "Advanced Distributed Software Architectures and Technology group ADSaT 1 Microsoft Middleware Technology Paul Greenfield ADSaT CSIRO."

Similar presentations


Ads by Google