SpringSource's Adrian Colyer Details Spring in Production
Adrian Colyer from SpringSource (formerly called Interface21) hosted a webinar on "Spring In Production" topic three weeks ago. The presentation covered the topics on Spring Runtime Kernel architecture, how Spring supports enterprise services like transactions, data access, security, and messaging, and how to tune a Spring-powered application. A white paper on this presentation is now available for download from their website.
Adrian starts the presentation with an overview of Spring Runtime saying that it is responsible for creating and managing the application components, and for managing the execution of the requests serviced by those components.
The presentation covers the following three sections:
- Kernel. It consists of AOP (Aspect Oriented Programming), Resource Loading Components, and Event server. The kernel instantiates and configures the application components and manages the invocations for all requests serviced by those components. Adrian explains the inner workings of the kernel with steps of bootstrapping, configuration and assembly as well as the post processing and life cycle management of the application components. He also explains the details behind the request dispatching, resource loading, and event management.
- Enterprise Services Layer. The runtime components in the enterprise service layer are plugged into the kernel using Spring extension mechanisms such as namespace handlers and post-processors. These components provide support for transaction management, data access, exception management, messaging, and security. This section also describes how Spring runtime supports JMX Integration and Web Requests Handling requirements.
- Performance Tuning. Adrian recommends a "measure first" approach to tune a Java EE application using the Spring framework, so the developers can avoid any premature optimization related issues. Measuring the application performance involves using tools such as Apache JMeter, Selenium, JAMon, and a code profiler (JProfiler or Yourkit Profiler) to find out the hotspots and establish the baseline of response times in each layer in the application. He suggests that developers utilize in-container resources for database connection pooling, JMS messaging, and JMX management purposes. He also offers design tips on when to use Hibernate versus JDBC queries and to make use of Hibernate Statistics object to understand what's happening at runtime in the ORM layer.
Adrian concludes the presentation by urging the developers to take the advantage of runtime optimizations such as moving an operation that contains only persistence logic (no business logic) into the database as a stored procedure and to consider using Spring's asynchronous task executors for tasks that can be run in the background.
Speaking to InfoQ, Adrian said the focus of the series will be "on applied topics - rather than simply explaining product features, the webinars and white papers will address best practices in developing and deploying Spring-powered applications". The next event in the webinar series will be hosted early next year.
Some of the topics for the future presentations include:
- Best practices for configuring and testing Spring applications.
- Spring and Extreme Transaction Processing.
- Spring applications deployed on specific server environments such as WebLogic, WebSphere, and Oracle application servers.
Production Monitoring of the Spring Container itself
It is unfortunate Adian did not touch on issues that I mentioned to him during our discussions including the performance penalty for AspectJ load time weaving (blog.jinspired.com/?p=133), lack of integration with a mature problem diagnostics framework, and resource transaction analysis which is especially important considering the fact that Spring is offering it own transaction management configuration outside of the Java EE specifications.
Randy Shoup Jul 03, 2015