Microservices and Service oriented architecture (SOA) are two very popular software architecture approaches, While both architectures have some similarities, they also have lots of differences as well.
In this article, we are going to discuss about the differences between these approaches.
Microservices Architecture
Microservices architecture style is a way to design software applications by breaking down the complex software into multiple smaller, independent services. These small services are called microservices, and developers build software applications by combining multiple smaller services (or microservices), where each microservice not only performs a very specific function but also can communicate with other services. This approach not only provides higher flexibility but also provides better resiliency. For more information please check Introduction to Microservices Architecture.
Below diagram showcases a sample block diagram of microservices architecture.
Service Oriented Architecture (SOA)
Service-Oriented Architecture (SOA) is a software architecture approach in which smaller services are designed to communicate with each other over network to build large complex software applications. This architecture not only provides better flexibility but also provides better reusability. For more information please check wiki link.
Below diagram showcases a sample block diagram of SOA architecture.
Differences between Microservices and SOA architecture
Microservices Architecture | Service Oriented Architecture (SOA) |
---|---|
This architecture approach emphasizes to break system into small, independent service to perform one specific task. | This architecture approach emphasizes to break system into small business unit to perform one business task. |
Typically, micro services are relatively smaller and more flexible service. | Typical SOA services are more relatively large and modular service. |
Each services can be deployed independently ensuring faster and flexible deployment. | Services are deployed modular wise. |
Services interact with each other using light weight protocols such as HTTP, REST etc | Services interact with each other using heavyweight protocols such as XML, SOAP etc |
This architecture approach allows autonomy and independent development of each services. | This architecture approach emphasizes on interoperability and standardization. |
In this architecture, each service can be scaled independently by adding more instances. | In this architecture, module wise scaling is required and hence has relatively higher complexity. |
Each services can define their own data storage or database as required by the service. | Typically a single data storage layer is shared by each module in the application. |
As can be seen above, each architecture approach has their own pros and cons and hence, the right approach must be decided based on the business need of the software application.