What is a microservice architecture?

Asked

Viewed 1,923 times

23

I read that "microservice-based architecture" basically makes system requirements specific and independent services.

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

My question is: For each service is generated one WAR?

Working with a separate application in modules and in 3 layers: API’s, Services and DAO: This is or is not considered a micro service architecture (not isolated in different instances)?

  • 1

    I found this post very interesting and you will want to read to understand a little more: http://www.itexto.net/devkico/? p=1768

  • @rray thank you. I had already seen this question but it does not encompass the scope of SOA, which is what makes me more confused when comparing to the microservices architecture

3 answers

13


First answers to these questions that can be answered more "simply":

For each service one is generated WAR?

It obviously depends on the technologies/platform used. In a real environment you will notice that some micro services can be packaged in WAR to be deployed in Java web containers, but others will not, may be a simple Javascript deployed in an HTTP server.

Working with a separate application in modules and in 3 layers: API’s, Services and DAO: This is or is not considered a micro service architecture (not isolated in different instances)?

It’s probably not a micro-service architecture. It’s likely that it’s more of a monolithic architecture and we’ll soon see what this is.

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

  • micro service is the consequence of when we apply the principle of single responsibility at the architectural level, whether software, systems, etc.
  • considering the above, a micro-service-oriented architecture can be defined as a set of small services, each running independently and communicating with each other through a lightweight mechanism, each micro-service 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 comparing 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, scalability, deployability, etc.
  • a monolithic architecture is one where an application is built in a single unit, considering the Java Web platform, all services in one WAR would be an acceptable comparison of how a monolithic application is packaged.

Using the graft of the article you quoted:

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

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

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

In addition, we have the standard amusements that are directly related to micro services, such as unique services by virtual machine or by container, registration and discovery of services, etc.

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

Beyond the blog of Martin Fowler, see also those of the Spring, Nginx and technical blogs of 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 form of deployment of their services, quick response to business changes, scalability, etc.

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

  • 1

    Cool your answer, the links you posted etc... many people leave dividing their applications into multiple modules thinking they are using microservices but in fact not even a simple SSO have implemented, architecture based on Microservices is a very beautiful architecture, but it is not a silver bullet, in certain contexts more boring than it helps, if it is not all very well thought out has code replication, problems in deploy with integration continues and beyond, if it is not a team of seniors has great chance of failure, after all not everyone is a Netflix :) Congratulations on the reply.

5

Microservices

Microservices is the development of applications as a set of small services, where each performs its own process and can be built in a modular manner, based on the business capacity of the organization in question. This makes the implementation and scalability can be treated according to demand. Moreover, the independence between services allows them to be written in different programming languages and different technologies, in order to best meet specific needs. Another important point is that each service can be managed by different development teams, enabling the formation of specialized teams.

Perks:

  • Easy understanding and development of the project;
  • Easy and fast deployment (build and deploy);
  • Reduction of startup time as Microservices are smaller than monolithic code applications;
  • Possibility to apply the best tool for a particular job.

Disadvantages:

  • Difficulty in deploying and operating distributed systems;
  • As each Microservices usually has its own database, transaction management becomes more difficult (multiple databases);
  • Deploying a change in a service used by many systems requires coordination and caution.

Comparison with monolithic standard

A business application is usually built into three main parts:

  • Interface
  • Database
  • Applying server-side

In the interface part are the HTML and Javascript pages, in the database are related to the tables and the application server-side will handle HTTP requests, execute domain logic, receive and update database data and finally select and popular HTML blocks to send to the browser. This application is monolithic, is made as a single unit, any change made in the system will have to be made a new publication.

Although these applications are successful, a small change to one part of the software, even if small, makes the entire application have to be republished. Over time it becomes increasingly complicated to maintain a modular structure. Due to these problems, the Microservices standard has been created.

That one image shows the comparison between a monolithic application and Microservices:

inserir a descrição da imagem aqui

Microservices and SOA

SOA means Service-Oriented Architecture (Service-Oriented Architecture) is a style of software architecture that states that the functionalities implemented by applications must be made available in the form of services. That one image, shows the main features of SOA:

inserir a descrição da imagem aqui

Microservices and SOA are very similar in principle, but products that are targeted to SOA or Microservices have differences that make them suitable for different use cases.

If you are developing an application, then a Microservices framework will be more agile and give you more control as a developer. If what you’re trying to do is orchestrate a series of business processes across your company, then a SOA product probably provides a better set of tools.

References:

-2

Hello,

Thinking of distributed processing the ideal is to have several functionalities of the system decoupled in service mode.

For example, we have an application that only "Displays", "Updates", "Inserts" and "Deletes" a client. Instead of having all this coupled in one place, it would be more profitable to have multiple served terms (WCF, WEB SERVICE, JSF) distributed. So to gain performance as we are talking about services we can have the Web application on one server and the services on another (the).

http://www.itexto.net/devkico/? p=1755

  • 1

    Luã, if you can provide a more complete answer. I have read this text, it seems to me that as it is something relatively new no one knows define "right".

  • I’m sorry, I haven’t found much that will really help you on that subject. I’ll forward your question to some architect friends, let’s see if they can help you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.