One of my friend creates separate spring boot application for each functions or modules and run as a separate application and calling it as micro-service
I told him is that the microservice? There is a confusion how to treat a application or a service as micro-service
When i searched internet, i observed authentication would be in a separate service...All microservice will run independently
Can some experts give a good back around of micro-service or characteristics of micro-service to clarify the confusions
Thanks
CodePudding user response:
Answering the question in your title: no. You can definitely build a monolith using Spring Boot, there is nothing stopping you from doing it.
In my point of view a micro-service is a service (could be a Spring Boot app) that observes the following key characteristics:
- Single or highly related business features
- Loosely coupled from other micro-services
- Independente deployable from other micro-services
Having said that, you may find people that takes 1. to the extreme and have every single business feature on its own micro-service. Imagine an online store. In this case, product catalog, user details, checkout and payment would be depicted in their own micro-service. This could make sense in some cases but in others it would be a huge burden to maintain such a complex system with no benefit. I prefer to out together some related business features to avoid having so fine-grained micro-services unless there is a very good reason doing so (example, if you really have the need to scale a very specific feature, lets say in the previous example, the payment micro-service).
Bottom line, there is no rule about how big or small a micro-service must be, assuming they observe some key features described above. You can read more about this architecture in https://microservices.io/ and https://martinfowler.com/articles/microservices.html.