My Account Log in

3 options

Hands-on high performance with spring 5 : techniques for scaling and optimizing spring and spring boot applications / Chintan Mehta, [and four others].

EBSCOhost Academic eBook Collection (North America) Available online

View online

Ebook Central Academic Complete Available online

View online

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Mehta, Chintan, author.
Language:
English
Subjects (All):
Spring (Software framework).
High performance computing.
Physical Description:
1 online resource (399 pages)
Edition:
1st edition
Place of Publication:
Birmingham ; Mumbai : Packt Publishing, 2018.
System Details:
Mode of access: World Wide Web.
text file
Summary:
A hands-on guide to creating, monitoring, and tuning a high performance Spring web application About This Book Understand common performance pitfalls and improve your application's performance Build and deploy strategies for complex applications using the microservice architecture Understand internals of JVM - the core of all Java Runtime Environments Who This Book Is For If you're a Spring developer who'd like to build high performance applications and have more control over your application's performance in production and development, this book is for you. Some familiarity with Java, Maven, and Eclipse is necessary. What You Will Learn Master programming best practices and performance improvement with bean wiring Analyze the performance of various AOP implementations Explore database interactions with Spring to optimize design and configuration Solve Hibernate performance issues and traps Leverage multithreading and concurrent programming to improve application performance Gain a solid foundation in JVM performance tuning using various tools Learn the key concepts of the microservice architecture and how to monitor them Perform Spring Boot performance tuning, monitoring, and health checks In Detail While writing an application, performance is paramount. Performance tuning for real-world applications often involves activities geared toward detecting bottlenecks. The recent release of Spring 5.0 brings major advancements in the rich API provided by the Spring framework, which means developers need to master its tools and techniques to achieve high performance applications. Hands-On High Performance with Spring 5 begins with the Spring framework's core features, exploring the integration of different Spring projects. It proceeds to evaluate various Spring specifications to identify those adversely affecting performance. You will learn about bean wiring configurations, aspect-oriented programming, database interaction, and Hibernate to focus on the metrics that help identify performance bottlenecks. You will also look at application monitoring, performance optimization, JVM internals, and garbage collection optimization. Lastly, the book will show you how to leverage the microservice architecture to build a high performance and resilient application. By the end of the book, you will have gained an insight into various techniques and solutions to build and troubleshoot high performance Spring-based applications. Style and approach This book takes...
Contents:
Cover
Title Page
Copyright and Credits
Packt Upsell
Contributors
Table of Contents
Preface
Chapter 1: Exploring Spring Concepts
Introducing the Spring Framework
Problems with EJB
Simplifying implementation using POJO
Benefits of the Spring Framework
No need to reinvent the wheel
Ease of unit testing
Reduction in implementing code
Inversion of control and API
Consistency in transaction management
Modular architecture
Up to date with time
Understanding Spring modules
Core Container
Crosscutting concerns
Data Access/Integration
Web
Spring projects
Spring Boot
Spring Data
Spring Batch
Spring Cloud
Spring Security
Spring HATEOAS
Spring's IoC container
What are Spring beans?
Instantiating a Spring container
BeanFactory
ApplicationContext
Spring bean life cycle
New features in the Spring Framework 5.0
Baseline upgrades
Reactive programming support
Core features upgrades
Spring Web MVC upgrades
Spring's new functional web framework - WebFlux
Modularity support
Kotlin language support
Improved testing support
Dropped or deprecated features
Summary
Chapter 2: Spring Best Practices and Bean Wiring Configurations
Dependency injection configurations
Types of DI patterns
Constructor-based DI
Advantages of the constructor-based DI
Disadvantages of the constructor-based DI
Setter-based DI
Advantages of the setter-based DI
Disadvantages of the setter-based DI
Field-based DI
Constructor versus setter injection
Configuring the DI with Spring
XML-based configuration
Java-based configuration
Annotation-based configuration
The @Autowired annotation
@Autowired with required = false
The @Primary annotation
The @Qualifier annotation.
Automatic bean detection with stereotype annotations
The @ComponentScan annotation
The @Lazy annotation
Spring bean scopes
Performance assessment with different configurations
Lazy loading versus preloading
Singleton versus prototype bean
Spring bean configuration best practices
DI pitfalls
First pitfall
Second pitfall (with AOP)
Chapter 3: Tuning Aspect-Oriented Programming
AOP concepts
Limitations of OOP
Code tangling
Code scattering
AOP - problem solver
Spring AOP terminology and concepts
Defining pointcuts
Types of advice
Aspect instantiation models
AOP proxies
JDK dynamic proxies and CGLIB proxies
ProxyFactoryBean
ProxyFactoryBean in action
Performance JDK dynamic proxy versus CGLIB proxy
Caching
AOP method profiling
PerformanceMonitorInterceptor
Custom monitoring interceptor
Spring AOP versus AspectJ
What is AspectJ?
Differences between Spring AOP and AspectJ
Capabilities and goals
Weaving
Join points
Simplicity
Performance
AspectJ with Spring
AOP best programming practices
Pointcut expressions
Advice ordering
Best practices of AOP proxies
Chapter 4: Spring MVC Optimization
Spring MVC configuration
Spring MVC architecture
Configuring front controller
Creating a Spring application context
Configuring ViewResolver
Creating a Spring application context and configuring a ViewResolver
Creating a controller
Creating a view
Spring asynchronous processing, @Async annotation
@Async annotation modes
Fire and forget mode
Result retrieval mode
Limitations of @Async annotation
Thread pool executor
CompletableFuture with Spring Async.
runAsync() - running a task asynchronously
supplyAsync() - running a task asynchronously, with a return value
Attaching a callback to the CompletableFuture
Spring Security configuration
Configuring Spring Security dependencies
Configuring a security filter for incoming requests
Configuring Spring Security
Adding a controller
Authentication cache
Implementing the caching configuration class
Providing UserCache to AuthenticationProvider
Providing AuthenticationProvider to AuthenticationManagerBuilder
Fast and stateless API authentication with Spring Security
API authentication with the JSESSIONID cookie
API authentication without the JSESSIONID cookie
Monitoring and managing Tomcat with JMX
Connecting JMX to monitor Tomcat
Creating an MBean
Exporting an MBean in a Spring context
Spring MVC performance improvements
High performance using connection pooling
Hibernate improvements
Testing improvements
Proper server maintenance
Using the authentication cache with Spring Security
Implementing Executor service framework
Chapter 5: Understanding Spring Database Interactions
Spring JDBC configuration
Problems with core JDBC
Solving problems with Spring JDBC
Spring JDBC dependencies
Spring JDBC example
Database design for optimal performance
Table design
Vertical partitioning of a table
Use indexing
Using the correct data type
Defining column constraints
Using stored procedures
Transaction management
Choosing a transaction manager in Spring
Declarative ACID using @Transactional
Optimal isolation levels
Read uncommitted
Read committed
Repeatable read
Serializable
Optimal fetch size
Optimal connection pooling configuration
Sizing the connection pool
Validate connections
Connection leaks.
Tomcat JDBC connection pool versus HikariCP
Reliability
Features
Ease of use
Database interaction best practices
Using Statement versus PreparedStatement versus CallableStatement
Using Batch instead of PreparedStatement
Minimizing the use of database metadata methods
Using get methods effectively
When to avoid connection pooling
Choose commit mode carefully
Chapter 6: Hibernate Performance Tuning and Caching
Introduction to Spring Hibernate and Spring Data
Spring Hibernate
Spring Hibernate configuration
Spring with JPA using Hibernate
Spring Data configuration
Common Hibernate traps
Hibernate n + 1 problem
The open session in view anti-pattern
Unknown Id.generator exception
Hibernate performance tuning
Approaches to avoid the n + 1 problem
Fetch join using JPQL
Join fetch in Criteria API
Named entity graph
Dynamic entity graph
Finding performance issues with Hibernate statistics
Using query-specific fetching
Caching and its best practices
First level cache
Second level cache
Query cache
Performing updates and deletes in bulk
Hibernate programming practices
Miscellaneous
Chapter 7: Optimizing Spring Messaging
What is messaging?
What is AMQP?
Problems with the JMS API
Why do we need AMQP?
Differences between AMQP and the JMS API
Platform compatibility
Messaging models
Message data type
Message structure
Message routing
Workflow strategy
What are exchanges, queues, and bindings?
Exchange
Queue
Binding
Introducing RabbitMQ
Setting up the RabbitMQ server
Spring messaging configuration
Configuring a Maven dependency for RabbitMQ
Configuring RabbitMQ
Configuring ConnectionFactory
Configuring a queue.
Configuring an exchange
Configuring a binding
Configuring RabbitAdmin
Configuring a message converter
Creating a RabbitTemplate
Configuring a listener container
Creating a message receiver
Creating a message producer
Maximizing throughput with RabbitMQ
Performance and scalability with RabbitMQ
Chapter 8: Multithreading and Concurrent Programming
Java classical threads
Creating threads
Thread life cycle and states
More advanced thread tasks
Synchronizing threads
Issues with multithreading
The java.util.concurrent package
Executors
ThreadFactory
Synchronizers
Concurrent collection classes
Lock
Callable and Future
Atomic variables
Using thread pools for asynchronous processing
Spring task execution and scheduling
TaskExecutor
TaskScheduler
Spring Async
The @EnableAsync annotation
The @Async annotation
@Async with CompletableFuture
Spring and threads - transactions
Java threads best programming practices
Chapter 9: Profiling and Logging
Performance profiling
Application performance
Application logging and monitoring
Application logging
Logging best practices
Logging tools
Java standard logging
Apache Log4j 2
Application monitoring
Stagemonitor
Pinpoint
MoSKito
Glowroot
New Relic
Profiling tools
VisualVM
JConsole
Chapter 10: Application Performance Optimization
Performance issue symptoms
Timeouts
Running out of worker threads
Threads waiting on class loaders
Time spent on class-loading activities
Class loader trying to load non-existent classes
Performance tuning life cycle
Connection pooling
Hibernate
Transaction
Periodical clearing of Hibernate sessions
Lazy initialization
Constructor-based HQLs
Entity and query caching.
Native queries.
Notes:
Includes index.
Includes bibliographical references and index.
Description based on print version record.
ISBN:
9781788830638
1788830636
OCLC:
1042326024

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Library Catalog Using Articles+ Library Account