Difference between Microservices Architecture and SOA
I've been reading up on Microservice Architecture and I am trying to see a difference between it and regular SOA (apart from the services all deployed individually). Can anyone tell me the difference and maybe the pro's and con's of Microservice Architecture?
I guess you could think of the Microservices Architectural Style as a specialisation of SOA. Don't forget that one of the accepted views is that all SOA really is, is four sentences:
Service compatibility is based on policy
-Don Box, Microsoft (pre-.Net 3.0)
This brings us to the canonical definition of microservices, from Lewis/Fowler:
In short, the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralised management of these services, which may be written in different programming languages and use different data storage technologies.
From this definition, it's clear that microservices fulfil at least the first two tenets (with a real emphasis on the second), but it's questionable whether they fulfil the third (I don't really understand tenet 4 so I won't comment).
The reason the third tenet may not hold for microservices is that one of the characteristics of microservices is that they are generally exposed over a RESTful API, which, one could argue, does not expose contract and schema at all (over and above the regular HTTP verbiage), as we see from Fowler:
a suite of small services, each... communicating with lightweight mechanisms, often an HTTP resource API
Another way in which a microservices style deviates from SOA is with this prescription:
These services are... independently deployable by fully automated deployment machinery
Following the original tenets of SOA does not prevent me from manually copying my service binaries into my production environment, but with the microservices approach, the service deployment and management should be fully automated.
The core difference between SOA and microservices lies in the size and scope. As the word "micro" suggests, it has to be significantly smaller than what SOA tends to be. Microservice is a small(er) independently deployable unit. Beware of very small microservice antipattern - nanoservice. A SOA can be either a monolith or it can be comprised of multiple microservices. Martin Fowler says he likes to think SOA to be a superset of microservices.
Martin Fowler: https://youtu.be/2yko4TbC8cI?t=15m53s
Edit : Here is another video by Martin Fowler, talking about difference between Microservices and SOA. https://youtu.be/wgdBVIX9ifA?t=13m10s
The term microservices puts a lot of emphasis on the size of the services, a point that most practitioners find to be rather unfortunate. Stefan Tilkov argues that you should start from the overall application and figure how it can sensibly be carved up. Sam Newman's talk emphasizes that you should derive your microservices based on the DDD notion of Bounded Context
You might find this interesting: Summary of book "Building Microservices"
Straight from Oracle's post, about differences between SOA and microservices, a brief description of the difference can be summed up in Torsten Winterberg (Oracle ACE Director) words:
Microservices are the kind of SOA we have been talking about for the last decade. Microservices must be independently deployable, whereas SOA services are often implemented in deployment monoliths. Classic SOA is more platform driven, so microservices offer more choices in all dimensions.
So, SOA is an architectural pattern in which application components provide services to other components. However, in SOA those components can belong to the same application . On the other hand, in microservices these components are suites of independently deployable services .
Microservices is the architectural specialisation of SOA, driven by DevOps practices. The individually deployable services made it easier to apply Continuous Integration / Continuous Deployment
链接地址: http://www.djcxy.com/p/34082.html上一篇: API与微服务方法中的事件
下一篇: 微服务体系结构和SOA之间的区别