BUILDING SCALABLE JAVA WEB APPLICATIONS
Ouvrage 9780201729566 : BUILDING SCALABLE JAVA WEB APPLICATIONS
Building Scalable and High-Performance Java™ Web
Applications Using J2EE™ Technology
provides the concise roadmap Java developers and
Web engineers need to build high-performance
and scalable enterprise Web applications. It is
unique in its focus on building efficient end-to-end
solutions based on the widely adopted J2EE
specification. Each of the relevant technologies is
summarized and analyzed in terms of its scalability
and performance implications. Special attention
is also given to those parts of Web application
design that extend beyond the J2EE specification,
including strategies for efficient networking and
database design.
Packed with general system architecture tips and
balanced with succinct examples for each
technology, this book allows you to focus on
practical strategies for effective application design
without getting overwhelmed with useless detail. As
a result, you will quickly and easily be able to
understand how to use J2EE technologies to build
application systems that deliver scalability and
high performance.
Coverage includes:
Essentials of Web application architecture
The J2EE standard
General techniques for building scalable and
high-performance systems
The HTTP protocol, with special focus on
features that maximize performance
Java™ Servlets and JavaServer Pages™ (JSP)
Enterprise JavaBeans™ (EJB)
Java™ Message Service (JMS)
Effective database design techniques
Efficient database management with JDBC™ and
SQL
Essentials of Web Services, including XML,
SOAP, WSDL, andUDDI
A CD-ROM with relevant source code from various
chapters accompanies this book.
Preface
Over the last few years, it has suddenly become
very complicated to build efficient Web
applications. At its core, a Web application simply
provides some functional service_the capability
to process book orders, place hotel reservations,
execute search engine queries, and so on.
Conceptually, all that is really involved at any
one time in this process are a client and a server_the
client makes requests; the server processes them
and returns responses. To make an application
efficient, it seems that we just need to optimize
server request processing. That's it, right? Well, not
quite.
The problem is that the practical matter of
actually building a Web application requires that you are
at least somewhat familiar with a slew of
server-side technology options_Java Servlets, Perl, CGI
scripts, XML, JDBC, SQL, JavaBeans, JavaServer
Pages, and CORBA, to name a few. These are
the options to pick and choose from when actually
designing an end-to-end infrastructure. Once you
find the technologies you want to use, the task
then becomes one of understanding how to connect
them all together. Finally, to make things fast,
you need to optimize their deployment and
integration.
Suddenly, everything just got more complicated.
Now, it seems like you have to go out and buy a lot
of books about new technologies, read them, and
figure out some way to connect them all such that
your application becomes both fast and scalable. In
addition to all of this being a costly, bottom-up
process, many of these books are not small_I mean
we're talking about more than 800 pages on
subjects like XML alone! Many of them dive into way
too much detail about issues you may not need
to useor even care about. In other words, it's a
time-consuming, confusing process just to read
everything and filter out those parts of each book
that are relevant to your needs. Making things
worse, because since these books are all very
specific, few if any, address the bigger picture of
building an overall Web application.
Fortunately, there are now some unifying
application infrastructures that specify how to connect sets
of these individual technologies together in a way
that encourages high performance and scalability.
One of the most popular infrastructures is that
proposed by the Java 2 Enterprise Edition (J2EE)
specification.
The J2EE™ spec not only describes how to integrate
specific Java programming language
technologies to build a complete application, it
also specifies a set of core services targeted at
improving the inherent efficiency of a Web
application deployed on its foundation. In particular, these
platform services address topics such as
multithreading, transactions, security, caching, component
replication, and resource pooling.
Still, understanding J2EE is daunting_you either
need to read a lot of books about each J2EE
technology (such as servlets or JDBC) or consult an
abstract magazine article that does not provide
enough detail. The actual specification is not the
kind of thing that most people would enjoy reading.
In short, there simply are not any good practical
summaries of J2EE out there. What's more, the
current J2EE books are not well rounded; like the
spec, they tend to focus on only the Java
application-level technologies. Usually little or
no attention is given to other important system issues
related to application integration and deployment.
Where Does This Book Fit In?
This book was written to fill the need to have a
well-rounded, practical summary of J2EE technology
with specific emphasis placed on improving
performance and scalability. A delicate balance must be
struck_one that introduces new technologies and
their relationships and provides enough examples
for people to actually see how things work. The
objective is not to go too far overboard to produce an
overly long book that lacks focus, or one that
actually could cause injury when lifted. Thus, this
book's goal is to summarize succinctly.
We'll cover it all_from the spec itself to
servlets, EJBs, messaging, JDBC, and more. Along the
way, there will be plenty of examples and many will
be presented with deliberate brevity. The idea
being, it is better to "cut to the chase" of how to
use a technology rather than to show so many gory
details that the reader's eyes glaze over. As we
know, there already are plenty of books that address
these details. When you've decided what parts of
J2EE are relevant to you, consult books that will
complement this one.
In being a "well-rounded" summary, another purpose
of this book is to fill in the holes about Web
application design that the J2EE spec simply does
not address. Although the specification shows
how to connect different Java technologies and
application programming interfaces (APIs) to build an
enterprise application infrastructure, it does not
address related issues such as networking or
database design. For example, even though the spec
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, there are no details about either HTTP
or relational databases. As any seasoned Web
application designer knows, however, understanding
both is critical when designing a system for
high performance and scalability.
This Book's Goals and Audience
To summarize, 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 road map
for designing web applications.
To describe key J2EE technologies in moderate
detail, emphasizing those 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, "connection
pooling is good," which is the approach that many
books take. It is more convincing and clear,
however, if real performance charts and graphs help to
back up these claims. This book aims to achieve
that goal.
Building Scalable and High-Performance Java™ Web
Applications Using J2EE™ Technology
is written for any engineer or architect who is
proficient with the Java programming language and
wants to build Java-based Web applications for
scalability and high performance, but who does not
yet understand how J2EE can be used toward that
goal or how all its underlying technologies work.
This book is also for those that want to see beyond
the J2EE spec_in particular, to consider some
issues related to networking and database design,
as well as the implications of multitier (or n-tier)
application designs. Finally, this book is for
those that already use some parts of J2EE technology,
such as servlets, but not others, such as the Java
Messaging Service.
Performance Measurements
Throughout the book, there are various performance
measurements and comparisons. Although the
same general trends will 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 here.
All tests were conducted on a Dell Latitude
containing an 833MHZ Pentium III with 256KB 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);
Jakarta/Tomcat servlet container, version 3.2.1;
and Oracle 8.1.6.
Onward . . .
My hope is that this book can be used 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 need to address
questions like these: "Do I place the business
logic in the database or the application server?"
"Should our batch data transfer go through a web
server or a messaging server?" Independent of the
details associated with each of these kinds of
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.
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.
Auteur : BARISH
Editeur : ADDISON WESLEY
Nombre de pages : 392
Date de publication : 01 2002
Toute la sélection
Toutes les sélections
Toute la sélection
Site réalisé en partenariat avec Courbis
(Courbis - alternate link), acteur de l'Internet depuis 1988...