Book Image

Java EE 8 High Performance

By : Romain Manni-Bucau
Book Image

Java EE 8 High Performance

By: Romain Manni-Bucau

Overview of this book

The ease with which we write applications has been increasing, but with this comes the need to address their performance. A balancing act between easily implementing complex applications and keeping their performance optimal is a present-day need. In this book, we explore how to achieve this crucial balance while developing and deploying applications with Java EE 8. The book starts by analyzing various Java EE specifications to identify those potentially affecting performance adversely. Then, we move on to monitoring techniques that enable us to identify performance bottlenecks and optimize performance metrics. Next, we look at techniques that help us achieve high performance: memory optimization, concurrency, multi-threading, scaling, and caching. We also look at fault tolerance solutions and the importance of logging. Lastly, you will learn to benchmark your application and also implement solutions for continuous performance evaluation. By the end of the book, you will have gained insights into various techniques and solutions that will help create high-performance applications in the Java EE 8 environment.
Table of Contents (12 chapters)

HTTP and caching

Implementing an HTTP server is one of the main purposes of Java EE. Using the Servlet API, JAX-RS, or even JAX-WS, you can easily expose data over HTTP without caring for the transport.

However, HTTP defines a caching mechanism that is interesting to take into account in order to optimize the client's behavior.

The common communication with your server will look as follows:

The server makes a request and the client sends back some data in headers and a payload (which can be huge). On the previous schema, it is a JSON payload, but don't forget that your web applications will probably also serve images and other sorts of resources, which get big very quickly.

To avoid having to do it each and every time, even when nothing is changed (a picture will not change very often in general), the HTTP specification defines a set of headers that help identify the...