ITERATIVE DEVELOPMENT: THE USE OF J2EE BEST PRACTICES

Similar documents
TUTORIAL: WHITE PAPER. VERITAS Indepth for the J2EE Platform PERFORMANCE MANAGEMENT FOR J2EE APPLICATIONS

WHITE PAPER: ENTERPRISE AVAILABILITY. Introduction to Adaptive Instrumentation with Symantec Indepth for J2EE Application Performance Management

WHITE PAPER Application Performance Management. The Case for Adaptive Instrumentation in J2EE Environments

Enabling Performance & Stress Test throughout the Application Lifecycle

Implementing a Web Service p. 110 Implementing a Web Service Client p. 114 Summary p. 117 Introduction to Entity Beans p. 119 Persistence Concepts p.

Appendix A - Glossary(of OO software term s)

J2EE DIAGNOSING J2EE PERFORMANCE PROBLEMS THROUGHOUT THE APPLICATION LIFECYCLE

J2EE - Version: 25. Developing Enterprise Applications with J2EE Enterprise Technologies

Oracle 10g: Build J2EE Applications

A Practical Approach to Balancing Application Performance and Instrumentation Information Using Symantec i 3 for J2EE

Designing Data Protection Strategies for Oracle Databases

Borland Optimizeit Enterprise Suite 6

Designing Data Protection Strategies for Oracle Databases

Oracle WebLogic Server 11g: Administration Essentials

White Paper. Major Performance Tuning Considerations for Weblogic Server

Chapter 6 Enterprise Java Beans

In the most general sense, a server is a program that provides information

Web Application Development Using JEE, Enterprise JavaBeans and JPA

EJB ENTERPRISE JAVA BEANS INTRODUCTION TO ENTERPRISE JAVA BEANS, JAVA'S SERVER SIDE COMPONENT TECHNOLOGY. EJB Enterprise Java

Database code in PL-SQL PL-SQL was used for the database code. It is ready to use on any Oracle platform, running under Linux, Windows or Solaris.

J2EE: Best Practices for Application Development and Achieving High-Volume Throughput. Michael S Pallos, MBA Session: 3567, 4:30 pm August 11, 2003

Java- EE Web Application Development with Enterprise JavaBeans and Web Services

Using JNDI from J2EE components

IMPROVING THE PERFORMANCE, INTEGRITY, AND MANAGEABILITY OF PHYSICAL STORAGE IN DB2 DATABASES

NetBeans IDE Field Guide

Web Application Development Using JEE, Enterprise JavaBeans and JPA

Deccansoft Software Services. J2EE Syllabus

CO Java EE 7: Back-End Server Application Development

Introduction. Enterprise Java Instructor: Please introduce yourself Name Experience in Java Enterprise Edition Goals you hope to achieve

J2EE Development. Course Detail: Audience. Duration. Course Abstract. Course Objectives. Course Topics. Class Format.

IBM. Enterprise Application Development with IBM Web Sphere Studio, V5.0

Course Content for Java J2EE

Migrating a Business-Critical Application to Windows Azure

TOPLink for WebLogic. Whitepaper. The Challenge: The Solution:

Introduction to Web Application Development Using JEE, Frameworks, Web Services and AJAX

CocoBase Delivers TOP TEN Enterprise Persistence Features For JPA Development! CocoBase Pure POJO

PRIMIX SOLUTIONS. Core Labs. Tapestry : Java Web Components Whitepaper

Application Servers in E-Commerce Applications

Erik Dörnenburg JAOO 2003

ManageEngine Applications Manager 9. Product Features

ORACLE ENTERPRISE MANAGER 10g ORACLE DIAGNOSTICS PACK FOR NON-ORACLE MIDDLEWARE

APPLICATION PERFORMANCE MANAGEMENT VERITAS i 3 FOR SAP

Enterprise Java Unit 1- Chapter 3 Prof. Sujata Rizal Introduction to Servlets

WebLogic Server- Tips & Tricks for Troubleshooting Performance Issues. By: Abhay Kumar AST Corporation

IBM Operational Decision Manager Version 8 Release 5. Configuring Operational Decision Manager on WebLogic

Java EE 6: Develop Business Components with JMS & EJBs

Data Management in Application Servers. Dean Jacobs BEA Systems

Java EE 7: Back-End Server Application Development

Websphere Server 8.5 Best Practices Oracle FLEXCUBE Universal Banking Release [December] [2016]

COURSE DETAILS: CORE AND ADVANCE JAVA Core Java

Outline. Project Goal. Overview of J2EE. J2EE Architecture. J2EE Container. San H. Aung 26 September, 2003

IBM WebSphere Application Server V4.0. Performance. 10/02/01 Copyright 2001 IBM Corporation WS40ST11.prz Page 248 of of 28

BEAAquaLogic. Service Bus. Interoperability With EJB Transport

BENEFITS OF VERITAS INDEPTH FOR IBM S DB2 UNIVERSAL DATABASE WITHIN AN OPERATIONAL ENVIRONMENT

THIS IS ONLY SAMPLE RESUME - DO NOT COPY AND PASTE INTO YOUR RESUME. WE ARE NOT RESPONSIBLE Name: xxxxxx

WebSphere 4.0 General Introduction

index_ qxd 7/18/02 11:48 AM Page 259 Index

Java Without the Jitter

Rapid Bottleneck Identification A Better Way to do Load Testing. An Oracle White Paper June 2008

Oracle Application Development Framework Overview

GemStone Systems. GemStone. GemStone/J 4.0

Multi-tier architecture performance analysis. Papers covered

com Spring + Spring-MVC + Spring-Boot + Design Pattern + XML + JMS Hibernate + Struts + Web Services = 8000/-

Exam Questions 1Z0-895

Fast Track to EJB 3.0 and the JPA Using JBoss

MythoLogic: problems and their solutions in the evolution of a project

Rational Application Developer 7 Bootcamp

Work groups meeting 3

HYPERION SYSTEM 9 BI+ GETTING STARTED GUIDE APPLICATION BUILDER J2EE RELEASE 9.2

Oracle Fusion Middleware 11g: Build Applications with ADF I

SYMANTEC: SECURITY ADVISORY SERVICES. Symantec Security Advisory Services The World Leader in Information Security

Inside WebSphere Application Server

Borland Application Server Certification. Study Guide. Version 1.0 Copyright 2001 Borland Software Corporation. All Rights Reserved.

Building the Enterprise

Call: JSP Spring Hibernate Webservice Course Content:35-40hours Course Outline

Projects. How much new information can fit in your brain? Corporate Trainer s Profile TECHNOLOGIES

5 OAuth Essentials for API Access Control

Hands-on Lab Session 9909 Introduction to Application Performance Management: Monitoring. Timothy Burris, Cloud Adoption & Technical Enablement

Oracle Fusion Middleware

JavaEE Interview Prep

Vision of J2EE. Why J2EE? Need for. J2EE Suite. J2EE Based Distributed Application Architecture Overview. Umair Javed 1

Measuring VDI Fitness and User Experience Technical White Paper

VERITAS Storage Foundation 4.0 TM for Databases

Developing Java TM 2 Platform, Enterprise Edition (J2EE TM ) Compatible Applications Roles-based Training for Rapid Implementation

[Course Overview] After completing this module you are ready to: Develop Desktop applications, Networking & Multi-threaded programs in java.

Optimizing Tiered Storage Workloads with Precise for Storage Tiering

ITdumpsFree. Get free valid exam dumps and pass your exam test with confidence

Oracle Java SE Advanced for ISVs

S1 Informatic Engineering

The McAfee MOVE Platform and Virtual Desktop Infrastructure

BECOME A LOAD TESTING ROCK STAR

Enterprise JavaBeans. Layer:01. Overview

USING ISCSI AND VERITAS BACKUP EXEC 9.0 FOR WINDOWS SERVERS BENEFITS AND TEST CONFIGURATION

JVA-163. Enterprise JavaBeans

An Introduction to the Waratek Application Security Platform

J2EE Technologies. Industrial Training

DESIGN PATTERN - INTERVIEW QUESTIONS

Java EE Application Assembly & Deployment Packaging Applications, Java EE modules. Model View Controller (MVC)2 Architecture & Packaging EJB Module

Exam Actual. Higher Quality. Better Service! QUESTION & ANSWER

Sample Exam. Advanced Test Automation - Engineer

Transcription:

TUTORIAL: WHITE PAPER VERITAS Indepth for the J2EE Platform ITERATIVE DEVELOPMENT: THE USE OF J2EE BEST PRACTICES By Owen Taylor Of The Middleware Company 1

1. Overview... 3 2. Selecting Appropriate Tools... 3 2.1 Scope... 3 2.2 Non-Intrusiveness... 3 2.3 Ease of use... 3 2.4 Effectiveness... 3 3. Performance Related Best Practices... 4 3.1 Data-caching... 4 3.2 Session Façade... 5 3.3 Service-locator... 6 4. Identifying the Need for Best Practices... 7 4.1 In Development... 7 4.2 In Quality Assurance... 7 4.3 In Production... 7 5. Using VERITAS Indepth for the J2EE Platform... 8 5.1 Instrumenting the code... 8 5.2 Running SmarTune... 8 5.3 Drilling down... 8 5.4 Identifying the most prominent problem and getting advice... 9 5.5 Aligning the problems with the lack of Best Practices... 9 6. Conclusion...11 7. Appendix: VERITAS Indepth for J2EE In a Nutshell...11 2

1. OVERVIEW Selecting J2EE as a platform for development should increase the chances of success in the enterprise. Successful companies establish the use of best practices, patterns, and tools and spread the awareness of these amongst their J2EE programmers and architects. Successful developers share their knowledge and pass on their wisdom to others. The net result is improved productivity and the implementation of solid applications that are simple to use. The challenges we all face today are two-fold: Obtaining the skills (or those with them) to build effective enterprise systems Meeting market-driven time lines while maintaining quality in our implementations Experienced architects often make trade-offs to meet deadlines. These trade-offs include using re-factoring and other techniques to cut down development time and deal with the inherent (inherited) performance considerations. Application behavior is known to change from development to production and throughout the application lifecycle. As performance and stability issues are discovered, the application must be improved or abandoned. Making the most of these iterations (so that valuable time and money is not wasted) must be our goal. As a result, selecting the right tools and best practices is pivotal to successful application roll-outs. 2. SELECTING APPROPRIATE TOOLS 2.1 SCOPE Helpful tools provide analysis of the entire application. One such set of tools is provided by VERITAS Software, who offers a complete product line dedicated to providing Application Performance Management from the desktop, across the network, through the application server, to the database and the storage device. These products are powerful enough to grow with the companies business needs and provide a basis to achieve a true end-to-end application performance view and meet the evaluation criteria. 2.2 NON-INTRUSIVENESS Ideal tools provide accurate, useable data without altering: Source code Application performance The VERITAS Indepth for J2EE method chain instrumentation uses native "C" code for the most time-critical operations and is significantly lighter weight than Java-based instrumentation. When used correctly, the performance overhead associated with using VERITAS Indepth for J2EE is between 1% and 4%. 2.3 EASE OF USE The best tools are easy to learn and use VERITAS Indepth for J2EE utilizes a browser-based user interface facilitating ease of use, minimal training and ready access by any authorized user via their favorite browser. Important information is shared among multiple users simultaneously, or easily referenced by URL for later examination. 2.4 EFFECTIVENESS Powerful tools are those that empower users to make improvements VERITAS Indepth for J2EE provides SmarTune technology that pinpoints existing application weaknesses and provides reliable best practices suggestions for improving them. 3

3. PERFORMANCE RELATED BEST PRACTICES 3.1 DATA-CACHING Much of the interesting data in a system can remain unchanged for minutes, hours or even longer. When accessing interesting information of such a static nature, or in non-crucial use-cases wherein a client does not require real-time data, network traffic and database usage can be greatly reduced through the use of data caching. Figure 1 - No data caching. 9 invocations, 9 database hits The clients in Figure 1 are running in the same VM and therefore we are not seeing excessive network traffic, the amount of database hits however, is excessive. Figure 2 - Using Data-caching. 9 invocations, 4 database hits 4

3.2 SESSION FAÇADE Architects using EJB technologies discovered almost immediately that providing access to Entity Beans from the client layer presented multiple problems: Overabundance of network traffic and latency Awkward Security management Inefficient transactional behavior Limits in reusability Figure 3 - Clients accessing Entity Beans directly By interjecting a layer of indirection in the form of a Session Bean, these problems were easily solved (Figure 4): The Session Beans become responsible for determining user permissions providing greater flexibility and reuse Session Beans perform collections of calls to the Entity Beans on behalf of the remote clients: reducing network traffic Transactional scope can be applied to methods that call groupings of Entity Beans, thus reducing the transactional overhead Client code can be simplified due to more business logic being executed on the server 5

Figure 4 - Clients using Session Façade to access Entity Bean data 3.3 SERVICE-LOCATOR When accessing common services within J2EE such as JMS factories, DataSources, EJBHome objects, etc, the application will use the JNDI (Java Naming and Directory Interface) API. This will require the creation of an initial context object (the root of the naming service), followed by a lookup or search for the desired resource or service. This lookup (if successful) results in the transferring of that resources serializable representative to the interested party. Some major design problems become evident when the clients are co-located: Entire seconds can go by each time these operations are carried out Each interested client must be complicated by the inclusion of JNDI-API-specific code Unnecessary network traffic is added to the system Figure 5 - Clients accessing JNDI services directly The addition of a service-locator object or cache to our system can greatly increase responsiveness of the system as a whole when many co-located clients (Servlets for example) require the same services: 6

Figure 6 - Using the Service-locator to cache references to commonly accessed services 4. IDENTIFYING THE NEED FOR BEST PRACTICES 4.1 IN DEVELOPMENT The question should not be, "is there a best practice?" but rather, "will this best practice improve our application?" The three best practices described in this document are an excellent starting point. Caching of frequently used data and references will benefit any J2EE application however, determining what "frequently used" actually is, can be difficult in development. The use of the Session Façade is a requirement for successful EJB development, but decisions such as transactional behavior and scope still need to be made. By testing early releases of an application, developers can locate and correct inappropriate design decisions. VERITAS Indepth for J2EE offers a feature called SmarTune that will recommend the use of particular best practices once it has been directed to examine specific aspects of an applications' behavior, but it is not an early development tool: Its' value is apparent once the application can be run. 4.2 IN QUALITY ASSURANCE In Quality Assurance (QA) it is often assumed that best practices and appropriate patterns have already been applied. The QA team if different from the development team is unlikely to have the expertise to identify the need for best practices. The VERITAS product can offer invaluable assistance to those both familiar and unfamiliar with the application under scrutiny. If the application is deemed to perform poorly or fail it will be thrown back over the wall to the development team. VERITAS Indepth for J2EE is extremely useful in determining the application hotspots and suggesting the primary candidates for refactoring. Armed with real knowledge, the developers can confidently get to work and improve their applications. 4.3 IN PRODUCTION Applying new design patterns and best practices to a production system is more than difficult: both technically and politically. It can however, be essential to creating a mature and ultimately successful application. Interrupting service to clients in order to re-deploy a production application will commonly happen if the application fails or is unusable. What VERITAS enables is the uncommon ability to identify when performance is under-par and justify expending additional resources to re-factoring by specifying the nature of the problem. 7

5. USING VERITAS INDEPTH FOR THE J2EE PLATFORM 5.1 INSTRUMENTING THE CODE Before you can learn anything about your application from the VERITAS product you must instrument (see appendix) your code. This demands that you: 1. Install the VERITAS product (~30 minutes) 2. Alter the start script for the application server (~2 minutes) 5.2 RUNNING SMARTUNE This feature of the VERITAS Indepth product acts as an adviser to the user, applying rules to the gathered data and pointing out the most likely contributors to application slowdown. (SmarTune also offers general advice in how to increase the applications' performance.) To use SmarTune you: 1. Start VERITAS Indepth for J2EE 2. Run the application server and use/load-test the application 3. Open a web browser 4. View the Indepth GUI 5. Select the slice of sample data which holds the highest spike of activity and click the SmarTune link SmarTune takes a few seconds and then reveals information such as this: Figure 7 - SmarTune Discovers Problems The numbers 70.46 46.41 and 28.18 refer to the percentage of time taken by these method invocations within the 30 second period analyzed. 5.3 DRILLING DOWN In order to increase the applications performance, further analysis is necessary. The largest contributor is selected: "Click here to see the details!" and further information is shown: 8

Figure 8 - Drilling Down 5.4 IDENTIFYING THE MOST PROMINENT PROBLEM AND GETTING ADVICE Selecting the provided hyperlink associated with: shop.pricelistsessionbean_o8g3sf_eoimpl.getprice provides the user with more specific information regarding that method invocation and SmarTune's educated guess as to how to improve the application: Figure 9 - SmarTune Advice 5.5 ALIGNING THE PROBLEMS WITH THE LACK OF BEST PRACTICES In the application under scrutiny, two best practices are already in place: JNDI resources are being cached and reused, and a Session Façade is in place. During development, it was not believed that data caching was necessary and indeed the application behaved as expected. Under load, the application behavior changed and the "lightweight" call to the Stateless Session Bean to obtain the prices of items became expensive and overall application performance suffered. 9

SmarTune recommends applying the best practice of caching data in our application. Modifications are made so that the item list information is cached in memory in the web application layer after the first call to the Session Bean. Instantly, the user experience is improved as the application becomes more responsive. Running the same load test against the application reveals the following analysis of the same method at peak load by SmarTune: Figure 10 - After caching Optimization Through caching the data, the ratio of EJB/JSP calls has been reduced from 25 to 1 down to 5.7 to 1. Also, the average response time of the JSP has been cut to 25%. SmarTune goes on to suggest further tuning of the application, and encouragement is given to develop further ways of increasing responsiveness. Identifying the method getprice as long-lived encourages the developers to tune the transactional behavior of that method and further responsiveness is achieved. A load test is now performed in series against the original application and the optimized application, and the following graph is generated by VERITAS Indepth For J2EE: 10

Figure 11 - Before and after analysis of our application Notice the difference between the before and after in time spent during the jsp_servlet. viewitemlist._jspservice method. Attention can now shift to other areas of the application if user response time continues to be under-par. Those responsible for application performance can alternate between testing the application under load, using SmarTune to locate application hotspots, and applying the knowledge gained to improve the application. The iterative nature of J2EE development and the benefits reaped through refactoring (modifying code to improve its structure without adding function) is strongly supported, and becomes more effective. 6. CONCLUSION When developing complex distributed systems, there shall always be areas of optimization that are missed. Additionally, there will always be unexpected behavior on the part of the users, the network, and the supporting infrastructure. Recognizing the existence of these missing optimizations, or performance sinkholes, and identifying the paths to correcting them is of utmost importance throughout the lifecycle of an application. VERITAS Indepth for J2EE is a powerful tool in the hands of anyone seeking to locate and repair performance problems in J2EE applications. 7. APPENDIX: VERITAS INDEPTH FOR J2EE IN A NUTSHELL In 2002 VERITAS released version 2 of their J2EE Application Performance Management solution called, VERITAS Indepth for J2EE. Installation of this product involves several components that work together to store, access, and analyze performance data generated from a set of specified JVMs. The components include: VERITAS Indepth for J2EE performs its analysis by "Instrumenting the Java byte code" of your Application Server, the JDBC driver used, and your application. The Instrumentation is really a modification of the Byte code at run-time when it is loaded by the Virtual Machine. This modification enables the gathering of time stamps at the beginning and end of each method as well as the tracing of individual Threads of execution. This gathered data is sent to the Collector Agent (Currently implemented as a C++ component installed on the machine hosting the "Instrumented" VM). The Collector Agent then sends the information on to the Archive Agent that stores it in the VERITAS database. Upon the request of a user, the Analysis Agent obtains the data from the VERITAS database and uses it to create evaluations of the J2EE application's performance behavior and display it textually and graphically in a web browser. The data is gathered in discrete chunks and refreshed according to a configurable polling interval. 11

Figure 12 - A deployment of VERITAS Indepth for J2EE Apache Tomcat MYSQL A Java -based Indepth Admin tool A Java-based Archive Agent The Collector Agent The Analysis Agent Used to host the server-side logic for the web-browser-based User Interface Supplied Database used to persist the collected data (Can be changed to Oracle or other DB) Used to configure the Indepth product Used to aggregate and store data from all Collector Agents to the VERITAS Database (default MYSQL) Used to collect and transmit data from the VM to the Archive Agent Used to interpret the collected data 12

VERITAS Software Corporation Corporate Headquarters 350 Ellis Street Mountain View, CA 94043 650-527-8000 or 866-837-4827 For additional information about VERITAS Software, its products, or the location of an office near you, please call our corporate headquarters or visit our Web site at www.veritas.com. 13