微服务架构--编程过程中的不变与万变
We are in the changing world , exspecially in interenet,more and more developing structure appeared in latest years from MVC to SOA ,from SOA to MicroService , I amazing these changes and I need to learn more and more new knowledge to catch up the speed of changing . But when I read some articles of MicroService ,I found some interesting things ,I think it can give me some inspiration about these changes。
First of all , the purposes of structure changes are supporting business service .As we know ,requirement changed so fast ,business logical become more and more complex , we need a agile frame work to delivery a project that is can be developed fastly, can be modified fastly ,can be maintain easily , so that MVC appeared ,it provide a layer framework that every layer only do their best to provide service to higher service , higher layer call the bottom service by interface . the benifits of the frame work are split developing work to more detail , the developer can choose the layer they good at and become master not think about more whole project .At same time it make program more strong ,more fixable for changes, such as error debuging and business logical changes .after smart device become popular , our apps need to available on both smart device and pc ,MVC become not suitable for it , because we must copy the pc logical to smart device and implement again (I surppose PC apps write with C# and smart phone code write with java) ,then maitain two source code , changed at the same time if the business requirement have changed . even if the old logical can support two device ,we also need to change some logical to adapt the new device ,these changes maybe bring new bugs to old code , make old one unstable . In order to solve the problem ,SOA provide new solution ,it package business logical with webservice ,tcp service and other available protocols like WCF done ,these service are different chanels to access the business logical ,same logical ,the apps comsumer the these service by service chanels 。Developer can have less maitain burnden by the way and apps can find their properly sevice . It seems a good ending we can enjoy our workingtime ,but Ops team complain that the service so big that it will waste more time on buliding and the performance is not ideal as well , the worse is our new team member need to spend more time to clearfy sourcecode and can't change anylogical even if he know all of business logical because it too complex to clearfy in short time.We need to rethink our structure to make it become easily deployed , easily developed and easily maitained , at this time we naturely split our SOA Sevice to more detail service ,smaller and smaller to can be fixable to all stakeholders ,no one know new strucure name unstill one call him MicroService . when you read upper content , do you agree with my opinion that all of structure changes are support business and is a history of make all stakeholders satification.
Sencond ,However the structure changed ,they are still layer structure .From MVC to MicroService, they always consumer lower layer service to complete a task ,the lower service always stable and independent to higher layer like our social structure ,we alway take time to service others and others service us by their way , it's a good simulation of real life you can found this from below picuture (more information please check http://www.cnblogs.com/imyalost/p/6792724.html):
MVC
Microservice
All in all , no matter what structure you want to use ,please think more about your business requirement ,choose a right one even if it is a old one
上一篇: 网上创业比较赚钱的副业是什么?