Multi-VM Packaging

Deploying to a domain comprised of multiple VMs (runtimes) follows the same basic model as a single-VM deployment with the additional requirement of specifying a target zone (the Fabric3 term for cluster partition; see The Domain).  

Deployment Plan

Packaging for a clustered environment is identical to packaging for a single-VM environment, except for the additional requirement of including a plan.xml file in the contribution META-INF directory. The plan file maps a deployable composite (i.e. a composite specified for deployment in the sca-contribution.xml manifest) to a zone as shown below:

<plan xmlns:test="urn:org.fabric3.test" name="testPlan">
    <mappings>
        <mapping deployable="test:Composite1" zone="zone1"/>
    </mappings>
</plan>

Single Contribution Deployment

A single contribution can be deployed to one zone or multiple zones. It is important to note that zones in Fabric3 are homogenous. That is, each runtime in the zone acts as a replica running with the same configuration and hosting the same services. Consequently, If a contribution is deployed to one zone, it will be horizontally scaled as a single unit as illustrated in the following diagram:


This single contribution deployment to the same zone is the most common cluster topology supported by Fabric3. It is simple to setup, easy to maintain, and straightforward to scale-out. Sometimes however, it may be necessary to scale-out selected services in a contribution. This is done by targeting deployable composites to different zones, as shown below:  


Deploying composites to different zones is done in the plan.xml file. The following plan specifies the zones for the two composites in the previous picture:

<plan xmlns:test="urn:org.fabric3.test" name="testPlan">
    <mappings>
        <mapping deployable="test:Composite1" zone="zone1"/>
        <mapping deployable="test:Composite2" zone="zone2"/>
    </mappings>
</plan>

Multi-Contribution Deployment

The most common deployment topology for multi-VM domains consists of multiple contributions deployed to individual zones. This setup is illustrated by the following picture:

Packaging an application as multiple contributions and deploying them to separate zones provides greater modularity and loose coupling: not only are implementation classes isolated, but the scaling characteristics of subsystems are as well. This makes it possible to more accurately scale-out by adding more processing power to the application services which are under the most load.