Stackato PaaS Architecture: How it works and why. White Paper Published in 2012
Stackato PaaS Architecture: How it works and why. Stackato is software for creating a private Platform-as-a-Service (PaaS). It lets you use a more advanced and efficient application hosting model than Infrastructure-as-a-Service (IaaS) or cloud orchestration software. Traditionally, applications were hosted directly on the physical server that ran them, with only the OS layer between the application software and the bare metal. This method yielded some efficiencies because the software stack was relatively thin, but the model was more difficult to scale because physical server deployment is a very manual process. With Moore s Law providing faster processors and more memory, there was room for another layer of abstraction. With IaaS providers and private clouds, virtual machine (VM) instances can be easily created on demand. This speeds up the process of server allocation, but applications still require supporting software to be installed and configured on each server. The PaaS model provides an additional level of automation while sharing resources between multiple tenants and applications. This is why application hosting from PaaS providers is generally less expensive than VM hosting from an IaaS. Typically PaaS providers have to limit the range of runtimes and services offered and strictly control access to the system. Stackato combines the flexibility offered by direct VM access on IaaS with the highly automated configuration provided by PaaS. Computing resources are shared efficiently and securely by giving each application its own Linux container (using LXC) which can be extensively customized to suit the application it is hosting. 1
Elements of the Stackato System A single Stackato VM instance can run all services required for operation. This configuration, called a micro cloud, can be used on a desktop hypervisor such as VirtualBox or VMware Fusion to emulate a Stackato PaaS. This same VM is also the building block used to construct a full-scale PaaS cluster, using a simple command to assign a role to each VM and connect them together. Monitoring Web Users Deploy & Upgrade > Client HTTP(S) HTTPS Router Cloud Controller Message Bus (NATS) DEA(s) (Droplet Execution Agents) Health Manager Controller Messaging Services File Systems Databases TCP Services Stager How Stackato works on a VM cluster or hosted with a public IaaS provider. These Stackato roles are: Cloud Controller: responsible for directing all of the elements of the system. The attached Health Monitor keeps track of DEA availability. All Stackato VMs communicate with the Cloud Controller over NATS, a lightweight publish-subscribe and distributed queuing messaging system. This system handles the orchestration of the components and sets up other communication channels between components as appropriate (e.g. TCP connections between apps and databases). During cluster configuration, all VMs are connected to the Cloud Controller via NATS. 2
Stager: responsible for assembling all of the software required to run each application. Application prerequisites are bundled together in an application droplet ready for deployment to a Droplet Execution Agent (DEA). Router: maps application URLs to the application instances running on the DEAs. Application users connecting from the web are redirected transparently to an internal URL and port. Connections from Stackato clients are routed directly to the Cloud Controller. DEAs: the worker nodes of the system. Each hosts multiple applications within separate Linux containers. Application droplets are pulled from the Cloud Controller and launched inside a pre-allocated container. If a DEA becomes unresponsive for any reason, the Health Manager will notice and have the Cloud Controller redeploy the assigned applications to healthy DEAs. Services: database, messaging, file system, and other services can be automatically provisioned by the Cloud Controller. Services are bound to applications by way of a special environment variable that exposes the connection information in the application container. Any services requested by a user can be bound to any application deployed by that user, so multiple services can be bound to an application and vice versa. Services can be run on separate VMs, or can share VMs as required. Applications can use external services as well. For example, if an existing high-availability database cluster is exposed to the DEAs, the applications can connect directly, as it would in a traditional application hosting scenario. Pushing Applications The Stackato client targets the API URL of the Stackato system (e.g. api.stackato.example. net) and is authenticated with the stackato login command. Users have a quota of application instances, services and reservable memory available to them. The stackato push command initiates the process of deploying application code to Stackato. The client either prompts for configuration information (application name, required services, how much memory to reserve, etc.) or reads information from a local YAML configuration file. Stackato checks to see if all the resources required by the application are available to the user (within quotas, services and runtimes available). If they are, the client bundles the application directory and uploads it to the Cloud Controller. An application URL is created and any requested services are provisioned. A temporary container is created in the Stager, application dependencies are assembled, and a droplet package is created 3
for deployment. The Cloud Controller queries the DEAs and requests app containers. An available DEA starts a container and downloads the droplet, then executes any pre-running hooks specified in stackato.yml before starting the application What s Included in Stackato Web Servers» Nginx» Apache» Apache Tomcat Data & Messaging Services» MySQL MongoDB Redis RabbitMQ» PostgreSQL Languages ActivePython 2.7 and 3.2 ActivePerl 5.14 Java 1.6 PHP 5.3 Ruby 1.8 and 1.9 Node.js 0.6 Erlang Scala Clojure Web Frameworks» Django Flask» Bottle Dancer Rails Sinatra Spring» Pyramid Mojolicious» Catalyst + more The Health Monitor works in conjunction with the Cloud Controller to monitor DEA responsiveness and re-deploy applications to healthy DEAs as necessary. Advantages Building your own PaaS with Stackato allows you to take full advantage your virtualized infrastructure or use computing resources from an IaaS provider more cost effectively. Enterprises with their own private clouds can give their developers self-service access to application hosting resources in a safe way. Development teams get instant access to an application hosting service that automates the assembly of the application runtime software, letting them focus on their code. IT staff are freed from manual configuration of individual application environments, but maintain control of the cloud deployment platform. Smaller organizations relying on public cloud infrastructure can more efficiently share resources between applications, reducing the number of VMs required and driving down the cost of cloud deployment. Stackato also provides freedom from infrastructure lock-in. VM images are available for all major hypervisors, so if you change virtualization platforms, or move from a public IaaS to a private cloud, you can create a new Stackato cluster and import all user and application data. And finally, using Stackato to build your own PaaS keeps applications and data where they should be, under the direct control of your organization. Learn more. Try Stackato. Get started with Stackato today. Learn more at www.activestate.com/stackato. Download the FREE Stackato Micro Cloud at www.activestate.com/stackato/get_stackato. 4
About ActiveState ActiveState empowers innovation from code to cloud smarter, safer, and faster. ActiveState s cutting-edge solutions give developers and enterprises the power and flexibility to develop in Java, Ruby, Python, Perl, Node.js, PHP, Tcl, and more. Stackato is ActiveState s groundbreaking cloud platform for creating a private platform as a service (PaaS), and is the cost-effective, secure, and portable way to develop and deploy apps to the cloud. ActiveState is proven for the enterprise: More than two million developers and 97% of Fortune-1000 companies use ActiveState s end-to-end solutions to develop, distribute, and manage their software applications. Global customers like Cisco, CA, HP, Bank of America, Siemens, and Lockheed Martin look to ActiveState to save time, save money, minimize risk, ensure compliance, and reduce time to market. For more information, visit www.activestate.com. ActiveState Software Inc. 1700-409 Granville Street Vancouver, BC V6C 1T2 Phone: +1.778.786.1100 Fax: +1.778.786.1133 business-solutions@activestate.com phone: +1.778.786.1101 Toll-free in North America 1.866.631.4581 www.activestate.com/stackato 2012 ActiveState Software Inc. All rights reserved. ActiveState, Komodo,, ActivePerl, ActivePython and Stackato are trademarks or registered trademarks of ActiveState. All other marks are property of their respective owners.