PaaS for microservices, part I

I have yet to come across a PaaS built with microservices in mind. That’s a problem, and here’s the first reason why.

I recently came across a popular PaaS pushing monoliths over microservices. If your project consists of ten microservices, each one will be deployed in a separate container running on the same cloud instance. And because it’s a very small instance, performance becomes an issue. The alternative is to create a separate project for each service. Of course, 10x the cloud instances is 10x the cost.

It’s quite a choice. You can throw performance out the window to save money, or you can pay through the nose to keep it – all because you went with a microservices architecture.

I find this rather surprising seeing as AWS has a great service for deploying scalable microservices, Elastic Container Services (ECS). Instead of running ten containers on a single EC2 instance, I’d rather distribute them among a cluster of instances – and because I’m a stickler for HA, I’d deploy at least two containers for each microservice (and ensure they are running on separate EC2 instances).

Then I discovered this PaaS scales up. Let’s say the average workload on my microservice is 100 requests/second and it suddenly spikes to 1000 requests/second, this PaaS would replace the container running my microservice with a bigger one. I’m not a fan of this approach. Perhaps it’s because my background is in distributed systems and scale out architectures.

If we’re building on ECS, we can simply take advantage of service auto scaling. If enabled, ECS will add more containers running my microservice when its workload increases – and remove them when it decreases.

However, there’s only so many containers we can run on a fixed set of EC2 instances. Well, that’s why ECS has cluster auto scaling. If the cluster’s overall resource utilization is too high to deploy more containers, ECS will add more EC2 instances if cluster auto scaling is enabled. Pretty cool if you ask me.

The other thing I would prefer is to be able to specify the container size for each microservice. There’s no reason a PaaS couldn’t support that if it was using ECS to its fullest.

Still, infrastructure and scaling isn’t what prompted me to question whether or not current PaaS offerings are a good fit for microservices.

I think I’ll leave that for part II.

Get great content updates from our team to your inbox.

Join 86,000 subscribers. GDPR and CCPA compliant.