With proper project setup you can have a monolithic single executable running multiple microservices (EDIT I don't mean real microservices I mean architectural like microservices... I mean seriously people two wars deployed in the same java app server does not make it not a microservice just because they are on the same JVM). We do this with multiple (hundreds) of rabbitmq consumers.
We do this because lets face it booting up 10 microservices to run an application for demo or smoke testing is pretty tedious (and actually slow) even when using docker/kubernetes.
The trickiest part of microservices is JOINing data and dealing with (eventual) consistency. Because you are working across datasources you do not get the nice advantage of using JOINs or true database transactions. Speaking from experience it is very hard to port this kind of logic to microservices (assuming multiple datasources).
On the other hand Pub/Sub or Event pattern as those are very easy to microservices out. Thus if you see a workflow like that (e.g. batch processing) it should absolutely be microserviced out.
You still make network calls (rabbit, http, kafka) etc but the same image/executable etc deals with it. That is the client and the server are running in the same JVM.
Microservices essentially provide high barriers (ignoring scaling for a second). The code is not shared. You can do the same with share nothing code base and have it all run in one app.
Regardless to the articles point monolithic applications should be designed like the above (whether or not they make network calls) otherwise you have a big ass snowball.
Why because I used the word monolithic? I meant that they are running in the same JVM.
I mean its like you didn't even read the rest of my original comment:
The trickiest part of microservices is JOINing data and dealing with (eventual) consistency. Because you are working across datasources you do not get the nice advantage of using JOINs or true database transactions. Speaking from experience it is very hard to port this kind of logic to microservices (assuming multiple datasources).
Like I literally said how I have separated out datasources and how consistency is a problem and then a followup comment on how the code isn't shared etc etc but you just kept practically trolling on the monolithic modifier which I agree was wrong. I meant single executable and not monolithic.
2
u/agentoutlier Dec 12 '19 edited Dec 12 '19
With proper project setup you can have a
monolithicsingle executable running multiple microservices (EDIT I don't mean real microservices I mean architectural like microservices... I mean seriously people two wars deployed in the same java app server does not make it not a microservice just because they are on the same JVM). We do this with multiple (hundreds) of rabbitmq consumers.We do this because lets face it booting up 10 microservices to run an application for demo or smoke testing is pretty tedious (and actually slow) even when using docker/kubernetes.
The trickiest part of microservices is JOINing data and dealing with (eventual) consistency. Because you are working across datasources you do not get the nice advantage of using JOINs or true database transactions. Speaking from experience it is very hard to port this kind of logic to microservices (assuming multiple datasources).
On the other hand Pub/Sub or Event pattern as those are very easy to microservices out. Thus if you see a workflow like that (e.g. batch processing) it should absolutely be microserviced out.