Search code examples
sql-serverweb-serviceswcfdatabase-connectionweb-performance

Can a WCF Service database connection be as fast as a direct database connection


Is database connection through WCF Service slower than direct database connection by nature? Or it is a question of how to implement it?
Is there something specific that makes it impossible for a WCF service connection to be as fast as a direct one: XML-based format, transmission protocol used or something else?

My question is a rather general one, that's because I'm trying to grasp the essense of the issue. For example to understand: can it be possible, in principle, that there would be no difference (regarding performance of an app) whether a database is located inside a local network or somewhere in the Cloud?


Solution

  • I hate saying "always" for anything, but all other things being equal, a direct connection will always be faster.

    The cost of serializing/deserializing alone will create overhead.