Does it make sense to add microservices to a monolithic architecture? E.g. if the monolithic system is old and is seen as too big, can it slowly be turned into a microservice based architecture?

Another Part of this question is: Are there big disadvantages for "mixed" architectures, i.e. parts are monolithic and other parts are mircoservices?

Note, that this answer is too specific for my question.


Refactoring is a wonderful tool when used well.

If you have well designed tests in your monolith this will be fairly easy. If not you'll want to add them. Adding them later is always more expensive but still preferable to coding and hoping.

What this is really about is that the real requirements for your project are in working code. That means you must be careful to preserve this working status as you make changes. Good tests ensure behavior hasn't changed even when structure has.

Do this slowly and carefully and it's remarkable how you can turn a design completely inside out and keep everything working.

From your comment:

That answeres one part of my question. The other was: Does it make sense to develop a system which uses both a monolithic and a microservice based architecture? - toogley

It wouldn't make sense to keep adding functionality in both monolithic and microservice styles at the same time. However, there is no reason you couldn't break off a piece as a microservice and leave the rest monolithic until you got around to breaking up the rest of it.

Each style has benefits and trade offs. By being stuck half way you wont fully have the advantages of either. But you will have the advantage that you can start working towards your goal without having to shut everything down until you're done.

  • I don't know of any good reason to intentionally mix two contradictory architectural philosophies but this world is full of crazy requirements and licensing restrictions so I'd hate to rule anything out without knowing the situation. Oct 13 '16 at 12:06
  • @CandidOrange: i am a complete newbie in terms of software development, so i just wondered about the situation.
    – toogley
    Oct 13 '16 at 12:33

I would argue that mixed architectures are what you find the most in the real world.

Very often you are confronted with the question if refactoring or starting from scratch is the right way to go. The problem is, that if you re-do it from scratch you will - at first - always end up with lesser functionality than the legacy system offered.

Think of a large insurance company - their mainframe and all it's 'legacy' code will stay for a long time. But why not create a microservice architecture around it that serves new offerings like mobile apps while still consuming data from the mainframe?

Microservices are a legit way to gradually exchange parts of applications and many enterprises do it exactly like that. The keyword here is 'Digital Transformation'.

Watch how Walmart did their digital transformation with Node.js: https://www.joyent.com/blog/node-js-at-walmart-introduction

Here is a slide deck that covers this topic and also shows how to gradually refactor an application: http://www.slideshare.net/DanielKhan3/splitting-monolithsdeck-slidesharepdf

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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