Search code examples
web-applicationsarchitecturemicroservices

Can you hybridize microservices with monolithic applications?


I'm learning about architectures. Take if I had a monolithic application built over many years. Can you then incorporate new microservices to work along side the monolithic app? Or is there something innate to the microservices architecture that would be violated?


Solution

  • Yes, you can extend an existing system by adding functionality in service format (and with its own development lifecycle). In this scenario you will likely view the legacy monolith as a "heavy" service that can interact with other services.

    When you do that it is recommended that you ensure that the responsibilities are clearly separated and the communication/dependency between the services is versioned cleanly. That allows the version migration to follow best practices as you would with an external service provider. This in turn will make your overall architecture more flexible and scalable both in complexity and development organization size/productivity.

    It is also a recommended practice to carve out specific components or functionality of a monolith in a step by step fashion when migrating to a microservices architecture style. So the situation you are describing is very common in this scenario.

    I do recommend you read these basic articles from Martin Fowler (regarded as one of the inventors of the microservices architectural style).