SOA - How granular should services be to maintain performance?

此生再无相见时 提交于 2019-12-03 06:35:08

First off, finding the "sweet spot" in the number of services is difficult for sure. Too many services, and your integration costs suffer, too few, and your implementation costs suffer. You have to find a good balance.

My advice to you is to follow Juval Lowy's methodology in that you should break down your services by areas of volatility, or areas of change. This will give you your granularity level. You should also read his WCF book if you can.

As for the performance, WCF will inherently support many thousands of calls per second depending on your use cases and hardware. Services calling services is not a problem. The platform will support it if you do your part. For example, use the right binding for the right scenario (named pipes to call services on the same machine and TCP to call services across machine where possible). You should also implement a vertical slice of the application and do performance testing before building the rest of the application. This will verify your architecture.

When I say "Service", I mean the complete vertical component that can perform a complete independent operation. And I don't prefer going in more granularity unless there is exceptional requirement. In my view of SOA, A service should perform the meaningful business function that can be independently performed. A service should not require another service to complete its function.

What level of granularity is acceptable in a stable of services without sacrificing performance?

Individual entities. As described by the consultant.

Am I being too skeptical of the performance hits we'll take implementing all our entities as services?

Yes. Way too skeptical.

A decent framework can optimize some of these requests so that they don't involve a lot of network overheads.

As with SQL databases, the problems are largely solved. You'll find that the underlying applications that you're presenting as services are the bottlenecks. The SOA layer is largely plumbing. The bits still need to move through the pipes, the SOA layer just organizes them more intelligently than most of the alternatives.

Should services only be implemented when they are needed, with the "preparation" focus instead going into designing the business layer for the probability of services later being dropped on top of it?

Yes.

That's what "Agile" means.

Find a user story. Build just the services (and entities) for that story.

You will have some significant overhead for the first few stories in getting your SOA framework all squared away and deployable as a simple, repeatable release step.

Never do extensive "preparation" for things you "may" need in some improbable future. Read up on Agile and how to prioritize a backlog.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!