The Spring Framework became the de-facto standard for developing enterprise Java applications, and its radical simplicity was fundamental to its success. Why the “radical” simplicity? Because at the time, it was hard to imagine how creating such applications could be made simple.
By tackling issues such as portability, understanding the importance of cross-cutting concerns, and making it trivial to develop automated tests, Spring allowed developers to focus on what matters: what makes their application unique.
As I was pulling together my presentation for SpringOne2GX 2012, I reflected on the parallels between Spring’s success and the direction we were going with EM4J. Why did Spring succeed? Why did simplification win? Where are we replicating these patterns within VMware, vFabric, and Java?
In short, complexity is expensive, and simplification has many economic benefits. By giving people better, simpler, and easier to use tools to help build, run, and manage applications, we create economic advantages.
In a nutshell, there are some core reasons why Spring succeeded, “Spring values” if you will: Reducing complexity, increasing productivity, provisioning flexibility, tooling and monitoring, extensibility, automation, flexible integration and ease of testing.
In the same way that Spring simplified enterprise Java development, the 10 examples below tie these “Spring values” back to how VMware can help simplify the virtualized or software defined data center and keep VMware, vFabric, and Java on the CIO agenda.
1. faster Performance tuning using built-in Monitoring tools
One of the significant benefits of coding to a framework is the baked-in goodness that comes with it. Spring Insight Developer and Insight Operations improved visibility into what applications are doing. With the Elastic Memory for Java (EM4J) Console Plugin for vCenter, we’ve brought significant visibility into Java processes right into the heart of the datacenter. This allows vSphere admins to drill down a level deeper, to see the workloads running in a VM. It contains historical graphing designed specifically to give confidence in right-sizing VMs running Java. It also gives great before/after comparison points when using both guest ballooning and EM4J ballooning In the video below, we spend a significant amount of time covering how this monitoring works from both a conceptual and concrete perspective with metrics and examples. In the screen shot below, we can see the console metrics on the left and a conceptual explanation of the memory allocation on the right.
2. faster application development through automatic memory Optimization
Spring helped us write better structured, more maintainable, less error-prone and ultimately more performant code. Understanding how to apply system resources efficiently should not necessarily have to be the concern of the developer. With EM4J Ballooning, we introduce a way to optimize memory usage in JVMs. The video below goes into quite a significant level of detail on how EM4J ballooning engages the JVM co-operatively in the memory management framework of the entire virtual cluster, ensuring that memory is always available where its needed and efficiently cleaned up where it’s not.
3. Better Productivity using Automation and virtualization together
Two mantras which were drilled into me early on in my career and which have stuck with me since, are: “If you ever do anything more than 3 times, write a script” and “work smarter, not harder”. These simple statements speak to the heart of what automation is about: working smarter, not harder. In an ideal world, the only limit to the speed and scale of what we can test should be the amount of hardware available to us.
When we approached the challenge of function testing EM4J, the matrix of configuration combinations was daunting, roughly 2600 different permutations, each of which had to run a 15-30 minute test. Our target was to be able to run them all overnight, a goal that neither Automation or Virtualization alone could have achieved. The combination of the two however, was dynamite.
As you can see in the screenshot below, we were not only able to automate the deployment, configuration and execution of the tests, but the monitoring, stats collection and reporting too. We use a simple vSphere Ruby API to create VMs and vMotion them. We use VIJava, Chef, and jSCH to push the guest and Java configuration. We use REST to manage the app servers, and we record QoS via HTTP, vCenter and GC stats with JMX. All the results are built out in a CSV format that is then loaded into an analysis spreadsheet.
Automation is key to being able to build and test applications that scale. Through automated deployment and management APIs, vSphere and vFabric facilitate this kind of flexibility.
4. Place Configuration and Flexibility At the Forefront of Application Design
Through dependency injection and abstracted configuration, the Spring Framework put the notions of configuration and flexibility at the forefront of application design. Virtualization gives you the power to apply configuration to the area of system resource management to allow for huge flexibility in deployment and runtime.
Many of the VMware and vFabric products are focused on these areas of provisioning and runtime resource management both of which pair well with automation and scripting. These are key features of a software defined data center.
5. Deployment Simplicity and Flexibility Speed Development
Spring made provisioning simple by helping to improve developer deployment steps and architecture patterns for cloud-oriented scale. At a higher level, virtualization is now the perfect enabler of automated provisioning at the infrastructure or cluster level. Some examples of where VMware and vFabric are leveraging this capability are:
- We created an open source project, Serengeti, that allows automatic deployment of Hadoop Clusters to vSphere. (Note: Hadoop runs on Java).
- With vFabric Application Director, we are logically separating application from infrastructure, choice of cloud from app artifacts, and even abstracting the deployment process.
- Cloud Foundry, our open source PaaS cloud, supports Java 7.
- vFabric Data Director provides data base as a service (DBaaS) with integrated resource management, process automation, and integration via REST API.
- vSphere has provisioning built into it’s core with vApps—the ability to package clusters of VMs and manage them as a single entity. As well, VM snapshots of build processes and linked clones make updates much simpler.
6. Faster, Less Risky Integration
Integration has always been expensive and complicated. Capabilities of products like Spring Integration, Spring Batch, Spring Data, and Spring AMQP all make integration easier. Integration is at the very heart of the vFabric value proposition: A suite of products designed and demonstrated to work together. This is clearly evidenced by the latest vFabric Reference Architecture. As well, vFabric RabbitMQ’s polyglot capabilities make it possible to speak to mainframes, devices over MQTT, and power websites like MercadoLibre.
7. Solid Tools and Frameworks Aid Developer Productivity
Clearly the Spring Framework helped developers become more productive—build and test apps more quickly and reliably, help develop faster with Spring, Groovy, and Grails. With vFabric, the code can be instrumented and monitored along with the application-tier and infrastructure-tier metrics. This allows for benefits like faster time to resolution, fewer bugs, and fewer all-nighters. The whole notion of Cloud arguably places more demands on tooling in not only being able to diagnose and detect Quality of Service (QoS) issues and bugs, but also in providing best practice, opinionated and proven methodologies and patterns of development.
8. Easier Packaging and Deployment Allows Management of Multi-VM Applications as a Whole
Following on from the discussions on automation and provisioning flexibility comes packaging and grouping of common services or applications. By building vApps inside VMware Studio, you can package and manage multi-VM applications as a single entity allowing for higher level management and configuration of the vApp as a whole. It also has the benefit of being able to deliver a complete system to customers as a black box. So how does this apply to Java and vFabric? The first-class support for Java introduced in vFabric brings a number of benefits to vApp development, most significantly the memory management and right-sizing capabilities of EM4J, which takes a lot of the guesswork out of memory sizing. Bundling EM4J can give vApps a significant edge in not only being able to elegantly deal with memory pressure, but also give the customer confidence that memory is being effectively and efficiently managed inside the VMs.
9. Abstraction Streamlines Development and Runtime Optimization
With Spring, the decoupling of the data layer, abstraction of application server configuration and flexibility of resource management such as transaction support through AOP provided a model for the application to easily scale and grow with the needs of the enterprise. In the datacenter, the various layers of abstraction, all tied together with a Distributed Resources Scheduler (DRS) allows you to load balance VMs and JVMs, save power during lower loads by powering down hosts, and dynamically allocate available vSphere servers based on monitored utilization. With vMotion, you can migrate running VMs between hosts and eliminate application downtime. These features allow devops to grow distributed enterprise Java applications with the needs of the enterprise and optimize the costs for running apps.
10. Scale and Uptime
For developers, architecture for scale is important, and Spring provides opinionated and proven patterns and models for doing just that. With VMware High Availability (HA), simple, inexpensive HA is built in—so, a physical server failure starts VMs automatically on other production machines with spare capacity and an OS failure restarts the VM.
The full video can be seen here: