* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Designing Distributed Object Systems
Survey
Document related concepts
Transcript
Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney Who is CMIS? • CSIRO is Australia’s largest scientific R&D organisation and has around 7000 staff • CSIRO Mathematical and Information Sciences is – Australia’s premier group of mathematicians and Information Technology specialists working to improve performance in Australian industry. ADSaT • 11 person R&D group, Sydney and Canberra • Involved in software engineering R&D • Specifically looking at the problems of distributed systems, eg • architecture, components, technologies • testing and analysis • performance, scalability, reliability Architecture Issues Physical constraints Transactions Security Management Fault Tolerance Solution Space Performance Requirements/Scalability Technologies, Components Testing Trade-offs between competing forces can be extremely complex ADSaT capabilities • Designing software architectures • Expertise in enterprise distributed technologies (eg COM, ORBs, DCE, Java), transactions, databases • Research based around software architectures • In-depth knowledge of Internet and ecommerce issues Week1 Distributed Systems Technology Overview Acronym frenzy!! What is Middleware? Software plumbing and associated services for building distributed systems Basic distributed systems blocks • Provides high(ish) level The Next Big Thing?? facilities (RPC, RMI) for Component building distributed system Technologies communication CORBA/RMI/COM infrastructures • Hides low level issues TCP/IP from the programmer through abstraction Network/OS Associated Services Messaging Directory Transactions Security • Basic middleware add-ons • Fulfill common application needs in distributed systems • See CORBA Services spec for an example and comprehensive list Middleware Plumbing Middleware Technologies • • • • • CORBA COM Java DCE Proprietary, ie – Forte, Tuxedo, CICS, etc.. – TIBCO, MQ, etc.. So What is it Good For? • Geek answer… • Middleware makes it feasible ‘for mere mortals’ to build distributed software systems that are: – high-performance, scalable – reliable, high availability • Don’t be fooled. Distributed systems are inherently difficult to build. Er..try me again? • The bottom line answer... • Businesses need a WWW presence • secure, transactional accesses to business systems • Integration • mergers, acquisitions, virtual enterprises • Internet competition and time-to-market Some Gartner Survey Figures • To develop a currently competetive ecommerce site: • 5 months average duration (some 1 year+) • uses more than 1 consulting organization • cost average US$1 million (~$350K-$2m+) • 79% costs were labor, 10% s/w • No enterprise WWW site was ‘on budget’ Gartner Group Predictions • • • • Simple site - $300k-$1 million Competetive site - $1-5 million Market leader - $5-20 million Site costs will increase 25% annually in next few years Solving Business Problems with Middleware • • • • • Legacy system access Data integrity Scalability Availability Client access Legacy System Access • Ease legacy system integration by providing standard interfaces (wrappers) • Hides details of legacy systems from clients AS400 MQ Server CICS\VSAM CICS Gateway Server Middleware Wrappers Clients Clients Data Integrity Oracle • Ensuring data integrity with distributed TP Service databases requires SQL transactions Server • Transactions ensure ACID properties Clients SQL Server ODBC Server Clients Scalability • Middleware supports scaling system performance by service replication • This isn’t free - it requires good architecture! Server Clients Server Clients Availability • Replication enhances fault tolerance and improves availability • Graceful degradation,Server lower performance but it keeps running Clients Server Clients Client Access • Client access enhanced due to: – physical distribution – variety of access technologies (ie Internet protocols, IIOP, COM) and available bridges. Clients HTTP Server IIOP Clients WWW IIOP Server COM Bridge Clients Enterprise Middleware Products • Some terminology first: • Middleware - basic products • Orbix, Visibroker, DCE, Java RMI, COM • Object Transaction Monitor (OTM) • middleware plus enterprise systems capabilities, OrbixOTM, BEA WebLogic • Application Server • cynical answer - new name for OTMs with Java 2 Enterprise Edition support :-} N-Tier System Architecture Client layer (browser, applets, apps) http, IIOP, COM, RMI, XML WWW server (WWW server, JSPs, ASPs) IIOP, COM, RMI, XML Business Logic (CORBA objects, EJBs, COM+) SQL, ODBC, JDBC, XA Data Access (DBMSs) Standards (wot standards?) • CORBA - OMG • Java 2 Enterprise Edition (EJB+JMS+JNDI+…) - Sun • COM+ - Microsoft • MQ Series - IBM • TIBCO multicast protocol.. • ??? CORBA • OMG is vendor consortium • CORBA Interface Definition Language (IDL) • Internet Inter-ORB Protocol (IIOP) (GIOP over TCP/IP) • CORBA services, eg transactions, naming, events, security Java • Remote Method Invocation (RMI) • Sun’s JRMP or RMI-over-IIOP • Enterprise Java Beans (EJBs) • Java Transaction Service (JTS) • Java mapping to CORBA OTS • Java Naming and Directory Interface (JNDI) • Java Messaging Service (JMS) EJBs • EJBs are server-side components • Separate business logic from infrastructure code EJB EJB EJB Container EJB EJBs • EJBs capture design patterns: • Stateless Session Bean • Stateful Session Bean • Entity Bean (bean or container managed) • Containers/EJB Servers provide: • • • • transaction policies security policies database connection pooling multi-threading Transaction Service • Essential for distributed transaction processing • Manages consistent updates to multiple databases • CORBA OTS, Java JTS, M’soft MTS • X/Open DTP standards - XA ACID properties • A set of operations that have ACID properties: – – – – Atomic Consistent Isolated Durable • Classic example - a bank account transfer Java Transaction Example try { // Create a transaction. transaction.begin(); // Invoke operations in transaction savingsAccount.makeWithdrawal(50) chequeAccount.makeDeposit(50); // Commit the transaction. transaction.commit(true); } catch (APP_ERROR ex) { transaction.rollback() } catch (TRANSACTION_ROLLEDBACK ex) { // handle rollback } Two-Phase Commit Application Program commit Transaction Manager Prepare to commit Acknowledge Response (commit of abort) commit or abort Resource Manager (RM) X/Open Distributed TP Reference Model Application Program TX Transaction Manager XA Resource Manager (RM) TxRPC XATMI CPI-C XA+ Communications Resource Manager(CRM) XA Interface details • Database must implement an XA library compatible with transaction service product • • • • embedded SQL ODBC/DTC for SQL Server OCI for Oracle ??? Others... • JDBC-2 incorporates XA support • No XA - no distributed transactions Directory Service • Clients need to get references to server objects • Server objects advertise their reference in a directory service • Clients query the directory service to retrieve desired reference • CORBA Naming service, JNDI, LDAP Example Name Space Bank Loans Stocks Accounts BusLoan NewStock Service QueryStock HomeLoan AccountService Security • Provide: • user authentication • user/service authorization • encryption • Secure Socket Layer (SSL) • public key infrastructure • asymmetric private and public keys • X.509 digital certificates Messaging • Many apps require asynchronous communications • • • • • CORBA event/notifcation/messaging service Java Messaging Service TIBCO/Rendezvous MQ Series others… • More on these later... WWW Server Tier • Need to accept HTML requests via HTTP post or get • CGI scripts first used to add processing capability: • spawn new process for each request • slow, doesn’t scale • Proprietary improvents • Netscape’s NSAPI, Microsoft’s ISAPI Java Servlets/Server Pages • Java platforms includes specs for: • servlets • Java Server Pages (JSPs) • Java servlets launched by WWW Server in response to URL request • JSP’s allow code (eg Java beans) for formatting dynamic content to be embedded in HTML page Java Servlets/Server Pages invoke URL JSP WWW Server HTML query html results invoke Servlet html query results App. Server Component Extensible Markup Language (XML) • Subset of SGML • Standard textual format for structured documents • Document Type Definition (DTD) defines document structure with tags for each entry in the document • XML document instance contains both tags and document data • Text format is easy to process Sample DTD <?xml encoding="US-ASCII"?> <!ELEMENT orders (order)*> <!ELEMENT order (header,item+,total)> <!ELEMENT header (billing_info,shipping_info)> <!ELEMENT billing_info (name,address,credit_card)> <!ELEMENT shipping_info (name,address)> <!ELEMENT name (given,family)> <!ELEMENT address (street,city,state,zipcode,country,phone)> <!ELEMENT item (product_id,product_name,quantity,price)> <!ELEMENT credit_card (#PCDATA)> <!ELEMENT given (#PCDATA)> <!ELEMENT family (#PCDATA)> […ELEMENTS MISSING…..] <!ELEMENT product_id (#PCDATA)> <!ELEMENT product_name (#PCDATA)> <!ELEMENT quantity (#PCDATA)> <!ELEMENT price (#PCDATA)> <!ELEMENT total (#PCDATA)> Sample (Incomplete) XML Document <?xml version="1.0"?> <!DOCTYPE orders SYSTEM "orders.dtd"> <orders> <order> <header> <billing_info> <name> <given>John</given> <family>Doe</family> </name> <address> <street>555 Main Street</street> <city>Mill Valley</city> <state>California</state> <zipcode>94520</zipcode> <country>USA</country> <phone>707 555-1000</phone> </address> Extensible Style Language (XSL) • XML ignores presentation of data • XSL stylesheets define presentation of XML doc in some format XML Doc XSL Compiler in browser or WWW server HTML, PDF, etc... XML/XSL Impact • Major vendor support/momentum • Presentation • Decoupling content/presentation is good! • Presentation is the browser’s job • Data interchange • business-to-business e-commerce • DOM API - XML parsers produce a DOM representation of an XML document • Microsoft’s SOAP Summary • Distributed object system technology is a key part of building enterprise distributed systems • There’s a lot of : • design issues • technology issues • plain hard issues (ie testing) • This course is just the ‘entrée’...