Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microservices vs multi-layered architecture [closed]

My project has one backend service (Web API) and one frontend SPA application. Backend service has presentation, application services, domain and infrastructure layers located in different .net assemblies. Domain layer has business domain objects, infrastructure – communication with external data and other stuff, application services – set of services used by presentation layer, presentation – Web API controllers. I think it’s very common layered architecture.

Our new architect announced we are going to move backend to microservices architecture braking down our layers and dividing domain, application service and infrastructure layers to a few services and convert presentation layer to backend for frontend layer (as here described). In feature, we are going to have mobile application. Sql Server database is going to leave as is for now.

I don’t have experience with microservice architecture, so my questions are: Is multi-layered architecture out of fashion already? What benefits and problems can bring such architecture design for my application?

like image 307
Varman Avatar asked Jan 24 '17 19:01

Varman


People also ask

What is difference between microservices and SOA?

The main difference between SOA and microservices: Scope The main distinction between the two approaches comes down to scope. To put it simply, service-oriented architecture (SOA) has an enterprise scope, while the microservices architecture has an application scope.

Why did Netflix switch to microservices?

Beginning In 2012, Netflix began adopting microservices. When Netflix experienced massive database corruption due to a missing semicolon, they realized that their monolithic application was susceptible to a single point of failure.

What are main differences between microservices and monolithic architecture?

A monolithic application is built as a single unified unit while a microservices architecture is a collection of smaller, independently deployable services.

What is a disadvantage of a Microservice architecture?

Microservices has all the associated complexities of the distributed system. There is a higher chance of failure during communication between different services. Difficult to manage a large number of services.


1 Answers

Microservice and layered architecture are a little bit different things. Microservice architecture it’s about how your application is constructed, what components (services) it has and how these services communicate with each other, how they are developed, deployed and so on.

Multi-layered architecture it’s about logical dividing application into layers where every layer has its own logical function (presentation, domain and so on). Very often multi-layered architecture is related to monolithic architecture and service design.

According to your description, you aren’t going to break down your layers, your architect wants to split logic into different services. These two architecture styles can be used together. For instance, you can have 3 services and every service can have presentation, domain and service layers. If your current layers in one service are heavy enough it makes sense to split them out making development and testing easier. Backend for frontend style has also its benefits especially if you want to add a mobile app.

About this

Is multi-layered architecture out of fashion already?

No, they are used both but with microservices as a rule layers should be much thinner than in monolithic application.

What benefits and problems can bring such architecture design for my application?

I recommend you look at comparison between microservice and monolithic architecture styles and this post. To divide or not you should consider the size and complexity of your project, the size of your team. Dividing has to bring benefits to the whole application making development easier. The Monolithic application has its own benefits and up to some size of the project, it can be a good decision. Of course, it’s a nightmare working with a huge monolithic application as well as with one hundred very small (nano) services.

like image 150
Vasyl Zv Avatar answered Oct 25 '22 22:10

Vasyl Zv