Steve Jin, VMware R&D
This entry was reposted from DoubleCloud.org, a blog for architects and developers on virtualization and cloud computing.
Design patterns have been very popular among software developers since the book by Gang of Four (Enrich Gamma, Richard Helm, Ralph Johnson, John Vlissides) in 1995. If you go to an interview for a software engineering position today, the chances are you most likely get one or more questions on design patterns.
Like many concepts in software that from other disciplines, the “pattern” idea was “borrowed” from “A Pattern Language,” a book by Christopher Alexander on architectural patterns published 20 years before we started to talk about software design pattern. His book turns out to be a great way to summarize and document reusable design elements for different engineering works.
As Christopher points out, “Each pattern describes a problem which occurs over and over again in our environment, and then described the core of the solution to that problem, in such a way you can use the solution a million times over, without ever doing it the same way twice.”
Today I “borrow” the same idea and apply the concept to cloud computing on architecture designs. The main focus is on virtual machine-based architecture patterns so that you can best leverage virtual machines for your cloud computing.
What is a Cloud Architecture Pattern?
An architectural pattern extracts the common and re-usable design concepts and components. If we put it in the big picture, it should be somewhere below the overall system architecture and above software design as the middle layer.
Once you are familiar with a pattern, you can “borrow” it into your design. Instead of inventing everything from scratch, you can apply different patterns into a final architecture design. The main benefits are better architecture by leveraging proven expertise and saving time and effort.
In an Infrastructure-as-a-Service (IaaS) cloud, the very basic component is the virtual machine, whether it comes from VMware, Microsoft, XEN or KVM. Around the virtual machine, I will discuss:
- The creation of virtual machines. What are the possible ways to provision new virtual machines? When should you use which one? How to effectively manage their lifecycles? How should these virtual machines better support middleware and applications for performance and efficiency?
- The structure of virtual machines. What are the best ways to group virtual machines together for easy system management and application clustering? How to design networking/communication topology among them? How should you define the services that cross leverage a group of virtual machines?
- The behavior of virtual machines. How you can divide big responsibilities into smaller ones that can be hosted by individual virtual machines? How to effectively map applications to virtual machines? What are the best ways to embrace flexibility and future changes? How should each virtual machine behave for maximum overall result?
In this discussion, I will walk you through design challenges, provide you food for thought, and offer proven solutions for some of these challenges. It’s important to understand that the thinking process to reach the solution is as important as, if not more important than, the solution itself. Without this process, you may easily get lost while applying architecture patterns to a real world problem. It’s like working on your own car repairs. You need to understand how the car works before you can repair it. With cars and cloud computing, there are no two exactly similar problems in practice. As a designer, you have to make a judgment what differences matter or not.
To understand fully what a cloud architecture pattern is, it’s also very helpful to understand what it’s not and how it relates to others.
- Cloud architecture pattern is not software design pattern. The cloud architecture patterns speak a higher level of language and address system components versus the software design patterns that concern themselves mainly with a group of classes/objects. Having said that, to implement software components in your cloud, you most likely need software design patterns to help.
- Cloud architecture pattern is not the architecture itself. The patterns offer a solution to particular domain or particular aspects of challenges. To get an architecture done, you may end up using multiple architectural patterns. Most of the time, it’s not as simple as putting them together. Rather, it’s a process of integrating them together.
How to Describe a Cloud Architecture Pattern?
As mentioned, the pattern idea is nothing new. Its roots can be traced back to traditional building architecture. What is new is the context and the specific solutions. Format-wise, let’s just reuse the existing format that has proven to be effective.
Here are the eight common elements in a cloud pattern description:
1. Name. One or two words that identify the pattern.
2. Intent. A sentence with a high level description of the pattern.
3. Challenge or Motivation. Every pattern starts from a design challenge, just like every product starts from a customer pain (In reality it’s not always the case though). Each particular challenge comes with its own unique constraints on design.
4. Solution. With challenge understood, the goal is also clear. The solution afterwards should just hit the target. It offers details on how to solve the problem.
5. Applicability. Nothing is universal. The same is true for cloud patterns. To help real world projects, you have to know what patterns to apply and when you should apply them. There may be particular checklists that help you make your decision.
6. Consequences. While achieving some benefits by applying a pattern, you may give up others. It helps to know them beforehand. What trade-offs do you have to make?
7. Known uses. This provides references that connect you to real-world projects. They may or may not be close to your problem, but it’s definitely worthwhile to know cases that have been solved well.
8. Related patterns. The discussion of the relationship with others offers you not only a bigger picture but also clues on other patterns that you could leverage at the same time.
A Call for Action
While cloud computing is evolving, the related patterns are evolving as well. We will see new challenges, new changes in the technical and business environments. In this series of blog articles, I plan to cover about 10 patterns. I would ask you to share your thoughts on these patterns, and suggest more. Let’s develop a set of patterns that can benefit the whole cloud computing community!