Hands-on high performance with spring 5 techniques for scaling and optimizing spring and spring boot applications

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 in...

Descripción completa

Detalles Bibliográficos
Otros Autores: Mehta, Chintan, author (author)
Formato: Libro electrónico
Idioma:Inglés
Publicado: Birmingham ; Mumbai : Packt Publishing 2018.
Edición:1st edition
Materias:
Ver en Biblioteca Universitat Ramon Llull:https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009630634106719
Tabla de Contenidos:
  • 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)
  • Summary
  • 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
  • Caching
  • Summary
  • Chapter 4: Spring MVC Optimization
  • Spring MVC configuration
  • Spring MVC architecture
  • XML-based configuration
  • Configuring front controller
  • Creating a Spring application context
  • Configuring ViewResolver
  • Java-based configuration
  • Configuring front controller
  • 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
  • Summary
  • 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
  • Performance
  • 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
  • Summary
  • Chapter 6: Hibernate Performance Tuning and Caching
  • Introduction to Spring Hibernate and Spring Data
  • Spring Hibernate
  • Spring Data
  • 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
  • Caching
  • Miscellaneous
  • Summary
  • 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
  • Summary
  • 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
  • Summary
  • 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
  • Summary
  • 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.