DEV Community

Priyanshi Sharma
Priyanshi Sharma

Posted on

SOA vs Microservices

SOA (Service oriented architecture) and 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 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:

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

Advantages and Benefits of SOA architecture

  1. Since SOA focuses on reusing services throughout the web application so the speed of development is faster.
  2. Faster development speed consequences in less cost of web application development.
  3. The code written in SOA is easily readable and manageable.
  4. The deployment is easier in SOA because web applications are deployed only on a single server instance.
  5. The cost of servers to run web applications developed in SOA is very less.
  6. 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.

Disadvantages of Service Oriented Architecture

  1. The extreme reusability of data and services results in extreme dependability which often becomes a single point of failure for the whole web application.
  2. A Large server instance is required to host the web application which imposes hardware limitations such as data bus and network communication bandwidth.
  3. 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.
  4. 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.

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:

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

Benefits of Microservices Architecture

  1. Microservices architecture offers high availability, reliability, resilience and low latency(when application requests are redirected to the closest deployment server).
  2. Applications are agile, nimble and easy to scale up.
  3. The web applications become programming language and framework independent as each and every service can be developed independently.
  4. The deployment process is smoother as it is done service by service so there is usually no web application downtime.
  5. 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.

Disadvantages of microservices architecture

  1. 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.
  2. Additional infrastructure to observe, monitor and secure the service deployments is required.
  3. The development and deployment are comparatively very high than the web applications developed over SOA.
  4. You have to hire developers with a comparatively bigger skillset.

Source: Decipher

Top comments (8)

Collapse
 
siy profile image
Sergiy Yevtushenko

There is no such thing as 'microservices architecture'. At best we can talk about 'architecture style', but in fact microservices is exactly the same SOA but with much higher requirements to the quality of design, implementation maturity of the infrastructure and development team. If team is unable/incapable to implement proper SOA, it definitely will fail with microservices.

Collapse
 
jankapunkt profile image
Jan Küster

+1

Collapse
 
priyanshi_sharma profile image
Priyanshi Sharma

Thanks for your feedback.

Collapse
 
asiedu13 profile image
Asiedu13

Amazing. I read it once and understood it perfectly. Thanks

Collapse
 
priyanshi_sharma profile image
Priyanshi Sharma

Glad to hear that 😊

Collapse
 
mdhesari profile image
Mohammad Fazel

Thanks, you nailed it!

Collapse
 
priyanshi_sharma profile image
Priyanshi Sharma

Don't forget to share your thoughts!

Collapse
 
chirdeparag profile image
Parag Chirde

Good article. SOA can be moreover considered as a philosophy of which Microsservices is the implementation.