SOA vs Microservices
Tags: webdev, react, javascript, node
Published: 2021-04-15 08:20:36

[SOA (Service oriented architecture) and Microservices](https://www.decipherzone.com/blog-detail/soa-vs-microservices) are two different architectures for web application development. Service Oriented architecture focuses on reusing services and components throughout the web application to reduce the amount of effort to write code by reducing redundancy. The services are code and data integrations to build and execute a functionality; for example- syncing an email, validating a logged-in user with cookies, sending notifications. Whereas on the contrary microservices architecture focuses on high reliability and availability of the application even if redundancy in data resources and code has to be adapted. Every functionality in the web application is developed as a service that gets containerized and hosted on a separate server instance. Such an approach enhances the agility of web applications and it keeps on working even if some of the services fail.

In [SOA](https://www.decipherzone.com/blog-detail/service-oriented-architecture) the whole backend system application is divided into three parts i.e. controller, services and business logic. The whole backend system is hosted on a single server instance and the services in the backend system can communicate with each other directly, however to the external world (frontend and third-party apps) these services are made available via API calls. Whereas in microservices architecture these services are developed and deployed as separate applications on their own server instances. The communication between services is also done via APIs in a microservices architecture.

##**When to use SOA(Service Oriented Architecture)?**##

Service oriented architecture should be used whenever you are building a web application with the following aspirations:

<ul>
<li> Whose users can bear the downtime?</li>
<li> When a web application is required in comparatively less budget than highly resilient web apps. </li>
<li> When the business owner wants to save server and device maintenance cost by migrating every enterprise application on the cloud. </li>
<li> A large web application needs to be developed in a shorter time frame. </li>
<li> When Single points of failure are tolerable. </li>
<li> When Data redundancy is tolerable. </li>
</ul>

##**[Advantages and Benefits of SOA architecture](https://www.decipherzone.com/blog-detail/service-oriented-architecture)**##

<ol>
<li> Since SOA focuses on reusing services throughout the web application so the speed of development is faster. </li>
<li> Faster development speed consequences in less cost of web application development. </li>
<li> The code written in SOA is easily readable and manageable. </li>
<li> The deployment is easier in SOA because web applications are deployed only on a single server instance. </li>
<li> The cost of servers to run web applications developed in SOA is very less. </li>
<li> Businesses don’t need to provide support for multiple versions of an application because the rollout of new applications is done on a production server instance so it becomes available to everyone at the same time. </li>
</ol>

##**Disadvantages of Service Oriented Architecture**##

<ol> 
<li> The extreme reusability of data and services results in extreme dependability which often becomes a single point of failure for the whole web application.</li>

<li> A Large server instance is required to host the web application which imposes hardware limitations such as data bus and network communication bandwidth. </li>

<li> The deployment of such bulky web applications built over SOA takes a lot of time to deploy and stabilize the release. It’s the main reason why the deployment of such web applications is scheduled on weekends. </li>

<li> The web application development in SOA becomes dependent on a single programming language or a framework. It often happens in the development process that an open-source functionality or a better implementation is available in another programming language but the development teams cannot consume it within their application. In such scenarios, the development teams also have to develop that functionality which consequently increases the development cost and time. </li>
</ol>

#**[Why microservices architecture?](https://www.decipherzone.com/blog-detail/why-microservices-architecture)**#

Microservices architecture works on the principle to decentralize everything within the web application. Microservices architecture offers high resilience and availability by adapting to the redundancy of server instances and data duplication. This redundancy and duplication reduce the cost efficiency of the web application development and deployment process. Since services are deployed as separate applications on their own server instances with backup containers ready to run in case there is a spike in service call requests, the failure threshold gets pushed up. The high availability of hardware resources enables applications to offer high resilience. The workload on applications being distributed over independent services enables high availability because the web application will not fail even if some of the services stop working. The cross-region replication protects the data from hazards and offers low latency.

##**When to use microservices architecture?**##

Microservices architecture should be used whenever you are building a web application with the following aspirations:

<ul> 

<li> When zero downtime is desirable.  </li>
<li> When web application development and deployment cost is less of a concern than high resilience and availability.  </li>
<li> When single points of failure aren’t tolerable.  </li>
<li> When you have ample time to develop a web application.  </li>
</ul>

##**[Benefits of Microservices Architecture](https://www.decipherzone.com/blog-detail/benefits-microservices-architecture)**##

<ol>
<li> Microservices architecture offers high availability, reliability, resilience and low latency(when application requests are redirected to the closest deployment server). </li> 

<li> Applications are agile, nimble and easy to scale up. </li>

<li> The web applications become programming language and framework independent as each and every service can be developed independently. </li>

<li> The deployment process is smoother as it is done service by service so there is usually no web application downtime. </li>

<li> The selection of server instances and cloud hosting plans is correlated to the use case and usage frequency of service hence, the dependability on a large server instance is eliminated. </li>

</ol>

##**[Disadvantages of microservices architecture](https://www.decipherzone.com/blog-detail/what-are-microservices)**##

<ol>
<li> The development process is extremely time-consuming and tedious due to the complex structure and deployment is also of the same nature because new feature deployments have to be done service by service. </li>

<li> Additional infrastructure to observe, monitor and secure the service deployments is required. </li>

<li> The development and deployment are comparatively very high than the web applications developed over SOA. </li>

<li> You have to hire developers with a comparatively bigger skillset. </li>

</ol>

Source: [Decipher](https://www.decipherzone.com/blog)