SOA and Microservices are difficult to compare in a fool-proof way. SOA and microservices can be the same, when all the services a SOA consists of are microservices. A service in microservices may be fine-grained with a single responsibility. While service in SOA may have multiple responsibilities. SOA is often towards the enterprise these days, using heavy-weight technologies and protocols including SOAP. Microservices is the lean and more agile approach. SOA pattern requires a Common Domain Model pattern. There is no SOA if there is no Common Domain Model in place.
What are the similarities between SOA and Microservices in the first place? DevOps is used quite often with both SOA and the Microservices. Containers in SOA are used not as often as for Microservices but it is still used. SOA and microservices share the same principles and hence the similarities are not limited to these few sentences.
Now, again coming back to the differences. SOA uses Enterprise Service Bus for communication but microservices use simpler messaging systems. Microservices components store data independently but SOA components share the same storage. Microservices typically use Cloud but for SOA application servers are traditional. SOA essentially is a monolith.
SOA defines 4 basic service types – Business/Functional Services, Enterprise Services, Application Services and Infrastructure Services. Microservices have limited service taxonomy. They consist of 2 service types – Functional Services and Infrastructure Services.
Service components within a microservices architecture are usually single-purpose services. But in the case of SOA, service components can range in size, it can be small application services to very large enterprise services. SOA enhances component sharing, whereas the Microservices tries to minimize sharing. Systems built on SOA are likely to be slower than Microservices as SOA relies on multiple services to fulfil a business request. The microservices architecture pattern has an API layer, whereas SOA has a messaging middleware. The messaging middleware of SOA gives a set of additional capabilities which usually not found in microservices. SOA promotes multiple heterogeneous protocols through its messaging middleware component. SOA architectures rely on messaging protocols and SOAP as primary remote access protocols. But the microservices rely on REST and simple messaging.
Microservices simplify the architecture pattern by reducing the number of choices for integration but it is not simple to easily say which architecture is better than other. SOA is suitable for larger and complex business application environments which may require integration with heterogeneous applications. Microservices are better for smaller web-based systems.