Cells vs Composites

Tharindu Jayathilake
wso2-cellery
Published in
4 min readNov 5, 2019

When hearing the above two terms, Cells and Composites you might wonder what these two terms refer to. Well, don’t worry in this blog post I will be discussing these two terms and comparison between them.

Being a developer/DevOps you may have ever come across deploying a set of microservices. Before discussing cells and composites let us see what is Cellery. Cellery is an application orchestration technology that enables users to deploy their microservices conveniently. I think you may have heard about Helm which is a well-know application orchestration technology where Cellery has its own unique features that make the deploying tasks more userfriendly. Cells and composites can be considered as the heart of Cellery.

Please refer to the blog post to differentiate Helm and Cellery.

What are Cells?

Sample cell image

A cell is an independently deployable, manageable and observable collection of components. In cells, the communication happens in two ways as inter-cell and intra-cell communication. Intra-cell communication refers to the communication happening inside a cell and inter-cell communication refers to the communication between cells. Intercell communication happens through an edge-gateway. This gateway is a governed network that provides APIs and events. If micro-services are not exposed to external dependencies, the cell does not expose those to external dependencies.

The components that reside inside a cell are reusable. Cells have 1:n components grouped. Through network-accessible endpoints, cells define their capabilities. If the cells are referred from external dependencies, the communication happens via a cell gateway.

When should we use cells?

As mentioned above you now know that cells are rich with a network boundary and a gateway. Therefore we do not need to take any security measures to protect your microservices. Apart from that when using cells you can manage your applications well by grouping them.

When communicating with cells you should have a token from a cell’s trusted party. Therefore cells can be considered as a secured component. If security is a concert it is recommended to use cells.

What are Composites?

Sample composite image

Composites are simply a cut-down version of cells. Like cells, composites are also 1:n grouped components. In composites, we do not find a gate-way and network boundaries. Composites also referred to as naked cells since we do not have a network boundary and a gateway. In other words we can define composites as a lightweight solution of cells.

When should we use composites?

Composite deployments can be considered as an entry point for users to try out Cellery. This is because composite architecture is easy to understand. At initial stages of trying Cellery the users may have difficulties in adapting Cellery for their microservices. Composite is a good solution for early adaptors. Once your solution is proven you can shift to cells.

Using composites users can easily deploy their micro-services with fewer resource requirements. It is a good practice to use composites for small scale applications. This is because when the application becomes larger it easy to manage your application with cells since we can group our components with cells.

Comparison between cells and composites

  1. There is a network boundary and an edge-gateway in cells while we cannot find them in composites.
  2. For cell communication, we need to obtain a JWT token from a trusted party to cells. But with composites, we don’t need to have a JWT token to communicate. As a result of this, we can consider cells as the more secured component when compared to composites. Any external party can communicate with composites, but cells will accept a JWT to communicate with the external parties.
  3. Composites a lightweight solution when compared to cells. Therefore with lesser resources, you can use composite for your deployments.
  4. Composites is the solution if you are trying out Cellery at the initial stages of deploying your microservices. Once your application is proven with composites you can move your application to cells.
  5. Time taken to execute a composite is less compared to cells since the composites have a lesser number of components compared to cells.
  6. Micro-services that are deployed inside a composite may function faster compared to cells. This is because cells have network boundaries and the incoming requests to cells need to be validated.

Conclusion

With the time being developers/DevOps tend to move from monolithic applications to applications with microservices. The above-mentioned cells and composites are two proven solutions that you can use to deploy your microservices. So you can see clearly that the main difference between a cell and composite is that cells having network boundary and an edge-gateway. Most of the other difference comes into the picture due to this. If you are an early adaptor to cellery you can try out with composites and gradually move into cells.

You can try out cells and composites using these samples. If you have tried out Cellery with cells and composites you can share your thoughts in the comment section. Cheers ..!!!

--

--