-1

I am developing an application, and want to implement a certain functionality. I find that this can be done in the stack I am using, however it's hard to implement. I can create a microservice with this functionality embedded using another technology, and use it for that particular aspect of my overall application. This is much easier than the first option.

Which option would normally overall be cheaper, when actually deploying and scaling the application, not including the cost and time of actually developing the application. Thanks.

3
  • How difficult to implement would it be in your current stack? Would it take hours, days, weeks? My personal opinion is that more up front effort is worthwhile to keep maintainability up, and having a hodge-podge of technologies can be (but isn't always) a maintainability issue.
    – Turksarama
    Commented May 6, 2020 at 6:15
  • I recommend heavily to change the wording of this question. Asking for "normally overall cheaper" is biased towards the misguided expectation that this makes any sense (- frankly - it does not). Such wording always attracts downvotes and close votes. You could ask for an approach how to estimate the costs for deploying and scaling for your specific situation. But when you do so, don't forget to mention which approaches you already tried and why they did not suit your needs, otherwise the question will get closed with the predefined "needs more focus" close reason.
    – Doc Brown
    Commented May 6, 2020 at 7:49
  • You don't tell anything about your application. Is it a robotic application, or a web application? How critical is it (a bug is killing people, or just losing their time)? Does it have thousands of users, or billions of simultaneous users? If the performance suffers, how does that affect users (billions of € of losses, or just a few dozen US$)? Please edit your question to tell more about your application. Commented May 6, 2020 at 12:20

2 Answers 2

7

There's no "normally". Whichever of two options is cheaper to deploy, operate and scale depends on many factors. Often the deployment of a monolith is cheaper, but for example if you need changes in your new component more often it might be cheaper and less risky to have it as a separate microservice.

To get a better answer you might want to detail your deployment process and put "price tags" on steps, estimate a deployment schedule, calculate risks and their costs. You will get numbers with high uncertainties but hopefully a general idea which option is better given your actual situation. It is possible that the difference is not high enough to make this the primary decision factor, and that differences in development effort actually dominate this.

2

Generally it is cheaper to scale horizontally than vertically and micro-services support this in a flexible way.

say for example I have my monolithic app, of which one - rarely used, feature is CPU bound and will slow all the other features down when it is used.

I can scale vertically, moving to a bigger CPU, but this will be expensive and only noticed for a fraction of the time.

I can't scale horizontally, because even with two load balanced instances, users on the instance running the slow task will be slowed, and the task may be started on both instances.

With a micro-service approach I can move the slow feature out to its own machines, so that other features will be unaffected. I can also scale those machines horizontally as required for that specific feature.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.