[Blog Post] Apache Stratos in a Nutshell

  • By Imesh Gunaratne
  • 30 Aug, 2013

Apache Stratos is an open source, enterprise grade Platform as a Service (PaaS) cloud platform built with open standards. Stratos was originally developed by WSO2 and very recently donated to Apache Software Foundation (ASF) with the vision of making it the most open PaaS framework in the market by involving a wide range of organizations and individuals to design and implement its features at their best [1].

This might be a great start of a long journey on making an industry standard PaaS solution. A few years back a similar action was taken by NASA and Rackspace when they decided to start the OpenStack project by donating NASA's Nebula platform and Rackspace's Cloud Files platform at a time where there was no open and industry standard Infrastructure as a Service (IaaS) solution available. Now, there are over 200 organizations contributing to OpenStack [2] and many cloud vendors use it as their de facto standard IaaS.

Open Standards

OSGi for Modular Architecture

At its core Apache Stratos is built using OSGi’s [3] dynamic modular architecture. OSGi is one of the best or may be the only industry proven standard for implementing true component based Java applications until JSR 277 [4] was implemented. The core benifit of using such a standard is that applications could extend their features without having to change the entire system [5]. The complete Stratos PaaS has been composed as a collection of OSGi modules. These modules have been grouped into four different categories as an extra step for improving the maintainability and readability of the platform. They are grouped as components, service stubs, features and products.

Apache Axis2, Synapse and Tribes for Service Implementation, Mediation and Clustering

At its next level, Stratos will make use of Apache Axis2, Axis2 Clustering and Apache Synapse for implementing web services, clustering and message mediation logic. Each product has implemented service APIs for communicating with other products for managing the cloud eco system. The load balancer module makes use of the Apache Tribes group management framework as the messaging system for clustering the end points. Here, the endpoints are known as cartridges that deploy cloud applications in OS level isolated environments. At the moment, each cartridge is made out of a virtual machine instance in the IaaS. However, there is a plan to improve this functionality by introducing LXC-based virtualization to re-use VMs for creating multiple cartridges.

Apache Qpid - AMQP for Messaging

Apache Qpid implements Advanced Message Queuing Protocol (AMQP) [7] as an open standard for reliable and high performance messaging [8]. Apache Stratos has used Apache Qpid for synchronizing cluster topology information between products using publish-subscribe pattern [9]. This includes cluster information of cartridges connected to the load balancer.

jclouds API for IaaS Communication

JClouds provides a single, open standard REST API for accessing many different types of IaaS platforms [10]. Apache Stratos has used JClouds to ensure that it is loosely coupled with the underlying virtualized infrastructure. Currently, JClouds supports Amazon EC2, OpenStack, VMWare vCloud, Rackspace and many other IaaS solutions.

Git Version Controlling for Artifact Distribution

Application deployment is one of the key tasks in a PaaS. Stratos has achieved this functionality by using Git version controlling system. The application deployment packages (war files, php deployment distributions, etc) could be checked into a Git repository and the URL of the repo could be registered in the system.

Logical Architecture

Cloud Controller (CC)

Cloud Controller is the main access point to the IaaS. It makes use of JClouds API for communicating with many different IaaS platforms. One of the key features of Stratos PaaS is that it could be connected to multiple IaaSs concurrently and implement heterogeneous cloud solutions. For example, an organization could subscribe to a public and a private IaaS at the same time and configure Cloud Controller IaaS policies to ensure which IaaS to be utilized most. Moreover, Cloud Controller is the central storage point of cluster topology information of all products.

Elastic Load Balancer (ELB)

As the name implies, ELB is the load balancing module of Apache Stratos PaaS. It constitutes of Apache Synapse mediation framework, Apache Axis2 clustering, Apache Tribes group management messaging framework and an auto-scaling module implemented using Carbon. Once an application is deployed on a cartridge, it connects to the ELB via the Stratos Agent with Axis2 clustering. This clustering configuration is dynamically managed by the ELB. Each cartridge subscription will have its own cluster and all cartridge instances created for scaling functionality will be automatically added to the same cluster. Each cluster could be uniquely identified by its domain name given at the time the subscription is made.

All incoming requests of applications are managed in a request queue and monitored by the autoscaler module. The autoscaler module uses a Synapse in-mediator, task and an out-mediator [11] for handling this functionality. According to the scaling rules defined, autoscaler will scale a number of instances of applications via the Cloud Controller. In-addition, the ELB keeps a track of session information of messages and routes them to relevant application instances if available.

Stratos Agent

Stratos Agent’s responsibility is to provide cluster registration functionality for cartridges. Any cartridge that does not have clustering support used by the ELB could go through the agent to subscribe to the PaaS.

Stratos Controller (SC)

Stratos Controller consists of three main components; the Dashboard, Artifact Distribution Coordinator (ADC) and Autoscaling Policy Manager. The dashboard provides features for managing tenants, cartridge subscriptions, users and roles, single sign-on features based on Security Assertion Markup Language (SAML) [13], registry, metering and key stores. In Stratos each application deployment package is known as an artifact. The responsibility of the ADC is to synchronize artifacts from its source Git repository to the cartridge instances. This process is triggered automatically whenever a commit is made to the remote repo or else it could also be triggered manually via the dashboard. The Autoscaling Policy Manager maintains policy rules for managing the auto scaling process in the ELB.

Command Line Interface (CLI)

The Command Line Interface (CLI) provides same set of features given by the dashboard on the shell. It could be operated in two modes; they are the Interactive Mode and Single Command line Mode. The interactive mode could be used by a human to execute commands against the SC and the single command line could be used by a machine to execute a command script.


A cartridge is a virtual machine image on an IaaS which has software components to interact with the Stratos PaaS. Out of the box Apache Stratos provide cartridges for PHP, MySQL and Tomcat based applications on OpenStack and Amazon EC2. More importantly a custom cartridge for any other platform could be created with the given set of tools. The documentation for cartridge creation process could be found here [14]. Even though this process sounds tedious it provides a very secure, OS level isolated environment for cloud applications.


Source: https://imesh.gunaratne.org/blog/apache-stratos-in-a-nutshell/