Implementing the Twelve-Factor App Methodology for Developing Cloud- Native Applications

Similar documents
Cloud-Native Applications. Copyright 2017 Pivotal Software, Inc. All rights Reserved. Version 1.0

Building Microservices with the 12 Factor App Pattern

Heroku. Rimantas Kybartas

Copyright 2016 Pivotal. All rights reserved. Cloud Native Design. Includes 12 Factor Apps

12 Factors to Cloud Success. Rafael Benevides

The 12-Factor app and IBM Bluemix IBM Corporation

gcp / gke / k8s microservices

DESIGNING APPLICATIONS FOR CONTAINERIZATION AND THE CLOUD THE 12 FACTOR APPLICATION MANIFESTO

Cloud Native Applications. 主讲人 :Capital One 首席工程师 Kevin Hoffman

Lessons Learned: Deploying Microservices Software Product in Customer Environments Mark Galpin, Solution Architect, JFrog, Inc.

Application Centric Microservices Ken Owens, CTO Cisco Intercloud Services. Redhat Summit 2015

Azure DevOps. Randy Pagels Intelligent Cloud Technical Specialist Great Lakes Region

WHITEPAPER. Embracing Containers & Microservices for future-proof application modernization

[Docker] Containerization

Oracle Application Container Cloud

Use Case: Scalable applications

Containers, Serverless and Functions in a nutshell. Eugene Fedorenko

DevOps Tooling from AWS

YOUR APPLICATION S JOURNEY TO THE CLOUD. What s the best way to get cloud native capabilities for your existing applications?

Continuous Integration and Delivery with Spinnaker

12 (15) Factor App Workshop

Ruby in the Sky with Diamonds. August, 2014 Sao Paulo, Brazil

Exam C IBM Cloud Platform Application Development v2 Sample Test

Scaling DreamFactory

TECHNICAL BRIEF. Scheduling and Orchestration of Heterogeneous Docker-Based IT Landscapes. January 2017 Version 2.0 For Public Use

STATE OF MODERN APPLICATIONS IN THE CLOUD

Containers & Microservices For Realists. Karthik

How to Keep UP Through Digital Transformation with Next-Generation App Development

Important DevOps Technologies (3+2+3days) for Deployment

Advanced Continuous Delivery Strategies for Containerized Applications Using DC/OS

Going cloud-native with Kubernetes and Pivotal

IBM Cloud Developer Tools (IDT) and App Service Console Overview

How to Leverage Containers to Bolster Security and Performance While Moving to Google Cloud

Using DC/OS for Continuous Delivery

Merging Enterprise Applications with Docker* Container Technology

Sunil Shah SECURE, FLEXIBLE CONTINUOUS DELIVERY PIPELINES WITH GITLAB AND DC/OS Mesosphere, Inc. All Rights Reserved.

EASILY DEPLOY AND SCALE KUBERNETES WITH RANCHER

Container in Production : Openshift 구축사례로 이해하는 PaaS. Jongjin Lim Specialist Solution Architect, AppDev

Exam C Foundations of IBM Cloud Reference Architecture V5

Deploying and Operating Cloud Native.NET apps

Cloud Native Architecture 300. Copyright 2014 Pivotal. All rights reserved.

WHITE PAPER. RedHat OpenShift Container Platform. Benefits: Abstract. 1.1 Introduction

CLOUD-NATIVE APPLICATION DEVELOPMENT/ARCHITECTURE

Modelos de Negócio na Era das Clouds. André Rodrigues, Cloud Systems Engineer

OpenShift 3 Technical Architecture. Clayton Coleman, Dan McPherson Lead Engineers

Practical Guide to Platform as a Service.

Docker Universal Control Plane Deploy and Manage On-Premises, Your Dockerized Distributed Applications

Go Faster: Containers, Platforms and the Path to Better Software Development (Including Live Demo)

Orchestrating the Continuous Delivery Process

platform Development Process Optimization For Drupal centric projects

Connecting your Microservices and Cloud Services with Oracle Integration CON7348

São Paulo. August,

what's in it for me? Ian Truslove :: Boulder Linux User Group ::

Disclaimer This presentation may contain product features that are currently under development. This overview of new technology represents no commitme

Knative: Building serverless platforms on top of Kubernetes

DEPLOY MODERN APPS WITH KUBERNETES AS A SERVICE

DEPLOY MODERN APPS WITH KUBERNETES AS A SERVICE

Running Containerized Microservices on AWS. November 2017

How the Cloud is Enabling the Disruption of the Construction Industry. AWS Case Study Construction Industry. Abstract

C exam. Number: C Passing Score: 800 Time Limit: 120 min IBM C IBM Cloud Platform Application Development

Welcome to Docker Birthday # Docker Birthday events (list available at Docker.Party) RSVPs 600 mentors Big thanks to our global partners:

FROM VSTS TO AZURE DEVOPS

Design Patterns for the Cloud. MCSN - N. Tonellotto - Distributed Enabling Platforms 68

Red Hat Roadmap for Containers and DevOps

Technical Comparison Sheet: ez Platform Cloud vs Other Hosting Approaches

Real-life technical decision points in using cloud & container technology:

Cloud Computing design patterns blueprints

Step 1: Setup a Gitlab account

Continuous Delivery for Cloud Native Applications

SUSE s vision for agile software development and deployment in the Software Defined Datacenter

Who is Docker and how he can help us? Heino Talvik

Alexandre Menezes Cloud Solution Architect

When (and how) to move applications from VMware to Cisco Metacloud

Jenkins: A complete solution. From Continuous Integration to Continuous Delivery For HSBC

AGILE RELIABILITY WITH RED HAT IN THE CLOUDS YOUR SOFTWARE LIFECYCLE SPEEDUP RECIPE. Lutz Lange - Senior Solution Architect Red Hat

Windows Server Windows Server Windows Server 2008

In-cluster Open Source Testing Framework

Serverless and APIs: Rethinking Curriculum in Higher Education. Munir Mandviwalla and Jeremy Shafer Temple University

Cloud Foundry- 开放的应用平台

Docker and Oracle Everything You Wanted To Know

Architecting Applications to Scale in the Cloud

Accelerate at DevOps Speed With Openshift v3. Alessandro Vozza & Samuel Terburg Red Hat

Let s say that hosting a cloudbased application is like car ownership

2018 Report The State of Securing Cloud Workloads

TM DevOps Use Case TechMinfy All Rights Reserved

Top five Docker performance tips

C ibm IBM C Foundations of IBM Cloud Reference Architecture V5 Version 1.0

Separation of concerns among application and network services orchestration in a 5G ecosystem

Kubernetes Integration with Virtuozzo Storage

BEYOND CLOUD HOSTING. Andrew Melck, Regional Manager DACH,

OpenShift Roadmap Enterprise Kubernetes for Developers. Clayton Coleman, Architect, OpenShift

Why Kubernetes Matters

SBB. Java User Group 27.9 & Tobias Denzler, Philipp Oser

UP! TO DOCKER PAAS. Ming

White Paper. Why Remake Storage For Modern Data Centers

BUILDING APPLICATION SECURITY INTO PRODUCTION CONTAINER ENVIRONMENTS Informed by the National Institute of Standards and Technology

API, DEVOPS & MICROSERVICES

DEVOPSIFYING NETWORK SECURITY. An AlgoSec Technical Whitepaper

DevOps Anti-Patterns. Have the Ops team deal with it. Time to fire the Ops team! Let s hire a DevOps unit! COPYRIGHT 2019 MANICODE SECURITY

Continuous delivery of Java applications. Marek Kratky Principal Sales Consultant Oracle Cloud Platform. May, 2016

Transcription:

Implementing the Twelve-Factor App Methodology for Developing Cloud- Native Applications By, Janakiram MSV Executive Summary Application development has gone through a fundamental shift in the recent past. Developers are under pressure to deliver software that runs in a variety of environments including enterprise data centers and cloud platforms. The modern software is expected to scale with no major changes to the code. Software has to be shipped rapidly to deliver new features and user experiences. In the era of web, mobile, and device computing, application development needs to adopt a new methodology. The rise of cloud, containers, and microservices has led to a new paradigm of developing and deploying software. The twelve-factor app methodology advocates a set of patterns and practices for designing contemporary applications that take advantage of cloud infrastructure. Since these applications are born in the cloud to exploit the capabilities of modern infrastructure, they are often referred as cloud-native applications. This report attempts to introduce the twelve-factor app methodology to developers focused on building contemporary, cloud-native applications. Key Attributes of Cloud-Native Applications Cloud-native applications are differentiated from their counterparts based on their packaging, deployment, configuration, and modularity. They have the following attributes: Automated - Cloud-native apps separate the code from configuration. The external configuration declared outside of the code encourages automation, which reduces the cost of deployment. It also delivers consistency and repeatability of deployments. Portable - Cloud-native apps have zero dependency on the underlying operating system and cloud infrastructure. They are easily ported across multiple environments with no changes to the code. Agile - The components or modules of cloud-native apps can be rapidly upgraded with minimal disruption to the system. They follow the principles of continuous deployment for moving the code from development environments to production.

Elastic - Cloud-native apps can run in highly constrained environments with minimal resources or can be scaled to support a large number of users. They can be scaled-in and scaled-out with no changes to the application code. The Twelve Factors The twelve-factor app methodology was originally conceived to define the patterns for applications targeting PaaS offerings such as Heroku and Engine Yard. Given the resemblance between PaaS and container platforms, these principles are applicable for modern, cloud-native applications. Below is a list of the patterns and practices advocated by this methodology. 1. Codebase The very first principle of the methodology is related to versioning and tracking the code. The entire code base that belongs to the application must be stored in one repository such as Git or SVN. There may be multiple versions or branches but there must be a clear 1:1 correlation between the code, repo, and the application. The running instance of code is called as a deployment. There may be multiple deployments of the same codebase running in different environments such as staging and production. Key takeaway - Maintain one and only one codebase for all the modules associated with the application. 2. Dependencies An application must explicitly declare all the dependencies. It cannot make assumptions about the availability of dependencies. It is the job of the platform to ensure that all the dependencies declared by the app are available at runtime. Examples of such declarations include Ruby Gem files and a Node.js Package.json file. The clean separation between code and dependencies enables DevOps to do their job efficiently. The operations team can ensure that the dependencies are met while developers stay focused on the code. Key takeaway - Applications cannot make assumptions about dependencies. Always explicitly declare the dependencies. 3. Configuration This principle emphasizes on the clean separation of configuration and code. The separation can be achieved through environment variables. Since the application can retrieve the configuration at runtime, the same codebase can be seamlessly deployed in multiple environments with no changes. For example, the database connection string can be passed as an environment variable to the application, which can be different between development, testing, and production environments. Though configuration can be moved to files that are managed by the same version control system, environment variables are better suited as they are always expected at a well-known location. Configuration files have the risk of getting fragmented and duplicated.

Key takeaway - Store configuration in environment variables and read them at runtime. 4. Backing Services The fourth factor deals with the backing services management. Backing services are external services, which an app depends on over a network connection. This can be a local database service such as MySQL or MongoDB or any other 3rd party service such Amazon RDS or mlab. For a twelve-factor app, the interface to connect to these various services should be defined in a standard way. In most cases it would be accessed over a URL with credentials stored in the config. There should not be any code changes when switching between the local and remote services. For example, a twelve-factor app should be able to switch between a local MySQL database and a remote one by simply changing the config. Key takeaway - Treat backing services as attached resources. 5. Build, Release, Run This principle emphasizes clean separation of the stages in the software lifecycle. The build stage must deal with building the binaries by combining the code, dependencies, and other assets. The outcome from this phase is an executable bundle. The release stage combines the output from the build stage with the configuration specific to an environment, making it ready for a set of target environments. The final stage, run, executes the app in the select environment by choosing the right release from the previous stage. Key takeaway - Strict separation of build, release, and run stages 6. Processes The application is expected to run in an execution environment as one or more processes. Processes are completely stateless and share-nothing. The app cannot assume the presence of a local file, cache, or a database. Instead, it is expected to access it from a well-known location. An example of this includes moving files from a local file system to an object storage system like Amazon S3. Each process has to download its own copy to access the content. This encourages scalability in which the application can run simultaneously across multiple execution environments. Key takeaway - Strict separation of stateful and stateless services 7. Port Binding Cloud-native applications are exposed through a URL but cannot assume the port binding through which they are exposed to the external network. In most of the cases, there would be a proxy or a frontend server that forwards the requests to the backend application. Applications must bind themselves to a port that is externally declared in the configuration file. They should work in environments where they are exposed via external-facing services.

Key takeaway - Export services via port binding 8. Concurrency Processes in twelve-factor apps are treated as first-class citizens. Each process should be able to scale, restart, or clone itself when needed. This loosely-coupled model enables scale-out architectures. For example, when the traffic increases to a web server, there may be multiple web processes responding to the requests. The worker processes responsible for dealing with the messages are scaled independent of the web processes. The web and worker processes may be connected via a message queuing system. This approach will improve the reliability and scalability of the application. Key takeaway - Scale out via the process model 9. Disposability The ninth factor emphasizes the robustness of an application through faster startup and shutdown methods. It is recommended that applications try to minimize the startup time for each process. This brings agility to the overall release process. Processes should shutdown gracefully against sudden death in the case of hardware failures. Applications can rely on robust queuing backends such as Beanstalkd and RabbitMQ that will return unfinished jobs back to the queue in the case of a failure. Key takeaway - Maximize robustness with fast startup and graceful shutdown 10. Dev/Prod Parity Twelve-factor apps are designed for continuous deployment by keeping the gap between development and production small. Consistency is key in bringing parity across dev, test, staging, and production environments. When deployment environments are similar, testing and developing gets much simpler. Consistent environments ensure that areas such as the infrastructure stack, config management processes, software and runtime versions and deployment tools are the same everywhere. Since the test cases are applied on production-level data, this approach reduces the bugs in the production environment. Key takeaway - Keep development, staging, and production as similar as possible 11. Logs Logging plays an important role in debugging and maintaining the overall health of an application. At the same time, an application in itself shouldn t burden itself with the storage of logs. Instead, the logs should be treated as a continuous stream that is captured and stored by a separate service. Each running process may write its event stream, unbuffered, to stdout. During local development, the developer can view this stream in the foreground of their terminal to observe the app s behavior. In staging or production environments, the logs are routed to one or more final destinations for viewing and long-term archival.

Key takeaway - Treat logs as event streams 12. Admin Processes Applications often deal with one-off administrative processes such as initializing a database, cleaning up the database, and migration of servers. These processes should be run in an identical environment as the regular long-running processes of the app. If they run against a specific release, they should use the same codebase and config as any process run in that release. Admin code must ship with application code to avoid synchronization issues. Twelve-factor methodology prefers languages that provide a REPL shell out of the box, which makes it easy to run one-off scripts. Key takeaway - Run admin/management tasks as one-off processes DreamFactory as a Twelve-Factor Application DreamFactory is an API-first platform to develop data-driven applications. It exposes a variety of databases and data stores as standard REST APIs. DreamFactory is architected based on the twelve factors of modern application development. DreamFactory is maintained as a single repository on Github that can be easily cloned or forked. Since the platform is built on top of PHP and Laravel frameworks, the dependencies are clearly defined in composer.json. The configuration is maintained in a set of environment variables, making it easy to deploy in multiple environments. DreamFactory can run in a variety of environments ranging from Raspberry Pi to the leading web-scale cloud platforms. Developers can easily integrate DreamFactory with their containerized applications. The platform can be deployed on Docker Swarm, Kubernetes, and Mesosphere environments. Summary The twelve-factor app methodology helps developers with the best practices for building cloud-native applications. By adopting these principles, they can design, develop, and deploy applications that are reliable, portable, scalable, and extensible. These principles are highly relevant for the modern-day applications that target web, mobile, and device users. DreamFactory can be integrated with the cloud-native applications for easier integration with legacy and modern data sources.