amateur
amateur

Reputation: 44605

direct project reference or communication via wcf

I am currently architecting my .net 4.5 applications. At present I have web layer and a wcf services layer. They communicate to each other over soap.

Both layers are co located on the one server.

I am considering moving from communicating over soap to direct project references. So that it moves from one application from two. Main motivation behind this is to improve performance of not having to undergo serializing and deserializing of communication between web and services.

What I lose from this change, is scalability of moving my services layer to a separate tier in the future, ie a different server.

I am looking for feedback on this, is there a major performance hit from the serialization. Thoughts on the above? Anything that I should consider that I have omitted.

Upvotes: 1

Views: 145

Answers (1)

Pablo Romeo
Pablo Romeo

Reputation: 11396

From my own personal experience, I prefer scaling horizontally (adding more webservers to the webfarm) instead of distributing the application.

I think you may have a considerable performance hit when comparing WCF to a direct local call. But the impact depends on your architecture and on how many calls you would actually issue per request. For example, if you are obtaining 10 entities, and for each one you need a separate WCF call then the overhead will be much larger than issuing a single service call and returning all 10 simultaneously.

Now, maybe another option that you can explore is using NamedPipes instead of HTTP, since they will currently be hosted on the same environment.

See Choosing a Transport for more info.

Upvotes: 1

Related Questions