1 / 38

EP117 Dividing the Tiers

EP117 Dividing the Tiers. Dmitry Chernizer Senior Enterprise Architect Ian Smart Senior Manager - Europe Enterprise Systems’ Group. Principle Authors: Dmitry Chernizer Ian Smart Contributing Authors: Jeff Ranstrom Phil Shaw Sethu Meenakshisundara Umesh Panchaksharaiah

afya
Download Presentation

EP117 Dividing the Tiers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EP117Dividing the Tiers • Dmitry Chernizer • Senior Enterprise Architect • Ian Smart • Senior Manager - Europe • Enterprise Systems’ Group

  2. Principle Authors: Dmitry Chernizer Ian Smart Contributing Authors: Jeff Ranstrom Phil Shaw Sethu Meenakshisundara Umesh Panchaksharaiah Srikanth Sampath Authors

  3. Different requirements Why Divide Tiers - Overall Performance Impact on Performance Scaleability Utilization ofSoftware Utilization ofHardware Functionality Resilience Redundancy

  4. Performance and Scaleability Why Divide Tiers - Reasons - 1 H y d r a w e b OpenSwitch EAServer EAServer OpenSwitch OpenSwitch EAServer EAServer OpenSwitch

  5. Response Time vs Throughput Java Java execution requires larger amounts of CPU to perform tasks than comparative executions in either ASE or compiled executables Work performed in ASE’s Java Virtual Machine is scheduled as a “normal” task and is therefore capable of sitting on an engine as long as any CPU-hogging query Why Divide Tiers - Reasons - 2

  6. Response Time vs Throughput (cont) Networks 3 Tier applications are still built on Client - Server at the end of the day Executing a class in ASE goes via the internal JDBC connection (doesn’t touch the network) Executing a method in EAServer may require a large amount of network traffic Why Divide Tiers - Reasons - 3

  7. Response Time vs Throughput (cont) Integration Direct access to data requires interpretation by the calling application and is synchronous While the user is waiting - so is the engine Direct calls to business functionality can be written to execute asynchronously Direct calls to business functionality can benefit from caching etc. . . . Why Divide Tiers - Reasons - 4

  8. Utilization of Hardware Both ASE and EAServer run in SMP mode e.g. ASE on NT vs EAS on SMP Unix host Always remember to plan for scaleability How can I add capacity next month, next week, next day, now or yesterday Why Divide Tiers - Reasons - 5

  9. Utilization of Software Integration of existing applications, data and DBMS’s Use of different operating systems e.g middle tier on UNIX and ASE or NT Always remember to plan for scaleability How can I add capacity next month, next week, next day, now or yesterday Why Divide Tiers - Reasons - 6

  10. Continuos Availability Why Divide Tiers - Reasons - 7 H y d r a w e b OpenSwitch EAServer EAServer OpenSwitch OpenSwitch EAServer EAServer OpenSwitch

  11. Resilience and Redundancy Customer requirement for removal of all single points of failure Many to many to many etc HA != CA Why Divide Tiers - Reasons - 8

  12. Functionality EAServer required for: EJB, JSP, Servlets, J2EE, Packaged App’s, etc ASE required for: Stored Procedures, CIS, etc Why Divide Tiers - Reasons - 9

  13. Example Architecture ContentManagement J V M J V M A.N.OtherPortal J V M J V M Tables Objects

  14. JVM in ASE: Extends ASE's T-SQL language capabilities with Java Use Java classes as: User defined functions User defined datatypes Java virtual machine embedded inside the server Java in Adaptive Server Enterprise Adaptive Server SQL PROCESSOR JDBCDriver Parse Normalise Java VM Compile User Classes Execute JNI DBSTORE System Classes ObjectStorage

  15. XML Distributed Transactions Business Logic Example Issues

  16. XML in Java is simplified by XML tools. In particular, XML parsers: Validate an XML document Handle character set issues, etc. Return a Java object (a tree) for the document Also used to build such a tree and generate a document XML in Java

  17. Many XML parsers are available Often with free license or public domain XML parsers use two standard interfaces SAX and DOM Applications using SAX & DOM Can be portable across XML parsers XML Parsers

  18. SAX: “Simple API for XML” An interface for parsing: Specifying input sources, character sets, etc. Invoking a parser. Specifying handlers to resolve external references (especially to DTDs). Events for different stages of parsing. XML in Java: The SAX Interface

  19. DOM: Document Object Model An interface for accessing an XML parse tree. A DOM object is the output of a SAX parse A Java representation of the XML tree Methods to reference & update subtrees, text, etc DOM is also used to build XML documents. The DOM Interface

  20. Basic challenge: Map between an XML document type and SQL. The XML document type: May already be fixed, e.g. by an industry group. Or, it may be something you design. The SQL database May already be fixed, e.g. an existing database. Or, it may be something you design for the XML. XML in SQL: Background Consideration

  21. Aim: Get XML into and out of SQL Element Storage Assemble/disassemble the XML. Individual XML elements into/from SQL columns. Document Storage Store complete XML document in an SQL column. Provide ways to reference & update elements. Hybrid Storage - Mixed Element/Document XML in SQL: Design Alternatives

  22. Element Storage Extracts the XML document into SQL rows & columns. Subsequently faster to reference/update Document Storage Stores the complete XML document in a single column Less processing on insert & retrieval Can still access/update elements (more slowly) Element & Document Storage: Tradeoffs

  23. Store the complete XML document in a column Also extract key elements into individual columns For faster access, indexing, etc i.e. balance & combine Element & Document storage Hybrid Storage

  24. Example Architecture ContentManagement J V M J V M A.N.OtherPortal J V M J V M Tables Objects

  25. The framework is defined primarily by three components Transaction Manager or Transaction Coordinator Application Client Resource Manager(S)/Dispenser(S) A conceptual framework where several Resource Managers participate in doing a unit of work (transaction) Transactional scope limits the failures occurring across execution domains Distributed Transaction Management Application Client (AP) NativeInterface TXInterface TransactionManager(TM) ResourceManager(RM) XAInterface

  26. Transaction boundaries are demarcated with API Transaction outcome and commitment policies are implemented within this framework XA and DTC are two models that are currently available in industrial strength Distributed Transaction Management

  27. DTC Microsoft’s protocol Use’s OLE-DB and is designed to be NT only Accessing ASE on UNIX supported by DTC/XA Requires ODBC Unless a wrapper is used, requires components written in C XA Specification owned by X/Open Group In EAServer implemented using JDBC In EAServer, unless a wrapper is used, requires components to be written in Java DTC vs XA in EAServer

  28. Multiple ASE’s - one transaction The transaction opposite, is submitted to S0 and is not specified as a distributed transaction. However, the outcome of the transaction in S1 and S2 is dependant upon the outcome in S0 Adaptive Server Transaction Coordinator S0 S1 S2 • begin traninsert into t1 values (12, 1.265)exec S1…proc1exec S2…proc2commit tran

  29. Adaptive Server Transaction Co-ordinator ASTC is the module in ASE responsible for implementing two phase commit protocol to co-ordinate remote ASE 12.0 participants of a transaction. ASTC uses an XA-like protocol (ASTC-H) - in future this will be mapped to XA commands in Direct Connect ASTC is also responsible for recovering distributed transactions in the event of any failure. ASTC

  30. Adaptive Server Transaction Co-ordinator Inter-server RPCs to an ASE 12.0 are transactional. DMLs on CIS objects are transactional as long as the real storage of the CIS object resides on an ASE 12.0. XA/DTC/SYB2PC transactions can be extended to any number of remote ASEs. Adaptive Server Transaction Co-ordinator

  31. Formatting Generating HTML Pages Complex Processing Processing not requiring database access Transactionality Stored Procedures N-tier does NOT invalidate good database design Databases are NOT commodities Business Logic ContentManagement J V M J V M

  32. Shared Repository Cluster Slave / Master Cluster Redundant Shared Repository Cluster Shared Nothing Cluster Sample Architecture Models

  33. Database Repository Sample ArchitecturesShared Repository Peer Cluster • Issues to consider: • Transactionality • If I am load balancing using networking software - how do I manage transactionality? • Performance • EAServer in cluster mode creates a background polling noise Component Sync User Credential Sync Load Balancing Application Server Engine Application Server Engine Application Server Engine Shared Persistent Store Failover

  34. Application Server Engine Application Server Engine Application Server Engine Database Repository Database Repository Database Repository Sample ArchitecturesSlave-Master (Cascading Directory) • Issues to consider: • Application Partioning • N Tier is now N+1 Tier - how is this to be managed • Results merging - how?? • Transactionality Cluster Parent Name Server Cluster Slave Name Server Cluster Slave Name Server

  35. Sample ArchitecturesRedundant (Dual Node) Shared Repository • Issues to consider: • Transactionality • How is the failover to be managed? • How is the transactionality to be managed in the event of failover? • Do I own the code to change it? Component Sync User Credential Sync Load Balancing Application Server Engine Application Server Engine Application Server Engine Redundant Persistent Store Failover Database Repository Database Repository

  36. Application Server Engine Application Server Engine Application Server Engine Database Repository Database Repository Database Repository Sample ArchitecturesShared Nothing Peer Cluster • Things to consider • Ease of application partitioning • Data synchronisation • “Islands of recovery” • How is partitioning to be defined? • Is there a need for a global view? • Is every database a single point of failure or a means of resilience? Component Sync User Credential Sync Load Balancing

  37. Design, design, design There are no right answers Just because it is a Portal does not mean that everything you learnt in kindergarten is no longer valid It is all about maximising what you have - that means understanding what that is Designing an N-Tier architecture could be viewed as: (P&T 101 - Performance vs Throughput)³ Summary

  38. EP117Dividing the Tiers • Dmitry Chernizer • Senior Enterprise Architect • Ian Smart • Senior Manager - Europe • Enterprise Systems’ Group

More Related