Microservices: what are pros and cons?

前端 未结 3 826
盖世英雄少女心
盖世英雄少女心 2021-01-30 07:26

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

3条回答
  •  一整个雨季
    2021-01-30 07:44

    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.

提交回复
热议问题