Grounded in the Cloud
cancel
Showing results for 
Search instead for 
Did you mean: 

Using Twelve-Factor App Methodologies in Cloud Foundry

Stephen_Spector

Author: Amy Feldman, Solutions Marketing, HP Helion 

 

Enterprises are interested in refactoring old applications or developing new applications that are scalable, portable, resilient and update easily.  To solve this challenge, many look at adopting cloud services and micro-service architectures.  However its not as easy as just lifting and shifting your application to the cloud or splitting your application into smaller containers.  It has to be redesigned and re-architected in a way that takes full advantage of these new technologies.  Where do you start?  

 

In recent years many developers refer to the twelve-factor app methodology as one approach for building software-as-a-service applications.  This methodology can be applied to applications written in any programming language and which use any combination of backing services (database, queue, memory cache, etc). The twelve-factors include best practices for codebase, dependencies, config, backing services, build/release/run, processes, port binding, concurrency, disposability, dev/prod parity, logs and admin processes. Even though this methodology was designed for building Heroku applications, similar principles can be applied to building an application on Cloud Foundry in the following examples:   

  • Dependencies - For consistency of libraries and systems used across dev/test and production it is key to explicitly declare and isolate dependencies.  This is typically done through a dependency declaration manifest.  In Cloud Foundry, buildpacks provide framework and runtime dependencies for the application.
  • Config - Store config in environment variables helps to ease the changes needed between dev, test and production. In Cloud Foundry the manifest file contains a variety of environment variables from how many instances to create and how much memory to allocate to config details of what services applications should use. This helps to simplify config and reduce errors during deployments.    
  • Backing Services - Treat backing services such as datastores, messaging or caching systems as attached resources to easily swap out services without having to make changes to the code.  In Cloud Foundry you can easily bind services with the command cf create-service and cf bind-service APPLICATION SERVICE_INSTANCE
  • Concurrency - Scaling out an application is key to handling user load and concurrent requests.   In Cloud Foundry scaling an application creates or destroys instances of the application.  Incoming requests to the application are automatically load balanced across all application instances which handles tasks in parallel with every instance.  

These are just a few examples of how the twelve-factor app methodology applies to Cloud Foundry making it easier to design and develop cloud-native applications.

 

Interested in learning more?  If you live in the Seattle area join us at the February 25 Cloud Foundry Seattle meetup where Colin Henry, an Engineering Manager at HP Helion will walk through aspects of a twelve-factor app and how to apply them in an application written in Google Go. He will discuss the trade-offs and composing microservice architectures using twelve factor services.  Can’t make the meetup or don’t live in Seattle, no worries, we will record this session and post it on a follow-up blog.  

 

Video Stream for Meetup

YouTube
Google Hangout

 

Resources

12 factor application

http://docs.cloudfoundry.org/devguide/deploy-apps/prepare-to-deploy.html

Senior Manager, Cloud Online Marketing
0 Kudos
About the Author

Stephen_Spector

I manage the HPE Helion social media and website teams promoting the enterprise cloud solutions at HPE for hybrid, public, and private clouds. I was previously at Dell promoting their Cloud solutions and was the open source community manager for OpenStack and Xen.org at Rackspace and Citrix Systems. While at Citrix Systems, I founded the Citrix Developer Network, developed global alliance and licensing programs, and even once added audio to the DOS ICA client with assembler. Follow me at @SpectorID

Events
28-30 November
Madrid, Spain
Discover 2017 Madrid
Join us for Hewlett Packard Enterprise Discover 2017 Madrid, taking place 28-30 November at the Feria de Madrid Convention Center
Read more
See posts for dates
Online
HPE Webinars - 2017
Find out about this year's live broadcasts and on-demand webinars.
Read more
View all