In continuation with MSA(Micro Service Architecture) patterns, I have spent significant amount of my time on Cloud Foundry & Pivotal Cloud Foundry(PCF). As mentioned in some of my earlier article/posts on MSA Patterns, Microservices need to be evaluated for organization before you make decision to implement, since this architecture do involve the upfront infrastructure run-time cost. Please refer to my earlier two articles Part1-Microservices Architectural Patterns- Deployment Patterns & Part2-Microservices Architectural Patterns-Data Management .
Let us take a moment & evaluate carefully, how things are changed over a period of time!
Primary focus of this article is not to explain multiple platform types or explain layers or write about how one is advantageous over other. Focus is more on how cloud foundry is different than services offered by cloud vendors(specifically AWS since same applies to most of the other cloud vendors also) & when to go for CF.
As you can see in Fig 1. over a period of time for cost reduction organization moved from On-premises platform type to all the way PaaS based model to some cases SaaS .The more you move towards right you will see that cost is reduced significantly. But at the same time you have very less control on the all the layers. Cloud became magic word for lot of organization. It really makes sense in lot of ways, you concentrate on your business and leave infrastructure management worry to cloud vendors.Cloud has flourished lot of new businesses & it changed dynamics significantly for lot of organizations including startups . Infrastructure is no longer a challenge but it was big challenge before cloud. For any startup to bring and try any MVP(Minimum Viable Product) into market there was significant upfront investment.If after product is successful meet the sudden high volume demands without losing significant time or customer base.
Fig 1 Platform Types(Green -Self Managed & Orange-Somebody else manage)
But what you will do when you have significantly invested into MSA(MicroServices Architecture) . Your primary question is, which Platform type or model best suits you ? As you know MSA demands for some of the architectural patterns to be addressed along with some of the cross cutting concerns at the infrastructural level also. The same cross cutting concerns are very much applicable in case of SaaS based application development also.
One of the primary goal of microservice implementation is agility & speed to market.Below are some of architectural needs to make microservices implementation successful,
- Lightweight runtimes
- Log Aggregation
- Seamless Deployments -Blue Green
- Service Bindings
- Polygot Model
One can argue, aren’t their significant PaaS offerings from cloud vendors to address some of above aspects? Let us consider for a moment AWS Beanstalk or EC2/GCP offering for Java based application.(I am leaving Fargate at the bay for sometime)
What are the steps involved into it ?
Step 1. Identify Region,AZ,VPC & Subnets
Step 2. Identify the EC2 instance ideal size
Step 3. Install Java as well as tomcat container
Step 4. Load balancer addition
We could do it further faster by building AMIs & keep on deploying it multiple times to avoid some of the steps but still it doesn’t address lot of the important aspects related to lightweight runtimes, service bindings,polygot model. All of these are possible to achieve but most of them are taken care individually & not by cloud vendor.
One can reduce the pain of some of the steps by directly going for Elastic Beanstalk instances but again it addresses lot of concerns but the primary goal of agility is not fulfilled to the 100% & some of the aspects related lightweight runtimes, service bindings are complex to achieve & less devOps friendly.
There are other container supporting models in cloud are also available like AWS Fargate, EKS but it doesn’t give you flexibility to move around with multiple cloud vendors & you are in a deadlock situation with cloud vendor, which makes difficult to shift your infrastructure to somewhere else.
That’s where Cloud Foundry comes into consideration. As shown in Fig 3 if your preferred way of implementation is Microservice & you want to have aspects/features addressed to your microservice then one of the best option is Cloud Foundry.
Advantages of Cloud Foundry for Microservices
- Lightweight runtimes :- Cloud foundry diego cells are very light & could be stood up quickly without any inputs from developer & it can modified easily without much of an effort. Cloud foundry claims that Heartbleed could be addressed within fraction of minutes to which I agree also.
- Autoscaling :- Horizontal scaling is way easier in case application load increases. Vertical scaling in lower environment can also be achieved but needs restart of application.
- Log Aggregation :- In-built log aggregation is provided & logs are published as events, which can be further streamed to any log analysis tools.
- Seamless Deployments -Blue Green :- Runtime binding of routing services makes easier for the application to be deployed without any end user or client application impact.
- Service Bindings :- Marketplace provides multiple services available & bindable to any user provided application at the runtime.
- Polygot Model:- In built buildpacks with multiple runtimes services allow to have polygot model to easily deployable without much worrying about runtimes setups.At the same time DB side multiple options are available in marketplace.It can support some of below buildpacks by default & those are very easily configurable to different versions & custom buildpacks
- Resiliency:- In-built resiliency, if for any reason one of the instance performance gets degraded it automatically tries to broadcast and let multiple application to be deployed
This makes the CF preferred choice & as you can see in Fig 4 about the user base stats published by cloud foundry
In order to build appropriate microservices & follow architecture there are certain needs to be addressed at platform level also. Those needs are nothing but cross cutting concerns & some of them can be achieved by building custom components. As you can see there are multiple inbuilt features which CF provides those needs to addressed anyway then why not this open source or commercial offering of CF which is PCF(Pivotal Cloud Foundry). CF does provide in-built services to make things easier for microservices development, so cloud foundry is one of the preferred choice for microservices implementation.
*I am no way suggesting that CF or PCF supports only microservices architecture but that is one of the best bang for your buck from my point of view.
Leave a Reply