server – What is a microservices architecture?

Question:

I read that "microservice-based architecture" basically turns system requirements into specific, independent services.

In this article , right after the definitions it says that it is possible to separate the services in specific instances (machines) according to the hardware requirement of that service .

My question is: Is a WAR generated for each service?

I work with an application separated in modules and in 3 layers: API's, Services and DAO: Is this or not considered a microservice architecture (not isolated in different instances)?

Answer:

First answers to these questions that can be answered in a more "simple" way:

Is a WAR generated for each service?

It obviously depends on the technologies/platform used. In a real environment you will find that some microservices can be packaged in WAR to be deployed in Java web containers, but others won't, it can be simple JavaScript deployed to an HTTP server.

I work with an application separated in modules and in 3 layers: API's, Services and DAO: Is this or not considered a microservice architecture (not isolated in different instances)?

It's probably not a microservice architecture. It's likely to be more of a monolithic architecture and we'll see what this is soon.

Briefly (but not so much :P) we can say that:

  • microservice is the consequence of when we apply the principle of single responsibility at the architectural level, whether in software, systems, etc.
  • considering the above, a microservice-oriented architecture can be defined as a set of small services, each running independently and communicating with each other through a lightweight mechanism, each microservice may or may not provide a form of user interface . If we look at the "guts" of each micro service we will see that it is independent, so making a comparison with its architecture, each micro service will publish its own API (which can even be the form of integration between micro services), its own(s). ) DAO(s), etc. Granularity will depend on your need, always taking into account independence, ease of scaling, deployment, etc.
  • a monolithic architecture is one in which an application is built in a single unit, considering the Java Web platform, all services in the same WAR would be an acceptable comparison of how an application conceived in a monolithic way is packaged.

Using the graft from the article you cited:

…it is possible to separate services into specific instances (machines) according to the hardware requirement of that service.

Yes, this is possible with this architecture, but it is also possible with other less granular architectures.

What we gain with microservices is the high granularity that the architecture allows, that is, we can have several microservices on the same server and we can only scale other microservices on another server.

In addition, we have standard diversions that are directly related to micro services, such as unique services per virtual machine or per container , service registration and discovery, etc.

In the links below you can find in detail what a microservices architecture is. As you will see, it is quite large, so it is not worth including it here, the details would be very extensive:

In addition to Martin Fowler 's blog, see Spring , nginx and technical blogs from companies that have very granular architectures and rich APIs, such as Netflix , the aforementioned SoundCloud , among others, they always publish something about how they are using micro-services to improve the way you deploy your services, respond quickly to business changes, scalability, etc.

As you can see, there is already a lot of content on the subject. So good studies =)

Scroll to Top