Welcome!

Security Authors: Jason Thompson, Jackie Kahle, Liz McMillan, Xenia von Wedel, Elizabeth White

Related Topics: Cloud Expo, SOA & WOA, Web 2.0, Security, Big Data Journal, SDN Journal

Cloud Expo: Article

Basic Cloud Computing Patterns for Application Development

Design patterns help not only in the development process but across the application development life cycle

Over the past few years, the cloud evolution has answered all questions on the cloud being the right strategy. The key challenge that remains now is leveraging cloud capabilities and features in such a way that they can be used to innovate as well as solve business problems. If we relate different cloud migration strategies executed over time, we'll find many similarities. There has been focus on cloud assessment as well as a consideration for application development approaches. Even though business cases are different, we can still link the proposed or implemented cloud-based solutions with a set of design patterns. If we have to define a design pattern, the most common definition states it as, ‘A widely used concept in computer science to describe good solutions to re-occurring problems in an abstract form.' Any abstract solution to recurring problems in the domain of cloud computing can be referred to as a cloud computing pattern that is independent of concrete providers, products and programming languages.

The following are some basic application architecture patterns. Most of these were referred to as cloud best practices in the beginning. As we come across multiple real-time implementations, we shall be able to easily identify a pattern in them.

Composite Application
On a higher level, traditional application architecture has to deal with challenges such as difficulties integrating with other applications and lack of flexibility for supporting changing functionalities in an application lifecycle. Since in a cloud environment applications can be scaled individually, it's always a good option to divide the application functionality into multiple components that can later be integrated to form a unified application.

Composite applications are one of the main elements in service-oriented architecture (SOA) that help in contextual collaboration. This approach makes applications extendable right from the beginning. The integration of other applications is also simplified by using the same integration techniques inside individual applications.

Example of a Composite Application for a Travel Booking Process

The key to a successful implementation of this pattern is achieving the correct balance in the distribution of functionality across multiple components. With too few components, integrating new functionality and changing the application flexibly will need extra time due to likelihood of errors. On the other hand, if the functionality is distributed among too many components, there will be a higher communication overhead for the application to perform. Composite application patterns used along with loose coupling (explained earlier) helps extract the benefits of cloud features like elasticity, payment models and standardized management.

Loose Coupling
In essence, loose coupling isolates the various layers and components of your application so that each component interacts asynchronously with the others and treats them as a "black box." The key principal for this pattern is to reduce the set of assumptions for the information exchange between components, which eventually results in better scalability.

Decoupling your components, building asynchronous systems and scaling horizontally become very important in the context of the cloud. It will not only allow you to scale out by adding more instances of the same component but also allow you to design innovative hybrid models in which a few components continue to run ‘on-premise' while the other components can take advantage of the ‘cloud-scale' and use the cloud for additional compute-power and bandwidth.

The following is a sample illustration of decoupling components using queues and AWS specific tactics:

Ref: Whitepaper on Architecting for the AWS Cloud: Best Practices.

AWS specific techniques for implementing this best practice are as follows:

  1. Use Amazon SQS to isolate components
  2. Use Amazon SQS as a buffer between components
  3. Design every component in a way that it exposes a service interface and is responsible for its own scalability in all appropriate dimensions and interacts with other components asynchronously
  4. Bundle the logical construct of a component into an Amazon Machine Image so that it can be deployed more often
  5. Make your applications as stateless as possible. Store session state outside of component (in Amazon SimpleDB, if appropriate)

Loose coupling normally results in performance reduction because asynchronous communication using messages adds a lot of overhead due to the communication path being longer. Though it needs to be weighed between loose coupling and performance, things can be easily handled by scaling resources out.

Elastic Component
As an application is componentized, components are distributed among multiple compute nodes. The system utilization is tracked by these nodes using parameters like CPU load, memory usage, or network I/O for scaling decisions. As the utilization of compute nodes exceeds a specified threshold, additional hosting components are provisioned that contain the same application component.

In cloud, elasticity can be implemented in three ways:

  1. Proactive Cyclic Scaling: Periodic scaling that occurs at fixed interval
  2. Proactive Event-Based Scaling: Scaling just when you are expecting a big surge of traffic requests due to a scheduled business event
  3. Auto-scaling based on demand

Other Cloud Computing Patterns
The following are some other commonly used cloud computing patterns:

Stateless Component
In regular component-based applications in cloud, the chances of failure increase as components can be distributed across multiple nodes. Components are added/ removed to address scalability needs with changes in demand. ‘Stateless Components' is a pattern in which components do not contain any internal state, rather external persistence storage is used for state management.

Map-Reduce
The Map-Reduce pattern is used to achieve performance requirements for complex queries on large data sets as most of the conventional storage solutions do not support such queries natively. Map-Reduce is often used to query large amounts of weakly structured/unstructured data for analysis purposes. For example, it can be used for the analysis of web service logs to determine user access statistics or the analysis of order information to find popular products.

Design patterns help not only in the development process but across the application development life cycle. In their abstracted form, patterns make themselves applicable to challenges that the developers of cloud application face today that are independent of the actual technologies as well as cloud services that are being used. Applying them to the cloud lets your application extract maximum benefits of cloud platforms.

More Stories By Mahesh Kumar

Mahesh Kumar is currently working as a Senior Tech Lead at Harbinger. He is a member of Technology Forum and Proposal Engineering Group at Harbinger Systems. He is an active contributor in the technology arm of Harbinger’s Marketing division. Mahesh Kumar has over 7 years of experience in design and development of Enterprise Applications in BI, Healthcare and eLearning domain. His core technology expertise is in Java, J2ee, Java Frameworks and libraries, Android, Big Data and Cloud. He is frequently invited as a guest speaker at Management Colleges and Universities.

Mahesh Kumar holds a Bachelors of Engineering in Information Technology from University of Pune, India.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.