Online Sample Chapter
Scalable and High-Performance Web Applications
Downloadable Sample Chapter
Click below for Sample Chapter related to this title:
barishch01.pdf
Table of Contents
Preface.
1. Scalable and High-Performance Web Applications.
The Emergence of Web Applications.
Some Basic Definitions.
The Nature of the Web and Its Challenges.
Performance and Scalability.
Performance.
Scalability.
The Internet Medium.
Wide Audience.
Interactive.
Dynamic.
Always On.
Integrated.
Lack of Complete Control.
Measuring Performance and Scalability.
Measuring Performance Other Types of Measurements.
Measuring Scalability.
Throughput and Price/Performance.
Scalability and Performance Hints.
Think End-to-End.
Scalability Does Not Equal Performance.
Measure Scalability by Comparison.
Summary.
2. Web Application Architecture. Web Application Terminology.
Application Requirements.
Business Logic Requirements.
Data Management Requirements.
Interface Requirements.
Web Requirements.
Network Connectivity Requirements.
Abstract Web Application Architecture.
From Client to Server: Thin-Clients and Fat-Clients.
Persistent Data Management.
N-tier Application Architecture.
The Client.
The Network.
The Server.
Tier-Based Designs.
Challenge: Efficient Middleware.
Scalability and Performance Hints.
Don't Always Starve Thin Clients.
Use or Build Multithreaded Application Servers.
Find the Right Granularity.
Summary.
3. The J2EE Specification. An Overview of the Specification.
Deployment Issues.
Packaging.
Deployment Descriptor Files.
Platform Technologies and Services.
Component Communication via the RMI-IIOP Protocol.
Transaction Management Using the Java Transaction API.
JNDI for Resource Location.
J2EE and Your Architecture.
Summary.
4. General Scalability and Performance Techniques. Caching/Replication.
Parallelism.
Redundancy.
Asynchrony.
Resource Pooling.
Summary.
5. HTTP Client/Server Communication. The HTTP Protocol.
Deployment Paradigms.
Applications with Browsers as Clients.
Applications without Browsers as Clients.
Efficiency of the HTTP Protocol.
HTTP Protocol Details.
Detailed Protocol Semantics.
HTTP Requests.
The GET Method.
The POST Method.
HTTP 1.1 Caching Details.
Connection Management.
Performance and Scalability Hints.
Use HTTP GET and POST Judiciously.
Consider Using HTTP for Non-Browser Clients.
Promote HTTP Response Caching.
Support Persistent Connections.
Summary.
6. Request Processing: Concepts and Strategies. The General Problem.
Specific Challenges.
Connection Management.
Data Marshalling.
Request Servicing.
Modes of Request Processing.
Synchronous.
Asynchronous Communication.
Scalability and Performance Implications.
The Role of J2EE in Request Processing.
Web Serving.
Synchronous Processing with Java Servlets and Java Server Pages.
Asynchronous Processing with the Java Message Service.
Scalability and Performance Hints.
Prefer Asynchronous Communication.
Stream Data between Threads.
Develop Remote Methods That Encourage Efficiency.
Summary.
7. Session Management with Java Servlets. Generating Dynamic Responses.
Common Gateway Interface.
Extending the Web Server through Its API.
Redirecting the Web Server Request.
Using Servlets.
Servlets and Servlet Containers.
Interacting with a Servlet.
Web Server and Servlet Container Integration Details.
Developing Servlets.
Designing the Servlet Interface.
Coding the Servlet.
Servlet Execution.
How a Servlet Container Works.
Servlets and Multithreading.
Servlets and Session Management.
What Is Session Management?
Session Identification.
Using HTTP User Authentication.
Using Hidden Form Fields.
Using Rewritten URLs.
Using HTTP Persistent Cookies.
Using the Java Servlet Session Tracking API.
Deploying Servlets.
Session Management with Multiple Containers.
Developing Servlets with Java Server Pages.
Sample JSP Page.
The Structure of a JSP Page.
How JSP Works.
JSP Directives.
So, what is JSP... really?
Performance and Scalability Hints.
Prefer Fine-Grain Serialization.
Prefer Hardware-Based Load Balancing.
Use Servlets for Session Management, not Business Logic.
Think Twice about Using JSP.
Summary.
8. Building Application Servers with Enterprise Java Beans. The Need for Application Servers.
Application Logic and Where to Deploy It.
Enterprise Java Beans: The J2EE Solution.
How EJBs Work.
Types of EJBs.
Example Application.
EJB Design.
Session Beans.
Entity Beans.
Message-Driven Beans.
EJB Implementation.
Bean Development Responsibilities.
Session Beans.
Entity Beans.
Message-Driven Beans.
Client/EJB Integration.
Client/EJB Communication: Behind the Scenes.
Performance and Scalability Hints.
Prefer Message-Driven Beans over Session Beans.
When You Use Session Beans, Use Stateless Session Beans.
Strive for Coarse-Grain EJB Methods.
Use BMP Well or Don't Use It at All.
Know Your Vendor.
Summary.
9. Messaging for Efficient Enterprise Application Integration. A B2B-Style Working Example.
The Java Message Service.
JMS Concepts.
Providers.
Clients.
Messages.
Administrative Objects.
JMS Programming Models.
Model-Specific Administrative Object Interfaces.
The Synchrony of Message Consumption.
JMS Reliability versus Performance.
Client Acknowledgment.
Message Persistence.
Timing Dependencies and JMS Publishing Models.
Using JMS: An Example Pub/Sub Application.
Developing the Message Publisher.
Developing the Message Subscriber.
Towards Deployment.
Scalability and Performance Hints.
Prefer Messaging—Both Inside and Out.
Understand the JMS Efficiency versus Reliability Tradeoff.
Summary.
10. Effective Database Design. Database Technology and the Relational Model.
Relational Databases.
Logical Database Design.
Entities, Attributes, and Relationships.
Physical Database Design.
Tables and Rows.
Constraints.
Querying a Database.
Querying Data.
Nested Queries.
Join Queries.
Other Important Database Objects.
Views.
Stored Procedures.
Triggers.
Indexes.
Sequences.
Other Objects.
Query Processing.
Scalability and Performance Hints.
Understand How to Use the Database.
Understand When to Use the Database.
Understand How Your Data Will Be Accessed.
Normalize Your Data Model.
Selectively Denormalize Your Model.
Use Stored Procedures.
Avoid Triggers and Other Implicit Execution.
Know Your Vendor.
Summary.
11. Using JDBC and SQL to Efficiently Query Databases. How JDBC Fits In.
JDBC Concepts and Objects.
An Overview of Querying with JDBC.
Relevant JDBC Classes and Their Relationships.
Connecting to a Database.
Writing JDBC Queries.
Processing a Statement.
Iterating through Results.
Executing Single Updates.
Other Kinds of Updates: Creating Tables and Stored Procedures.
Beyond the Basics.
Prepared Statements.
Dynamic SQL.
Transaction Management.
Bidirectional Results Iteration.
Updateable Results.
Executing Batch Updates.
Scalability and Performance Hints.
Use Prepared Statement When Possible.
Use Batch Updates with a Remote Database.
Don't Overcommit.
Use Multithreading to Query in Parallel.
Summary.
12. Web Services: The Future of Web Applications. What Exactly Is a Web Service?
Surveying Web Service Technologies.
A Quick Tour of the Technologies.
Putting It All Together.
XML: Self-describing Data.
DTDs and Schema Languages.
Parsing XML.
XML-Related Technologies.
Coding Web Services.
Describing Web Services with WSDL.
WSDL Definitions.
WSDL Example.
Invoking Web Services with SOAP.
How SOAP Works.
Using SOAP over HTTP.
Registering Web Services with UDDI.
UDDI Standards.
The UDDI APIs.
The Big Picture.
The Provider Perspective.
The Consumer Perspective.
Scalability and Performance Challenges.
Replicating and Load Balancing Remote Functions.
XML Parsing Performance.
Summary.
Bibliography. Index.
Preface
When it comes to building Web applications, there are two fundamental problems. One is that there are flat-out too many choices in terms of how to develop them. These days, one can choose from literally hundreds of languages and technologies that claim to make Web application development easier. The other problem is that there is a lack of common knowledge about how to deploy them in a way that yields high performance and scalability--traits essential to anything accessible over the Internet.
Fortunately, there are now some unifying application infrastructures that not only simplify Web application development but also encourage efficient deployment. One of the most popular approaches is proposed by the Java 2 Enterprise Edition (J2EE) specification. The J2EE spec leverages and extends the existing foundation of Java technology so that engineers can build Web applications that encourage high performance and scalability. One of the most compelling features of J2EE is its built-in support for key low-level platform services such as transaction management, naming, and security, each of which normally requires substantial engineering time and expertise.
Although it unifies much of Web application development and deployment, comprehending J2EE is daunting. To understand it, you need to read either the spec itself or a lot of books on each specific J2EE technology (e.g., Servlets, EJBs, and JDBC). The spec itself is dry and not meant to be a practical resource. And the problem with reading books about each technology is that they tend to be overly long--some EJB-only books exceed 1000 pages. Such books also tend to be full of irrelevant details and appendices that you don't need or could have found easily online. Finally, most of them do not address the unspoken parts of Web application design--for example, database design and networking efficiency.
Goals
Building Scalable and High-Performance Java Web Applications Using J2EE Technology was written to fill the need for an applied summary of how to build high-performance and scalable Web applications using J2EE technology. This called for a delicate balance--introduce a set of new technologies and their relationships and provide enough examples so you can actually see how things work. The objective was not to go too far overboard to produce an overly long book that lacked focus (or one that could cause injury when lifted). Thus, the goal was to produce a concise but practical summary.
We'll cover all the key elements of J2EE--the spec itself, servlets, JSP, EJBs, messaging, JDBC, and more. Along the way, there will be plenty of examples. Many will be presented with deliberate brevity, the idea being that it is better to cut to the chase of how to use a technology rather than to show so many gory details that the readers' eyes start to glaze over. As we already know, there are plenty of books that address such details. When you've decided which parts of J2EE are relevant to you, you might consult those books as a complement to this one.
In addition to being a well-rounded summary, another purpose is to fill in the holes about Web application design that the J2EE specification simply does not address. Although the specification shows how to connect different Java technologies and APIs to build an enterprise application infrastructure, it does not address related issues such as networking and database design. For example, even though the specification describes how HTTP is used to communicate with a J2EE system and how JDBC can be used to communicate to a relational database from a J2EE system, it contains no details about HTTP or relational databases. As any seasoned Web application designer knows, understanding both is critical when designing your system for high performance and scalability.
In summary, this book has the following goals:
- To define and identify the challenges associated with building scalable and high-performance Web applications.
- To provide you with a J2EE technology roadmap for designing Web applications.
- To describe concisely key J2EE technologies, emphasizing details related to high performance and scalability.
- To fill in the gaps of Web application design that the J2EE spec leaves out, such as important details related to HTTP and database design--two of the most common J2EE-related technologies.
- To demonstrate the benefits of various specific J2EE design decisions, illustrating these differences with real performance graphs and charts.
This last item is targeted at making the suggestions in this book more compelling. For example, it is only somewhat comforting to say things like "connection pooling is good," which is the approach that many books take. It is more convincing and clear if real performance charts and graphs back up these claims. This book aims to achieve that goal.
Audience
Building Scalable and High-Performance Java Web Applications Using J2EE Technology is written for any engineer or architect who is proficient with Java and wants to build Java-based Web applications for performance and scalability, but does not yet understand how J2EE can be used toward that goal or how all of its underlying technologies work.
This book is also for those who want to see beyond the J2EE spec, in particular, to consider current issues in efficient networking and database design in addition to future issues related to Web services technologies such as XML and SOAP.
Finally, this book is for those already familiar with some parts of J2EE technology (e.g., Java Servlets), but not others (e.g., the Java Message Service).
A Note about Performance Measurements
Throughout this book, there are various performance measurements and comparisons. Although the same general trends apply to nearly every architecture (because the performance trends illustrated are architecture-independent), it may be useful to list the details of the system used for testing.All tests were conducted on a Dell Latitude running a single 833 MHz Pentium III with 256 KB RAM. The operating system and application software consisted of:
- Windows 2000, Professional Edition
- Apache Web server, version 1.3.14
- Java Runtime Environment and Development Kit, version 1.3
- J2EE SDK and reference implementation, version 1.3 (Beta)
- Apache Jakarta/Tomcat servlet container, version 3.2.1
- Oracle database system, version 8.1.6
The CD-ROM
The CD-ROM that accompanies this book contains most of the source code in this book. This supplement is intended for use on Windows 95/98/NT/2000 machines running Java 1.3, the Cygwin BASH shell and accompanying utilities, and Oracle 8.1.6. For more details about the desired reference system, see the preceding list.
Using the CD-ROM is straightforward: Simply insert the disk into your CD-ROM drive and then use your Web browser to open the index.html file that resides at the top-level directory. From this initial file, you will be able to get to other parts of the included documentation, as well as the source code.
Note that to compile and run some of the source code, first you need to copy the contents of the desired directories to your local hard drive and then compile everything there. More detail about this and the requirements for compilation can be found in the top-level index.html file.
Onward!
My hope is that this book acts as an ongoing reference for you as your J2EE application evolves. You will need to continually make choices in terms of how to provide application functionality to your consumers, both individuals and other businesses. You will have to address questions like, "Do I place the business logic in the database or the application server?" and "Should our batch data transfer go through a Web server or a messaging server?" Independent of the details associated with each of these choices, you will want to enable such features in a way that promotes performance and scalability. This book will help you understand the tradeoffs, both general and specific, in Web application design that can help you achieve that goal.
0201729563P12182001
Index
Abstract application architecture, 30, 47Abstract endpoints, 350Abstract messaging models, 243Abstract query plan, 287, 288Abstract Web application architecture, 29-32Access, programmatic, with Web services, 336Access control, with views, 279Access counts, city/county cache with, 69Accessibility, 27Access timeof cache, 69, 70caching for reduction of, 71AccountProcessing object, 259, 260Activation method type, and bean instances, 194"Active" database features, 306Active Server Pages, 151, 175addMember() method, 161, 166Administered objects, 244, 253Java Message Service, 243, 246Administrative object interfaces, model-specific, 247Administrators, 285Age and date-based validation, 107header field, 107Age calculation algorithm, summary of, 107Aggregate functions, 215Airline ticket buyingapplication operations associated with, 7and performance measuring, 14Akamai, 36, 69Algorithms, efficiency of, 125Almeida,V., 16AND operator, 275ANSI SQL/PSM standard, 280AOL/Netscape Navigator, 4, 27Apache, 151Apache Server, 135integration of, with Jakarta Tomcat servlet container, 154-156Apache Tomcat server, 152, 154Apache Web server, 151, 173, 184Apache Xerces 2.0, XML parsing with, 345-348APIsdatabase interfacing and choice of, 293J2EE services and, 51, 52servlet session tracking, 171-172support for, by J2EE containers, 52, 54UDDI, 360362Apparent age, of document, 107Applet containers, 50, 51, 191Applets, 98, 121Application client container, 191Application containers, 50, 51Application-level state, 163Application logic, 32, 161for counting page hits, 178deployment of, 190-191Application metadata, 32Application object, 181Application operations, 6with airline ticket buying, 7and performance measurement, 14Application programming interfaces. See APIs Application requirements, 25-27business logic, 25-26data management, 26interface, 26-27Application responselinearly scalable, 18sample, 17time, 20Applicationscomponents of, 265employer benefits-processing sytem, 195-196intermediate messaging services between two, 242-243linearly scalable, 18Application servers, 37, 189, 240Application system, messaging opportunities within, 259-261Architectural strategies, and application development, 21Architecture, abstract Web application, 29-32Argument marshalling, and local objects, 200Ariba, 338ASPs. See Active Server PagesAssertions, UDDI, 361Asynchronous client postprocessing, 258Asynchronous communication, 128, 129-131, 147-148caching, data locality and, 133-134and connection management, 133and data marshalling, 134and highly dynamic Web page generation, 138-139and messaging systems, 132Asynchronous delivery of messages, 247Asynchronous logging, 259Asynchronous message processing, 254, 256-257Asynchronous middleware technology, 43Asynchronous processing with Java Message Service, 136-137price updates, 131of requests, 262Asynchronous solutionsgood performance with, 261for request processing, 137Asynchrony, 8082, 89AT&T, 36ATM AAL-5, 93Attribute accessors, 212, 214, 217Attributes, 269Attributes, in tables, 271Attribute values, 215Auctions, online, 9, 11Authentication, 167-168. See also SecurityAuthentication tokens, UDDI, 362AUTO_ACKNOWLEDGE, 250AutoFlush page directive attribute, 182, 183Automatic report generation, 306Bandwidth, and network connectivity, 28-29Banking, online, 16Banking applications, 25, 249BankingSession session bean remote interface (course-grained), 237session bean remote interface (fine-grained), 236-237Barrier.java, 82, 83, 86-87BatchBenefitEnroller, 196BatchBenefitEnrollerBean, 225, 226-228Batch processing, 234Batch updates executing, 324-325with remote database, 328-329BEAWebLogic Server, 174, 175WebLogic suite, 49Bean class, 204, 212coding, 208211BeanEnroller entity class, coding using bean-managed persistence, 219-224Bean instancesactivation of, 194creation of, 194destruction of, 194passivation of, 194relationship between clients, EJB container, and, 192, 193Bean instantiation, 208, 210Bean-managed persistence, 199, 202BeanEnroller entity class coded with, 219-224and coding entity bean class, 217and coding home interface, 216and coding remote interface, 215good use of, 238-239Bean passivation, 240Bean persistence, methods of, 199Benchmarking, beyond, 15-16Benchmarks testing of, 15TPC-style, 20, 21Benefit bean, 217BenefitEnroller, 196BenefitEnroller bean, 229, 230BenefitEnrollerBean instance, 208BenefitEnroller client class, 229-230Benefit Enroller entity bean class, coding using container-managed persistence, 218-219BenefitEnrollerHome object, 229, 230BenefitEnroller object, 229BenefitEnroller remote interface, 206BenefitEnrollerRemote object, 210BenefitEnroller session bean class, 208-211BenefitEnroller session bean home interface, 207-208BenefitEnroller session bean remote interface, 206-207Benefit entity bean, 196BenefitEntity bean home interface, 217BenefitEntity bean remote interface, 214-215Benefit object, 211BenefitSession, JAR file for, 54BenefitsManager object, 230BENEFIT table, 214BETWEEN operator, 275Bidirectional communication, synchronous communication versus, 245Bidirectional results iteration, 323-324Binary protocols, message-based protocols versus, 92Binary types, 271Binding, and services, 353Binding, in WSDL document, 351Binding information and UDDI, 358Bindings, with price-quoting service, 352Blocking mode, 249BMP. See Bean-managed persistenceBodyin HTTP requests/replies, 99JMS message, 244, 245Bonus histories, stored procedures for, 280-281Boolean logic, 274Bots, 9Bottlenecks, 40Bottlenecks, and triggers, 307Boyce-Codd normal form, 294Broadcast-based application integration models, 241Browser cache, 33Browser clients, Web applications with, 93-94B2B applications. See Business-to-business applicationsB2C applications. See Business-to-consumer applicationsBuffer caches, sizing, 291Buffer page directive attribute, 182, 183, 186Bulka, D., 126Bulk processing, and remote methods, 145Business information, and UDDI, 358Business logic, 25-26, 49, 190, 265language choice for writing of, 282replication of, 45servlets not used for, 185-186, 187Business rules, 265Business-to-business applications, 28, 190, 325Business-to-business processing, future of, 333Business-to-business style working example, Red Planet Electronics, 241-243 Business-to-consumer applications, 28C, 136, 282, 294C+, 335C++, 57, 294, 335, 340, 344Cable modems, 28Cache consistency, 71problem of, 74Cache-Control directives, 116fields, 114header fields, 109-110Caches and caching, 13, 65, 72, 88, 95, 99Cache-control headers, 109-110with city/county access counts, 69for database systems, 318data locality, 133date-based validation, 107-108defined, 67dynamic GET requests, 103-105flush policy, 68HTTP 1.1, 106-110I/O-bound dilemmas addressed by, 126for reducing access time, 71redundant, 79and reliability, 73and replication, 67-73sample California city/county, 68static GET requests, 101-103tag-based validation, 108-109Caching benefit equation, tradeoff in, 70calculateNewSalary() method, 62CallableStatement, 314CallableStatement objects, 311Capable applications, 27Cardinality, 270Carnegie Mellon University, 36Cascading Style Sheets, 26, 27Cell phones, 26, 27Centralization, and database design/optimization, 266CGI programs. See Common Gateway Interface programsCharacter-based types, 271Check constraints, 272Children, with DOM, 343Cisco, LocalDirector, 34, 173, 184CLIENT_ACKNOWLEDGE, 250Client acknowledgment, 263and JMS reliability versus performance, 249-250Client data, relationship between server side entity beans, 200Client/EJB communication, behind the scenes, 230-232Client/EJB integration, 228-230Client hardware, 3Clients, 47, 121. See also Serversautomated, 33and caching, 106-107human, 32IDs, 256Java Message Service, 243, 244network, server, and, 3relationship between EJB container, bean instances, and, 192, 193synchrony of, 247-249Client/server application, 31Client/server architecture, hybrid design, 31Client-side data validation, 44Client-side network elements, 33-34Client-side network infrastructure, 34Client software, 3Clock synchronization, 15-16Clustered computing systems, 75CMP. See Container-managed persistenceCNET.COM, 5Coarse granularity, 47COBOL, 57Codd, E. F., 267, 294Code/Coding. See also Examplesbean class, 208-211entity bean class, 217home interface, 207-208message producer, 252-254remote interface, 206-207replicating, 161servlets, 158-162stub/skeleton, 57thread-safe, 46, 163, 184Columns, in relational databases, 267COMMIT, impact of, on performance, 329-330Commit operation, 60, 61Commits, cautionary note about, 329-330Common Gateway Interface programs, and dynamic response generation, 149, 150Common Object Request Broker Architecture, 43, 45, 47, 57, 92, 121, 187, 231, 338, 358driver integration with, 294IDL in, 339integrating objects in, 58Componentscategories of, with J2EE, 49-50management of, 65tier-based design, and reusability of, 38-40Concert/event seating availability, 138Concrete endpoints, 350Concurrency efficient management of connections, 120, 123fine-grained serialization and maximizing, 184Concurrent fetchingCPU-bound activity, 77I/O-bound activity, 78Concurrent request processing, with HTTP 1.1, 95Confirmation operation, 6Confirmation process, 14confirmEnrollment() method, 211, 229Connection.commit call, 323Connection.createStatement() call, 324Connection factories, 246, 252, 253, 254Connection management, 121, 147with HTTP 1.1, 95and request processing, 123, 133Connections, 24, 246, 252object, 310, 312pooling, 82, 83, 87, 331Connection.setAutoCommit() call, 323Connection.setAutoCommit(false), 329ConnPool.java, 82, 8486Consistency, cache, 74Constraints, 267, 272-273Consumer performance, and nondurable subscriptions, 262Consumers, and Web services, 363 Consuming applications, 242Container-managed persistence, 199-201, 202, 238, 239, 240and BenefitBean coding, 218and coding entity bean class, 217and coding home interface, 216, 217and coding remote interface, 215Container-managed relationships, 201Containers, 50, 65engines versus, 162 interoperability with J2EE, 53J2EE, and support for APIs, 54in J2EE Web application, 191relationships among J2EE, 51Content distribution, 13, 36, 99Contention, reducing, 125Content-Length header field, 112, 113, 116Context, 62Contract, 204Contract agreements, 50Cookies, 10, 235and deterministic load balancing, 173HTTP persistent, 169170session management implemented with, 170-171values, 170, 171"Cookie Sticky" feature, 173CORBA. See Common Object Request Broker ArchitectureCore logic, and JavaServer Pages, 178Cormen, T., 125Corporate intranets, 1Corrected initial age, 107Corrected received age, 107Cost, and scalability, 16Coarse-grained EJB methods, 236, 237-238CPU-bound servicing, 125-126Crashes, 175, 185create() API call, 216create() method, 204, 207, 208, 217Creation method type, and bean instances, 194Credit cardsapproval, 190checking, 40CSS. See Cascading Style SheetsCurrent age, 107, 108Customizable business logic, 26Custom servers, 95Datacopying, 79encoding in XML, 362feeds, 9portability, 338, 348querying, 273-275self-describing, 333, 338, 340-341, 368streaming of, between threads, 139-144XML and portablity of, 348Database definition language, 273Database design, 265-307importance of, 265-266logical, 268-270physical, 268, 270-273scalability and performance hints for, 290-307Database independence, with JDBC, 309Database indexes, 283-284Database management system, 73, 267, 291Database manipulation language, 273, 274, 275Database objectsadministrators, 285constraints, 272-273, 278indexes, 283-284rows, 271-272, 278sequences, 284-285stored procedures, 280-282tables, 271-272, 278triggers, 282-283views, 278-280Databases, 37classifying usage of, 293criteria for storing data in, 292-293how to use, 290-291JNDI for location of, 63querying, 273-278, 331relational, 267-268when to use, 291-293Database systems, aspects of, 267Database technology, and relational model, 267-268Database URL, 311, 312Data denormalization, selective, 299-302Data dependencies, and granularity, 261Data filtering, with WHERE clause, 275Dataflow graph, 286Data locality, and caching, 127, 133Data management, 26and data access, 293persistent, 30, 32Data marshalling, 122, 124, 134, 147Data modeling, 268, 280Data model normalizing, 294-299first normal form (1NF), 294-296second normal form (2NF), 296-298third normal form (3NF), 298-299Data-producing process, 103Date-based types, 271Date-based validation, 107-108Date response header field, 107DBMS. See Database management systemDB2, 290DCOM, 129DDL. See Database definition languageDebugging, of SOAP over HTTP, 356Decentralization, 13Declarations, JSP, 177, 182"Delayed write-through" policy, 73delete_xx methods, 361, 362Delivery, of message to client, 247Demarshalling, 231Denormalization tips, 302Denormalizing data model, 299-302DEPARTMENT entity, 269DEPARTMENT table, 271and denormalizing data model, 300in first normal form, 294, 295in third normal form, 298, 299Dependent objects, 201Deployment descriptor, 53files, 54-57sample, 55-56Deployment of J2EE, 53-57deployment descriptor files, 54-57packaging, 53-54Deployment paradigms, 93-95applications with browser clients, 93-94applications with nonbrowser clients, 94-95deselectBenefit() method, 229Design. See also Database designimportance of, 21and scalability, 8Destinations, 246, 253destroy() method, 162Destruction method type, and bean instances, 194Deterministic load balancing, 173DHTML. See Dynamic HTMLDigital subscriber lines, 28Directives, JSP, 177, 182, 183"Direct" programming, 186Dispatchers, and request redirection, 152Distance, caching to reduce latencies caused by, 70Distributed multitier applications, 189Distributed object technologies, 207, 231Distributed systems, 88Distributed Web functionality, abstraction and integration of, 334DML. See Database manipulation languageDocument Object Model, 343efficiency differences between SAX and, 364Levels 1, 2, and 3, 343SML parsing using, 345-347Document Type Descriptionsample, 342and schema languages, 341-343XML document referencing of, 342XML document with embedding of, 342-343doGet() method, 159, 164DOM. See Document Object ModelDomains, 247DOMParser.parse(), 365doPost() method, 154, 159, 161, 164DriverManager object, 310DSL. See Digital subscriber linesDTD. See Document Type DescriptionDUPS_OK_ACKNOWLEDGE, 250Durable subscribers/subscriptions, 251, 254, 256, 262Dynamically created tables, and join queries, 277Dynamic business logic, 26Dynamic content, and Expires field, 115Dynamic GET requests, caching, 103-105Dynamic HTML, 26, 27Dynamic page data, JSPs, 177Dynamic requests, 24Dynamic response generation, 149-152with CGI programs, 149, 150extending Web server through API, 150redirecting Web server request, 151-152Dynamic responses, 149Dynamic SQL, 320-321Dynamic Web applications, 10-11EAR file, 53eBay, 9, 11, 12EDI. See Electronic Data InterchangeEfficiency, 163, 263. See also Performance; Scalabilitywith BMP, 238-239of browser-to-server communication, 94in computation, 125and denormalization, 302HTTP, 95-96with normal forms of data modeling, 294, 299and remote interface development, 144-147and SOAP over HTTP, 356Efficiency methods, selective writing of, 147Efficient middleware, challenge of, 43EJBs. See Enterprise JavaBeansejbActivate() method, 205EJB containers, 50, 51, 191and bean instance management, 204relationships among clients, bean instances, and, 192, 193ejbCreate() method, 204, 207, 208, 210, 219ejbLoad() method, 217EJBObject, 121, 192, 193ejbPassivate() method, 205EJB query language (EJB-QL), 216ejbRemove() method, 205, 210ejbStore() method, 224, 239EJB 2.0 specification, 194, 202, 238, 240Electronic Data Interchange, 38, 92, 132, 349, 356Electronic shopping carts, 190Ellis Island Web site, 119-120, 123EMPLOYEE entity, 269Employee entity bean, 200Employee queries, iterative, 320-321Employees, triggers for maintaining accounts on, 283EMPLOYEE table, 271, 273, 315Employer benefits-processing system, 195196Endpoints, 350End-to-end interactions, with Web site, 2End-to-end performance, 6, 7Engine, container versus, 162Enrollment class, 226Enterprise JavaBeans, 37, 50, 135, 152, 162, 185, 186, 187, 240, 268, 303, 338client integration with, 228-232design of, 196-203driver integration with, 294implementation of, 203-228and Java Message Service, 243as J2EE solution, 191-192requesting member and employee information from, 201sample application with, 195-196scalability and performance hints for, 232-240types, general role of, and interbean relationships, 195types of, 194-195workings of, 192-194Entities, 269relationships among, 269-270Entity bean class, coding, 217Entity beans, 61, 64, 194, 197, 203, 211-224, 240and client interaction, 198and CMP, 238and coding entity bean class, 217-224coding home interface for, 216-217and EJB 2.0, 212life cycle of, 212-213local model for, 200methods found in, 212relationships, 198remote interface coding for, 214-216Entity integrity, 197, 198, 272Entity-relationship (E-R) notation, 269, 270Entity tags, 115Envelopes, SOAP, 353, 354Equipment requesting, 233, 234ETag field, 114header, 108ETag() validation method, 115Ethical issues, and caching, 72ExamplesDDL query for database table creation, 274employer benefits-processing system, 195-196generated servlet code, 179-181JSP, 175-177join queries, 276-278membership processing, 159-161online art company, 291-292price-quoting service, 351-353Red Planet Electronics, 241-243session management implemented with cookies, 170unsafe membership processing, 164-165 Exception handling, 281executeQuery() method, 319executeUpdate() method, 316, 322, 324, 325, 329EXECUTIVE table, 273Exodus Communications, 36Expires fields, 108, 114, 115header, 105, 107Expires tag, 107, 115Explicit control, implicit control versus, 318Explicit filtering, and indexes, 284Explicit style, of executing storing procedures, 283Explicit submission, 10Expressions, JSP, 177, 182Extensible Markup Language, 27, 337, 368counting nodes in document in, SAX versus DOM, 364document referencing DTD, 342document with embedded DTD, 342-343DOM representation of document in, 344DTD, for J2EE deployment descriptors, 55encoding data in, 362encoding requests in, 363parsing, 343parsing performance, 364-365parsing/querying replies with, 363parsing using DOM approach, 345-347parsing using SAX approach, 347-348parsing versus querying, 365-367parsing with Apache Xerces 2.0, 345-348sample document, 341technologies related to, 348-349and Web service technology, 338External procedures, 280Failover, 174, 175FastCGI, 150Fat client, 30, 31"Fat client" solutions, 190Fault tolerance, 232FILTER operation, 288findByPrimaryKey() method, 216, 217Finder methods, 216find_xx methods, 360Fine-grained approach, 235, 238for BankSession session bean remote interface, 236-237Fine-grained serialization, 184Firewall compliance, and Web service, 336Firewalls, 132. See also SecurityFirst normal form (1NF), 294-296Flight status information, 138Flushing caches, 68Foreign keys, 273and entity integrity, 198 and first normal form, 295and third normal form, 298FORM element, 103, 168, 169action attribute of, 159Freshness lifetime, of document, 107games.xml, 364Gartner Group, 27GenericServlet class, 158GetBulkDiscountPriceQuote, 350getInt(), 321GET method, 96, 97, 99-105, 117, 157caching dynamic GET requests, 103-105caching static GET requests, 101-103judicious use of, 113-114getObject() method, 141GET operations, 288GetPriceQuote, 350, 352getRemainingSlots() method, 217, 219GET requests, 101caching dynamic, 103-105caching static, 101-103get_xx methods, 360GIF files, 53GIF images, 148Global resource caches, 126Google, 28, 69Granularity, 48and data dependencies, 261selection of, 4647Green pages, 358Handshakes, 245Hardwareand parallelism, 7475and redundancy, 78, 79Hardware-based load balancing, 184-185Hash join, 289HAVING clause, 275Headersin HTTP requests/replies, 99Java Message Service, 245SOAP, 354Hidden form fields, 235for session identification, 168-169Hierarchical model database, 267Highly dynamic Web pages, generating, 138-139High-performance Web applications, 1Home interface, 193, 203, 204coding, 207-208coding for entity beans, 216-217for entity beans, 212Horizontal access to information, 279HTML, 27, 338XML distinct from, 340HTML codegeneration of, 186for membership-processing example, 157HTTP. See Hypertext Transfer ProtocolHTTP 1.0, 93, 106, 116persistent connections support with, 112HTTP 1.1, 93, 94, 95, 104, 116and persistent connections, 336Transfer-Encoding supported by, 113HttpRequest descriptor, 163HttpResponse descriptor, 163HttpServlet methods, commonly overridden, and original purpose of, 158HttpSession class, 163HTTP session management, 235HttpSession object, 172HTTP user authentication, 167168Hyperlinks, 24Hypertext Transfer Protocol, 5, 333automatic authentication, 336connection management, 110-113cookies, 235deployment paradigms, 93-95description of, 91-93details about, 96-113efficiency with, 95-96GET method, 99-105and message-based schemes, 132for nonbrowser clients, 114persistent cookies, 169-170POST method, 105-106programmatic access to remote Internet-based functionality via, 353reducing connections, 98remote object functionality invoked via, 337requests, 99, 148sample request and reply, 92scalability and performance hints, 113-116semantics, 97-99SOAP usage over, 356-357version 1.1 caching, 106-110Web services access via, 334, 335, 336IBMDB2, version 7, 280and UDDI standards, 359WebSphere, 49IDL. See Internet Definition LanguageIETF. See Internet Engineering Task ForceIf-Match header field, 101, 102, 108, 109If-Modified-Since, 115header field, 101, 102, 106requests, 115If-None-Match header field, 101, 102, 108, 109If-Range header field, 101If-Unmodified-Since header field, 101, 102IIOP. See Internet Inter-ORB ProtocolIIS. See Microsoft Internet Information ServerILP. See Instruction-level parallelismImages, 103and content distribution, 36and persistent connections, 110-111storage of, in databases, 291-292transferring for Web page, 98Implicit control, explicit control versus, 318Implicit execution, avoiding, 306-307Implicit filtering, and indexes, 284Implicit style, of executing stored procedures, 283Implicit submission, 10include directive, 182Independent caches, consistency of, 127Indexes, 270, 283-284, 289, 307, 321query plan using, 290of results, 314"Indirect" programming, 186Information agents, 9, 10Information consumers and providers, 1, 2init() method, 158, 159, 162IN operator, 275Inquiry API, UDDI, 360Instruction-level parallelism, 75Integrated voice response, 94Integration, with Web applications, 12Integrity constraints, 267, 273Intelligent agents, 336Interactivity, 10, 11Interface Definition Language, 207Interfaces, 265, 293Interface technologies, 26-27Intermediate network support, with HTTP 1.1, 95Internal product IDs, 241Internet, 1, 33, 91always-on characteristic of, 8, 11-12attributes of, as medium, 8-13dynamic, 8, 10-11and future of Web services, 333integration and, 9, 12interactivity of, 8, 10lack of complete control with, 9, 12-13nature of and challenges with, 35wide audience for, 4, 8, 9-10Internet Definition Language, 57Internet Engineering Task Force, 93, 95Internet Inter-ORB Protocol, 43, 57, 129between ORBs, 59Internet Protocol, 33Internet service provider, 33Internet technologies, 2Interoperability, and request redirection, 152I/O-bound servicing, 126IONA, 58IP. See Internet ProtocolISAPI, 150ISP. See Internet service providerisThreadSafe page directive attribute, 182, 183, 186IVR. See Integrated voice responseJakarta 3.2.1, JSP example generated by, 179Jakarta Tomcat servlet container, Apache server integrated with, 154-156JAR file, 53for BenefitSession, 54Java (programming language), 91, 92, 282, 335, 340DOM interfaces and bindings for, 344servlets in, 158synchronization with, 42, 43Java applets, 49Java applications, 49Java code, efficiency of, 125Java Collections classes, 46Java Database Connectivity, 238, 331API, 309appending order with use of (multiple queries), 303-304appending order with use of (stored procedure), 304-305class hierarchy, 311concepts and objects, 310-312database connection, 311-312database URL, 311-312driver, 294key features with, 309prepared statements with, 318-319queries, browsing, 315-316scalability and performance hints for, 325-331Java Database Connectivity query writing, 312-318executing single updates, 316iterating through results, 314-316statement processing, 312-314table and stored procedures creation, 317-318java.io.Serializable class, 231JavaMail, 65Java Message Service, 63, 82, 138, 203, 241, 243administrative objects, 246asynchronous processing with, 136-137body types and content, 246clients, 244concepts behind, 243-244concepts, mapping to model-specific interfaces, 248efficiency-reliability tradeoff with, 261-262, 263EJB contacted by, 191mapping concepts to model-specific interfaces, 248message architecture, 137message headers, 245messages, 244-246messaging models provided by, 262programming models, 246-249providers, 244reliability versus performance, 249-251sample pub/sub application, 251-258timing dependencies and publishing models, 251Java Name and Directory Interface, 126, 224API, 61properties file, 253 for resource location, 62-64Java Remote Method Invocation, 43, 58, 124, 129, 333-334JavaScript, 26, 27, 44, 98Java serialization, 124JavaServer Pages, 50, 64, 135, 136, 152, 162, 187considerations with, 186declarations, 177, 182as development methodology, 183directives, 177, 182, 183example page, 175-177expressions, 177, 182generated servlet code example, 179-181life-cycle flowchart, 179page directive attributes, 182, 183scriptlets, 177, 182servlets developed with, 175-183structure of a page, 177-182synchronous processing with, 135-136workings of, 178-182Java servlets, 50, 60, 67, 135, 150synchronous processing with, 135-136thread pooling in, 136Web server request redirection to, 152Java Servlet Specification 2.3, SRV 2.2.1 of, 166Java Statement object, 312Java threads, for parallelism, 76Java Transaction API, 243transaction management using, 59-61Java 2 Enterprise Edition, 1, 23, 47, 48, 65, 67, 89, 152container interoperability, 53deployment descriptor XML DTD, 56EJB query language (EJB-QL), 216and Enterprise JavaBeans, 191-192and JDBC, 309and JMS provider, 244and replicating/load-balancing remote functions, 363-364and request processing, 135-137services, and APIs, 52 and session persistence, 174, 175Java 2 Enterprise Edition specification, 49-65and architecture, 64deployment issues with, 51-57overview of, 49-52platform technologies and services, 57-64Java 2 Standard Edition, 58java.util.ArrayList class, 225java.util.Collection, 216java.util.Serializable, 226Java Virtual Machine (JVM), 126, 152Java Web Server, 135javax.jms.MessageListener, 225javax.jms.MessageListener.onMessage() method, 225javax.transaction package, 60javax.transaction.UserTransaction interface, 61JDBC. See Java Database ConnectivityJDBC 2.0 APIbatch updates feature with, 325result management with, 323updateable results with, 324JDBC driver. See Java Database Connectivity, driverJDBC/ODBC bridge, 312J2EE. See Java 2 Enterprise Editionj2eeadmin tool (Sun), 252-253J2EE1.3+, 243JMS. See Java Message ServiceJMS API, 244calls, 253execution of modes for message consumers with, 249relationship among providers, clients, messages and, 244JMS client, sample remote, 255JMSDeliveryMode, 245JMS efficiency-reliability tradeoff, 261-262JMSExpiration, 245JMSMessageListener object, 256JMS 1.0.2 specification, header fields defined by, 245JMSPriority, 245JNDI. See Java Name and Directory InterfaceJoin condition, 276JOIN operation, 288, 289Join queries, 276-278, 287, 300JPEG images, 148, 291, 292J2SE. See Java 2 Standard EditionJSPs. See JavaServer PagesJTA. See Java Transaction APIKeep-Alive header, 112Keysin caches, 68foreign, 273primary, 272Language neutrality, and Web service, 335Last-modified approach, 105Last-Modified field, 114, 115Last-Modified header, 106, 107Latency, 20and batch updates, 329caches and reduction of, 70and data marshalling, 124and node distances, 75and transfer of static content, 103LDAP, 62Lea, D., 43Least-recently-used policy, 68, 69Legacy systems, 38Life cycleand bean instances, 192, 193entity bean, 212, 213message-driven beans, 225session bean, 204-206stateful session bean, 206stateless session bean, 205Linearly scalable application response/throughput times, 18Little's law, 16, 17Load balancing, 34, 99, 127, 147deterministic, 173hardware-based, 184-185remote functions, 363-364scalability, 72, 73software-style, 184, 185Loan rate checks, 336LocalDirector (Cisco), 173, 184Local model, for entity beans, 200Local objects, advantages with, 200-201Local (or remote) interface, 193LOCATION tableand denormalizing data model, 300in third normal form, 298Location transparency, and EJB, 192Logging, asynchronous, 259Logical database design, 268, 307entities, attributes, and relationships, 269-270Logic types, mixing, 161Loose coupling, with Web services, 336LRU policy. See Least-recently-usedMail servers, JNDI for location of, 63Many-to-many relationshipsbean, 198 among entities, 270MapMessage body type, 254MapMessage category, 246Marshalling, 124, 147, 231Massively parallel processors, 74Matrix multiplication, and parallelism, 76Max-Age field, 107, 108Max-age response, 109MemberBenefit entity beans, 196, 198, 228MemberBenefitHome object, 211MemberBenefit instances, 211MemberBenefit object, 230MEMBER_BENEFITS table, 198Member entity bean, 196, 198, 200MEMBER_ID, 198Membership processing sample servlet, 159-161MEMBER table, 198Menasce, D., 16Merge join, 289Message-based protocols, binary protocols versus, 92Message beans, 61Message consumer, 246Message consumption, synchrony of, 247-249Message delivery reliability options, 261Message-driven beans, 194, 203, 224-228, 240coding bean class, 225-228life cycle, 225preference over session beans, 232-234Message header, JMS message, 244, 245MessageListener interface, 256Message processing, asynchronous, 256-257Message producer, 246coding, 252-254Message properties, JMS, 244, 245Message publisher development, 252-254coding message producer, 253-254topic creation, 252-253Message queues, JNDI for location of, 63MessagesJava Message Service, 243, 244-246with price-quoting service, 351-352in WSDL document, 350Messages persistence, and JMS reliability versus performance, 250-251Messaging, 232, 233, 234services, 65styles, 247systems, 38, 132Microsoft, 338and UDDI standards, 359Microsoft Internet Explorer, 27, 93Microsoft Internet Information Server, 135, 150, 151MIME. See Multipurpose Internet Mail Extensionmod_cgi module, 151mod_rewrite module, 173Modularizationand performance, 40and reusability, 46with tier-based design, 38-39Money transfers, and rollbacks, 321-322MPP. See Massively parallel processorsMultiple containers, session management with, 172-175Multiple issue technique, 75Multipurpose Internet Mail Extension, 93Multirow functions, 216Multithreaded application servers, 41, 42using/building, 4546Multithreading, 75, 147for querying in parallel, 330-331and servlets, 163-166must-revalidate response, 109MyDb data source, 312Names, of tables, 271NAPs (network access points), 35Nested loops algorithm, 289Nested queries, 275-276, 300, 327NetRatings, 4Netscape Web servers, 150Network, 33-36, 47access points, 35and client hardware/server hardware, 3between client side and server side, 35-36client-side network elements, 33-34server-side network elements, 34-35Network connectivity requirements, 28-29Networking infrastructure, 3Network model database, 267Network service provider, 35Newspapers, 4Newswire stories, 138Nielsen, H., 116no-cache response, 109Nonblocking mode, 249Nonbrowser clientsHTTP for, 114Web applications with, 94-95Nondurable subscribers/subscriptions, 254, 256, 262Nonpersistent delivery, 246, 261, 262Nonpersistent messages, 250, 251Nontransaction, of messages, 249, 250Normal forms, of data modeling, 294-299no-store response, 109notify() mechanism, 126NOT operator, 275NSAPI, 150NSP. See Network service providern-tier application architecture, 32-43, 47clients, 32-33efficient middleware challenges, 43multithreaded application servers, 41-43network, 33-36server, 36-37tier-based designs, 38-41n-tier applications, 38, 43, 49, 64, 65, 119, 148NULL designation, 271-272Numeric types, 271ObjectMessage type, 254Object orientation, 268Object-oriented databases, 268Object persistence, and EJBs, 192Object request broker, 57IIOP between, 59Objects, 285 dependent, 201persistent, 211Object-technology neutrality, and Web service, 336OCI. See Oracle Call InterfaceODBC, 294, 311and JDBC, 309On-chip parallelism, 75One-to-many relationship, 198between DEPARTMENT and EMPLOYEE, 269among entities, 270One-to-one relationship, entity bean, 198Online art company example, 291-292Online auctions, 9, 11Online banking, 16Online brokerage applications, 23Online retail applications, 197OnMessage() bean function, 203onMessage() method, 228, 256OODBMS. See Object-oriented databasesOpaque tags, 108Opera browser, 27Operation, in WSDL document, 350Operator, 286Optimizers, 289Oracle, 191, 2908i database architecture, 2678i thin JDBC driver, 312high-performance DBMS, 73index creation with, 284JDBC drivers supported by, 294Procedural Language, 280, 281, 282sequences supported by, 284SQL statements cached by, 318and UDDI standards, 359Oracle Call Interface, 294Oracle PL/SQL, appending order with use of (stored procedure), 305Oracle query optimizer, 288Oracle query plan dataflow graph, 289ORB. See Object request brokerORDER_ITEMS table, 300, 303Ordersappending, using JDBC (multiple queries), 303-304appending, using JDBC (stored procedure), 304-305appending 1,000 items to, 306appending, using Oracle PL/SQL, 305batch processing of, 325ORDERS table, 300, 301, 303OR operator, 275OSI model, of network programming, 93Outages, 11, 12, 13Out-of-process servlet container model, 153, 154Packaging, J2EE applications, 53-54Packets, 33page directive, 182Page hits, 4Page hits countsapplication logic for, 178sample JSP for, 176-177Parallel flows, 287Parallelism, 40, 74-78, 88, 232, 259and asynchrony, 80, 82, 137interapplication, 139with JMS-based solutions, 263maximizing, 144and request redirection, 152and resource pooling, 82Parsing, XQuery versus, 367Partially ordered query dataflow graphs, 287Passivation method type, and bean instances, 194Passwords, 72PDAs. See Personal digital assistantsPeer-to-peer models, 132Performance, 23, 87. See also Scalability; Scalability and performance challenges; Scalability and performance hints; Scalability and performance techniquesand asynchrony, 80and bean-managed persistence, 202and cache-control headers, 110caching and improvement in, 71callback methods for, 205and coarse-grained methods, 238and database, 265and data normalization, 299, 302and distributed, multitier applications, 189and efficient remote interfaces, 144-147and future of Web services, 368impact of COMMIT on, 329-330with Java Message Service, 261-262, 263and join queries, 278measuring, 7, 13, 14-16and message persistence, 250and multithreading, 330and nested queries, 275and optimization of application, 266and persistent connections, 110with PTP and pub/sub, 262and query processing, 286and request processing modes, 133request processor and, 119and scalability, 58and server-side application logic, 191and stored procedures, 303trends, 18and versions of HTTP, 94.Perl, 136, 151Persistence, 263automatic, 174-175bean-managed, 202container-managed, 216, 239, 240Persistent application objects, 197Persistent connections, 99, 110, 114, 123, 132advantages with, 112and embedded images, 111HTTP 1.1, 336support for, 116Persistent cookies, 172HTTP, 169170Persistent data, 265Persistent data management, 30, 32Persistent delivery mode, 246Persistent message delivery/messages, 250, 261Persistent objects, 211Personal digital assistants, 26-27, 94Personalization information, 32Physical database design, 268, 270-273, 307constraints, 272-273tables and rows, 271-272Pipelining, 75, 116Plan execution, within query processing, 286Platform-independent application objects, 207Platform neutrality, and Web service, 335PL/SQL, 191PointCast, 121Point-to-point messaging model, 243, 246, 247, 261, 262Point-to-point programming model, 251, 257Polymorphism, 124Pooling, 46, 88PoolTest.java, 82, 83Portal services, 23Portswith price-quoting service, 353in WSDL document, 351Port types with price-quoting service, 352in WSDL document, 350POST method, 96, 97, 101, 105-106, 113-114, 117, 157POST requests, 362PreparedStatement calls, 314, 325-328, 329PreparedStatement object, 311, 318-319, 320, 321Prepared statements, with JDBC, 318-319Presentation logic, 161, 178PRICE_HISTORY table, 300, 301, 303Price/performance, indexes and throughput, 19-21PriceQuoteSoapBinding, 350Price-quoting function, 349, 350Price-quoting service, 351-353messages and types, 351-352port types and bindings, 352-353and SOAP, 354-357Price updates, 249, 252Primary keys, 272, 285and first normal form, 295and second normal form, 296, 297and third normal form, 298PrintWriter object, 182PRIORITY_LEVEL table, in 2NF, 297, 298private response, 109Privileges, 285Proactive application servers, 138Procedural Language (Oracle), 280, 281, 282ProcessMembership servlet, 158Processor nodes, distance between, 75Producer performance, and nonpersistent message delivery, 262Producing application, 242Product IDs, 241, 246Productivity, 19-20ProductPriceRequest, 350, 351ProductPriceResponse, 350, 351Profile updating, 40PROJECT tablein 1NF, 295in 2NF, 296, 297, 298Properties, JMS message, 244ProvidersJava Message Service, 243, 244and Web services, 362Proxy cache, 34Proxy compliance, and Web service, 336proxy-revalidate response, 110Proxy servers, and caching of static GET requests, 102, 103PTP model. See Point-to-point programming modelpublic response, 109Publishers, 247Publishing API, UDDI, 360-362Publish/subscribe (pub/sub) messaging model, 243, 246, 247, 248, 251, 261, 262benefits with, 257with Red Planet, 252topic creation with, 252-253putObject() method, 141Quality of service (QoS), 12, 13Queries/querying, 10, 331data, 273-275and JDBC, 316join, 276-278meaning of, 273nested, 275-276and normalization, 299, 300in parallel, multithreading for, 330-331parsing, 286, 318, 327simplification of, with views, 279-280writing JDBC, 312-318Query language, 273Query plans generation/optimization of, 286using index, 290Query processing, 286-290, 307, 327phases of, 287Queue class, 139, 142QueueConsumer class, 142-143QueueMain class, 142QueueMain program, 143QueueProducer class, 142Queue reader, 141Queues/queuing, 246, 247and asynchronous communication, 131for communication among threads, 139-141managing with JMS, 252Quilt technology, 366Radio, 5RAID, 78raise_multiple value, 62, 63, 64Reactive Web page delivery, 138receive() method, 257, 258Red Planet Electronics, 241relationship between resellers and, 242reseller price update flowchart, 242Red Planet example, 244, 246, 249, 250, 251-258deploying pub/sub application, 258message publisher development, 252message subscriber development, 254-258price updates, listener for, 256-257Redundancy, 34, 65, 78, 89, 266, 267replication contrasted with, 79and Web servers, 79Referential integrity, 201, 272-273Regeneration of content, 115Relational databases, 67, 267, 309 constraints supported by, 272-273and stored procedures, 280Relational database management system (RBMS), 268Relational model database, 267Relational operators, 275Relations, 271Relationships, 269Reliability, 12. See also Efficiency; Performancecache, 73with JMS, 261-262, 263with JMS distribution models, 251Remote client, sample JMS, 255Remote database, batch updates with, 328-329Remote functions, replicating and load balancing, 363-364Remote interface, 203, 212coding, 206-207coding for entity bean, 214-216efficient, 144147Remote (or home) interface, 193Remote procedure call, 43, 129, 338Remote Web functions, publication of, 333-334Replication, 88and caching, 67-73and performance, 302redundancy contrasted with, 79value-added, 301Reply, 24Report data, 32Request, 24fulfillment, with HTTP, 97pipelining, 113Request-level state, 163Request processing, 119-148, 147and connection management, 123and CPU-bound servicing, 125-126and data locality in caching environments, 127and data marshalling, 124general problem, 120-121with highly dynamic Web pages, 138importance of, 120and I/O-bound servicing, 126and J2EE, 135-137modes, 128-134pretty picture and ugly details of, 122and remote interface design, 144and request servicing, 124specific challenges with, 121-122Request-processing modes, 128-134asynchronous communication, 129-131caching and data locality, 133-134connection management, 133data marshalling, 134messaging systems, 132scalability and performance, 133synchronous communication, 128-129Request processors, 36, 147, 119RequestRunnable.java, 82, 83, 84Request servicing, 122, 124-125Reseller update processing, 241Resident time, 107Resource location, JNDI for, 62-64Resource pooling, 82-87, 89Resource references, caching, 126Resource usage, and scalability, 16Response caching, HTTP, 114-116Response delay, 107Results, bidirectional iteration and updateable, 323-324ResultSetMetadata object, 314ResultSet object, 311, 314, 324ResultSet.previous() method, 323ResultsSet.afterLast() method, 323Reusability, 11and modularization, 46with tier-based design, 38-40Reverse proxy cache, 35RMI. See Java Remote Method InvocationRMI-IIOP, 129component communication via, 57-59and integration of Java and C++ CORBA objects, 58, 59Roll back operation, 60, 61of transactions, 321-322, 323Round-robin distribution policy, 127thread scheduling, 41Routers, 35Routing tables, 13Rowsand entity integrity, 272inserting into tables, 274inserting with JDBC, 316in physical database design, 271-272in relational databases, 267RPC. See Remote procedure callSafety, and performance, 262save_xx methods, 361, 362SAX. See Simple API for XML ParsingScalability, 1, 23, 87. See also Efficiency; Performancecaching and improvement in, 71callback methods for, 205and connection management, 123and database, 265and distributed, multitier applications, 189and efficient remote interfaces, 144-147EJBs and enhancement of, 192and future of Web services, 368load balancing for, 72, 73measuring, 13, 1621, 22and message persistence, 251and modularization, 39and multithreaded servers, 163optimizing of application, 266and performance, 58with PTP and pub/sub, 262and request-processing modes, 133request processor and, 119and server-side application logic, 191servlet, 185and servlet deployment, 172and stateless session beans, 197targeted, 186and versions of HTTP, 94and Web server request redirection, 151, 152Scalability and performance challenges, 363-367parsing versus querying XML, 365-367replicating/load balancing remote functions, 363-364XML parsing performance, 364-365Scalability and performance hintsavoiding triggers and other implicit execution, 306-307batch updates with remote database, 328-329cautions about commits, 329-330data access, 293-294database usage, how and when, 290-293data model normalization, 294-299fine-grained serialization usage, 184hardware-based load balancing, 184-185JMS efficiency-reliability tradeoff, 261-262message-driven beans preferred over session beans, 232-234messaging opportunities within application system, 259-261multithreading used to query in parallel, 330-331PreparedStatement usage, 325-328selective denormalization of model, 299-302stored procedures usage, 303-306use messaging, 258-259vendor knowledge, 307Scalability and performance techniques, 67-89asynchrony, 80-82caching and replication, 67-73parallelism, 74-78redundancy, 78-79resource pooling, 82-87SCAN operator, 286Scenario, 15Schema definition, 341Schema languages, and DTDs, 341-343Screen savers, 121"Screen scraping," 335Scriptlets, JSP, 177, 182Script processor, Web server request redirection to, 151-152Scrollable result set, 324Search engines, 9Search operation, 6Second normal form (2NF), 296-298Secure data transactions, 1Security, 51, 168and cache-control headers, 110and caching, 72and deployment descriptors, 55-56and local objects, 201and messaging systems, 132and SOAP over HTTP, 356selectBenefit() method, 229Selection operation, 6SELECT operator, 286SELECT statement, 274Self-describing data, 338, 368need for, 333and XML, 340-341Semantics HTTP, 97-99integrity of, 273Sequences, 284-285Serialization, 124, 175of data access, 126fine-grained, 184request, 166of request execution, 163-164for unsafe membership processing example, 164-165Server hardware, 3Servers, 47, 121, 127. See also Clientsapplication, 189and caching, 106content regeneration by, 115HTTP and scalability issues for, 98-99Server-side application architecture, 36-38Server-side application logic, disadvantages to, 191Server-side drivers, 294Server-side entity beans, relationship between client data and, 200Server-side network elements, 34-35Server-side network infrastructure, 35Server-side organization, 37Server software, 3Service information, and UDDI, 358service() method, 61, 158, 162, 163Service replication, with tier-based design, 40-41Services and endpoints, 350with price-quoting service, 353in WSDL document, 351Servlet-based session management, 235Servlet containers, 37integration options, 153and servlet execution, 162-163and servlets, 152-154Web servers and integration of, 154-157ServletContext class, 163Servlet instance, destroying, 162Servlet interface, designing, 157-158ServletResponse object, 182Servlets, 303coding, 158-162deploying, 172-175, 187developing, 157-162, 187execution of, 162-166interacting with, 154JSP and development of, 183membership processing sample, 159-161and multithreading, 163-166and servlet containers, 152-154and session management, 167-172, 187for session management, not business logic, 185-186using, 152-157, 187Servlet session tracking API, 171-172Session beans, 61, 194, 196-197, 198, 203-206, 234, 240Message-driven beans preferred over, 232-234Session identification, 167-172hidden form fields, 168-169HTTP persistent cookies, 169-171HTTP user authentication, 167-168reading from incoming request, 170-171rewritten URLs, 169servlet session tracking API, 171-172Session lifetime, 25Session management, 161, 187cookies, and implementation of, 170-171with multiple containers, 172-175and servlets, 167-172Session migration, automatic, 174-175session object, 181Sessions, 24, 246Session state, maintaining in hardware load balancing, 174SetInt(), 321setSessionContext() method, 204, 208SGML. See Standard Generalized Markup LanguageSharedConnection.java, 82, 86SharedConnection object, 83Shirazi, J., 126Simple API for XML Parsing, 343, 344-348efficiency differences between DOM and, 364XML parsing using, 347-348SimpleDom.java, impact of DOM tree building versus other code in, 365Simple Object Access Protocol, 92, 337, 338, 339, 340, 362, 368communicating with remote services via, 363communication based on, 354, 355encoding rules, 353envelopes, 353, 354over HTTP, 356-357RPC representation, 353translators, 355, 362Web services invoked with, 353-357Simplicity, 309, 331Single-row functions, 214, 215SingleThreadModel interface, 164, 166, 184"Smart stubs," 231s-maxage response, 109SMP machines. See Symmetric multi-processing machinesSOAP. See Simple Object Access ProtocolSoftbots, 9Softwareand parallelism, 76and redundancy, 78, 79Software-style load balancing, 184, 185Specification of services information, and UDDI, 358Speculative execution, 75Speedup, 15-16Spider, 9Spoofing, 168Sports scores/event statistics, "live," 138Sprint, Inc., 4SQL. See Structured Query LanguageSQL-92 standard, 273SQL queriesGROUP BY part of, 275optimizing, 289-290resolving, 286SSL (secure socket layer), 132, 336Standard Generalized Markup Language, 338XML distinct from, 340Starr report, 45, 7startElement() method, 348Stateful session beans, 196, 198, 203, 205, 206, 213, 234, 235, 236Stateless session beans, 197, 198, 203, 234-236life cycle, 205State management, 174175, 197State manager, 235Statement.executeQuery() call, 313Statement.executeUpdate() call, 329Statement objects, 312, 316, 318, 319Statement processing, with JDBC, 312-314Static GET requests, caching, 101-103Static objects, 148Static page data, JSPs, 177Static requests, 24Static responses, 148Static Web pages, 36Stock price checks, 336Stored procedures, 280-282creating with JDBC, 317and denormalization, 302using, 303306Structural representation of data, 340Structured information, 292Structured Query Language, 238, 267, 273, 286, 331database queries via, 309DML commands, 275dynamic, 320-321JDBC and statements in, 310Stubs and skeletons, 231code for, 57and remote invocation, 232Student course registration requests, 144-147Subscriber listener, and asynchronous client postprocessing, 258Subscribers, 247creating, 254Subscriptions durable, 251synchronous processing of, 257-258Sun Microsystems, 338Java 2 Enterprise Edition, 49Java Web Server supported by, 135JDBC/ODBC bridge supplied by, 312Switches, 35Sybase, Transact-SQL (T-SQL), 280Symmetric multiprocessing machines, 75Synchronizationof access methods, and databases, 46clock, 15-16and multithreaded code, 42Synchronized keyword, 46, 164, 165, 184Synchronous communication, 80, 128-129, 137, 147-148bidirectional communication versus, 245caching, data locality and, 133and connection management, 133and data marshalling, 134Synchronous delivery of messages, 247Synchronous I/O-bound execution, poor performance with, 260Synchronous message processing, 254, 256Synchronous middleware technology, 43Synchronous price update processing, 130Synchronous processing, with Java servlets and JSPs, 135-136Synchronous subscription processing, 257-258Synonyms, 285Syntactic checking, 318Tables, 270creating with JDBC, 316, 317data in, 38and 1NF, 295and performance measurements, 14-15in physical database design, 271-272in relational databases, 267rows inserted into, 274and 2NF, 296, 297and 3NF, 298, 299Tag-based validation, 108-109taglib directive, 182Targeted scalability, 186Task parallelism, 40Tcl, 151TCP. See Transmission Control ProtocolTCP/IP, 33, 93, 94, 97Telephones, 2627Television, 5Testing, 47Text-based messageswith SOAP, 356and Web services, 353TextMessage body type, 254TextMessage type, 246Thin clients, 30, 31, 4445application servers and deployment of, 189and Web applications, 190Thin drivers, 294Third normal form (3NF), 298-299Thread-level parallelism, 75Threads, 136data streamed between, 139-144pooling, 46Thread-safe code, 46, 163, 184Thread-scheduling policies, 41Three-tier applications, 38Throughput, 20-22and price performance, 1921sample application response and times for, 17and scalability, 16times, linearly scalable, 18Tier-based designs, 38-41, 47better distributed processing and task parallelism with, 40increased modularization/component reusability with, 38-40and more efficient service replication, 40-41Tiers, 38Timing dependencies, and JMS publishing models, 251TLP. See Thread-level parallelismTopicConnection, 253, 256Topic creation, with pub/sub model, 252-253TopicPublisher, 254Topics, destinations as, 246TopicSession, 254TopicSubscriber object, 256, 257TPC. See Transaction Processing CouncilTPC-A, TPC-B, and TPC-C benchmarks, 20TPC-style benchmarks, 19, 20TPS. See Transactions per secondtraceroute, 36Transaction management, 321-323and Enterprise JavaBeans, 192with Java transaction API, 59-61Transaction Processing Council, 20Transactionsand client acknowledgment, 249and EJBs, 61explicit control of, 330JNDI for location of, 63processing of, 291, 321at Web application level, 24and Web components, 60-61Transactions per second, 17Transact-SQL (T-SQL), 280Transfer-Encoding header, 112, 113, 116transferFunds() method, 259, 260Transfer rate, and persistent connections, 111-112Transistive dependency, 298Translators, SOAP, 355, 362Transmission Control Protocol, 33, 97Trees, with DOM, 343, 344, 364, 365Triggers, 282-283avoiding, 306-307Tuples, 267, 27124x7 availability, with Internet, 11Two-tier applications, 38Typeswith price-quoting service, 351-352in WSDL documents, 350UDDI. See Universal Description, Discovery, and IntegrationUDDI 2.0 Programmer's API, 359, 360, 361UDP. See Universal Datagram ProtocolUniform Resource Locators JNDI for location of, 63rewriting, 169, 235, 236Universal Datagram Protocol, 33, 97Universal Description, Discovery, and Integration, 339, 368APIs, 340, 359-362information types, 358, 359publishing functionality via, 362standards, 359Web services registered with, 357-362Universal Resource Identifier, 92UNIX, 267Unsafe membership processing, example of, 164-165Unstructured images, 292Updateable results, 324updateRow(), 324Updatesbatching with remote database, 328-329with JDBC, 316UDDI, 360updateString(), 324UPPER() function, 215URI. See Universal Resource IdentifierURLs. See Uniform Resource LocatorsUsability benefits, 292Usable applications, 27Useful applications, 27User authentication, HTTP, 167-168UserLand, 338Usernames, 72Value-added denormalizations, identifying, 302Value-added replication, 301Valuesin caches, 68and sequences, 284-285Vendors, 318choosing, 64database, 280, 291JDBC driver provided by, 309, 310, 311knowing, 239-240, 307Vertical access to information, 279Video streaming, 75Views, 270, 278-280Virtual shopping carts, 197Visigenic, 58Visual Basic (VB), 335, 340Visual representation of data, 340wait() mechanism, 126WAR files, 53, 54Waste, 266W3C. See World Wide Web ConsortiumWeather information, 138, 336Web. See World Wide WebWeb applications, 22, 24with browser clients, 93-94defined, 2emergence of, 1growth rates, 4with nonbrowser clients, 94-95and parallelism, 76requirements, 25terminology, 23-25Web sites versus, 2Web browsers, 26, 27, 187, 336Web caching, 13, 33Web components, and transactions, 60-61Web containers, 50, 51, 135, 191Web event listeners, 50WebLogic Server, 174, 175WebLogic suite, 49Web pages, 2fetching, with HTTP, 98highly dynamic, 138-139for querying a specific city, 100, 103, 104with several embedded images, 111static, 36Web server farms, 34, 78Web server request redirectionand dynamic response generation, 151to Java servlets, 152to script processor, 151-152Web servers, 3, 36, 135extension of, through APIs, 150and HTTP requests, 148redundant, 79and servlet container integration, 154-157Web services, 333-368consumer's perspective on, 363definitions, 335, 350-351description of, 335-338developing, 349features, 337invoking with SOAP, 353-357practical use of, 334-335provider's perspective on, 362registering with UDDI, 357-362replication and load-balancing demands of, 364scalability and performance challenges with, 363-367technologies, 334, 338, 340technology stack, 339with WSDL, 349-353XML: self-describing data, 340-349Web Services Description Language, 339, 368available functionality with, 362document definitions, 350-351price-quoting service with, 351-353Web sites, Web applications versus, 2WebSphere, 49WHERE clause, 216, 275White pages, 358Wildcard tokens, 320Windows, 267 "Workers," 154Workflow processing, 234World Wide Web, 1. See also Internetnature of, and challenges with, 3-5requirements of, 27-29World Wide Web Consortium, 338DOM working group of, 343and SOAP, 353WSDL report, 349Write-through caches, and server farm, 127WSDL. See Web Services Description LanguageXA transaction standard, 60XML. See Extensible Markup LanguageXML files, deployment descriptors as, 55Xpath, 366XQL, 366XQuery, 365-366, 368parsing versus, 367Yahoo, 9, 28, 36Yellow pages, 358Zero-to-many relationship, between entities, 270