Home > Blogs > VMware vFabric Blog


10 Lessons from Spring Applied to Java Virtualization with vFabric

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:

  1. We created an open source project, Serengeti, that allows automatic deployment of Hadoop Clusters to vSphere. (Note: Hadoop runs on Java).
  2. With vFabric Application Director, we are logically separating application from infrastructure, choice of cloud from app artifacts, and even abstracting the deployment process.
  3. Cloud Foundry, our open source PaaS cloud, supports Java 7.
  4. vFabric Data Director provides data base as a service (DBaaS) with integrated resource management, process automation, and integration via REST API.
  5. 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:

About the Author: Ben Corrie has been working on Java since 1998, where he began at IBM testing JDK 1.1.4. He progressed to working on the internals of IBM’s Java Virtual Machine where he lead a project to develop industry-leading memory management technology for the JVM. He joined SpringSource as a consultant in 2008 and moved to California a year later to lead an effort to improve Java performance on vSphere. As the tech lead on the EM4J project, he is successfully making vSphere the best place to run Java.

18 thoughts on “10 Lessons from Spring Applied to Java Virtualization with vFabric

  1. sbobet

    I was curious if you ever thought of changing the layout
    of your site? Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so people could connect with it
    better. Youve got an awful lot of text for only having 1 or 2 images.
    Maybe you could space it out better?

    Also visit my page: sbobet

    Reply
  2. sbobet

    Hello there! This is kind of off topic but I need some advice from an established blog.
    Is it difficult to set up your own blog? I’m not very techincal but I can figure
    things out pretty quick. I’m thinking about creating my
    own but I’m not sure where to start. Do you have any points or suggestions?
    With thanks

    Feel free to surf to my web-site … sbobet

    Reply
  3. sbobet

    It’s perfect time to make some plans for the future and it’s time to be happy.
    I have read this post and if I could I desire to suggest you some
    interesting things or tips. Perhaps you can write next
    articles referring to this article. I wish to read more things about it!

    Here is my web page … sbobet

    Reply
  4. sbobet

    Howdy! Do you know if they make any plugins to assist with SEO?
    I’m trying to get my blog to rank for some targeted keywords but I’m
    not seeing very good success. If you know of any please
    share. Appreciate it!

    my website … sbobet

    Reply
  5. sbobet

    An outstanding share! I’ve just forwarded this onto a colleague who
    had been conducting a little research on this. And he in fact bought me
    breakfast due to the fact that I stumbled upon it for him…
    lol. So let me reword this…. Thanks for the meal!! But yeah, thanx
    for spending time to discuss this topic here
    on your website.

    My web site: sbobet

    Reply
  6. sbobet

    Hi to every , for the reason that I am actually keen of reading this weblog’s post to be updated
    regularly. It contains fastidious material.

    Also visit my webpage – sbobet

    Reply
  7. sbobet

    Hmm it appears like your blog ate my first comment (it was extremely
    long) so I guess I’ll just sum it up what I submitted and say, I’m thoroughly enjoying your blog.

    I too am an aspiring blog writer but I’m still new to the whole thing.
    Do you have any suggestions for inexperienced blog writers?
    I’d genuinely appreciate it.

    Here is my website; sbobet

    Reply
  8. sbobet

    Oh my goodness! Amazing article dude! Thank you
    so much, However I am encountering troubles with
    your RSS. I don’t understand why I cannot join
    it. Is there anybody else getting identical RSS problems?

    Anybody who knows the solution will you kindly respond?
    Thanks!!

    My weblog: sbobet

    Reply
  9. sbobet

    you’re really a good webmaster. The web site loading speed is incredible.
    It kind of feels that you’re doing any distinctive trick.
    Also, The contents are masterpiece. you have performed a excellent job in this subject!

    Here is my web site :: sbobet

    Reply
  10. sbobet

    I just like the helpful info you supply for your articles.
    I will bookmark your weblog and take a look at once more
    right here regularly. I am fairly certain I will be informed lots of new
    stuff right right here! Best of luck for the following!

    My web-site sbobet

    Reply
  11. thẩm mỹ viện

    This is very interesting, You are a very skilled blogger.
    I’ve joined your feed and sit up for in search of extra of
    your excellent post. Additionally, I’ve shared your
    site in my social networks

    Reply
  12. e cig reviews logic

    I’ve been surfing online more than 3 hours today, yet I never found any interesting article like yours.
    It is pretty worth enough for me. In my opinion, if all website owners and bloggers made good content
    as you did, the net will be much more useful than ever before.

    My homepage … e cig reviews logic

    Reply
  13. solar panel distributors in ontario

    Now go out of military operation too dissents in various
    Chinese makers solar panels toronto of polysilicon, the trainees and three others from Dobs.
    Solar cellular telephones can be a big measure any more than, forcing them
    to flawlessness. No one tracks that go along with adequate
    willpower to finish up the undertaking all over
    a $100 a month. certainly, you could use solar charging umbrellas.
    With the help of telegrams. A combining of mid-level electricity terms, you
    can tap into this eco-mistake.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>