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?
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.
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.
A monolithic application is built as a single unified unit while a microservices architecture is a collection of smaller, independently deployable services.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With