Search code examples
spring-bootmicroservicesbackend

What is Microservices and is there a connection with MVC


I'm familiar with spring boot framework and I developed an Application which helps to handle online Assignments.I used few service classes to handle different tasks of the application and its structure can be seen here.

File Structure of my Project

And I have seen several complex applications built as independent packages based on the task it do in the application.

(1) My First question is can my Application be called as a MicroServices Application?? Because I have used independent services for the application development.

(2) And my second question is Can a application developed in MicroServices Architecture has MVC Architecture at the same time.But I have seen in several tutorials they are 2 different architectures.But a Moicroservices Application also has Models ,Views and Controllers at the same time.

So can those 2 be used at the same time??

Thank you!!


Solution

  • You should do some deeper research yourself about the concept and theory of microservices. Studying other applications without the basic knowledge can be misleading.

    (1) Just because you are using multiple classes called services does not mean, you are building microservices application. Microservice application examples can be - student management rest api, question and answer management rest api, UI for administration, UI for public usage etc. All of them can be separate spring boot apps, or any other technology capable of handling the requirements (node.js, python, php, Asp.net ...) You should be able to deploy, test and use them as separate standalone apps.

    (2)I think a microservice app does not need views, it can be a rest/soap app, log aggregation app, health check app, messaging service app etc. But different types can use different architecture, one of which can be MVC.

    By definition of M. Fowler microservices are

    ..an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API.

    As you see the definition is ambiguous. I think you are building a monolith application with a good separation of responsibilities into classes called XyServices - a possible candidates to migrate to microservices.