Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the canonical way to deploy Scala/Akka microservices?

We are going to end up with dozens of these microservices (most are Akka-based), and I'm unsure how to best manage their deployment. Specifically, they are built to be independent of each other and as specialized and distributed as possible.

My question stems from the fact that all of them are too small for their own individual JVMs; even if we were to host them on AWS nano instances, we'll still end up with about 40 machines if you factor in redundancy, and such a high number is simply not needed. Three medium size instances could (and do) easily handle the entire workload.

Currently, I just group them into "container" applications, somewhat randomly, and then run these container applications on larger JVMs.

However, there has to be a better way. I am not aware of any application servers for Akka where you can just "deploy actors", so I wanted to get some insight on how others run Akka microservices in production (and specifically how to manage deployment).

This is probably not limited to Scala and Akka, but most other platforms have dedicated app servers where you deploy these things.

like image 366
Ruslan Avatar asked Nov 25 '16 04:11

Ruslan


1 Answers

IMHO, the canonical way is to use a service orchestration tool, and that would indeed run them in individual processes, each with their own JVM. That's the only way you get the decoupling, isolation, resilience you want with microservices, only this way you'll be able to deploy, update, stop, start them individually.

You're saying:

My question stems from the fact that all of them are too small for their own individual JVMs; even if we were to host them on AWS nano instances

You seem to treat JVM and Amazon VMs as equivalent, but that's not the case. You can have multiple JVM processes on a single virtual machine.

I suggest you have a look at service orchestration tools such as Lightbend Production Suite / Service Orchestration or Kubernetes

These are just examples, there are others. Note that this tool category will give you a lot of features you'll sooner or later need anyway, such as easy scaling, log consolidation, service lookup, health checks / service failure handling etc.

like image 51
lutzh Avatar answered Nov 16 '22 01:11

lutzh