Search code examples
architecturemicroservices

Microservices: what are pros and cons?


What are pros and cons of using microservices in comparison with alternative architectures? Is there a rule of thumb when microservices should be used?


Solution

  • The pro's of micro-services are that your applications scale very well. You divide your application in tiny services. It's a hard thing to decide which bounded services you will need. But once you have done this, you can easy scale specific services up to multiple times (the services that actually get the most load) rather than needing to scale your whole application up.

    Another advantage is that it is easier for new developers to start creating new features for your application, since everything is divided into these separated service --> Each service has its own (small) codebase.

    The biggest disadvantage of using microservices are of course that there is a higher chance of failure during the communication between the different services.

    The usage of microservices usually only starts paying off when your application is getting too big to maintain as a monolithic application. Try starting as a monolithic but keep your bounded contexts in mind while developing (try to keep it as separated as possible) to you can migrate to microservices if needed later on.