3 ms·
> 1) A monolith will have to consume a large amount of resources per request due to having all the models available at runtime. Lets say I have a system that ha
by lmm 7y ago
> 1) A monolith will have to consume a large amount of resources per request due to having all the models available at runtime. Lets say I have a system that handles 100 RPS but only 1 RPS uses that model, and that model is GB's of RAM and requires GPU, that means I will have to have this memory and GPU allocated for every request, making scaling much more costly. (Note: your mileage will vary depending on your complexity)
Needing a heavy model per-request is very much the exception rather than the rule; even if you're doing ML, for most cases you'd do that with a single shared copy of your model. If you're somehow loading a model for each request, surely you can just not do that for requests that don't need it?
> 2) A monolith is a central point of failure, if I make a mistake in that service it can affect all of my requests, rather than just the request that calls out to that microservice, this is a difference between my entire service going down and just a feature.
I can understand people doing that in languages like Python or especially Ruby, where metaclasses / monkeypatching mean that it's easy for one part of the code to interfere with another. But I think it's a mistake to apply that to more structured languages where it's relatively easy to have an enforced separation between different modules within a single deployable.