none
Is WCF Lighter/Faster Than Entity Framework? RRS feed

  • Question

  • In the final implementation, is WCF lighter (bytes) / faster (msec) than EF? I am assuming it is since EF is WCF based, but more user code is needed to implement WCF.

    Sunday, October 16, 2016 2:02 PM

All replies

  • Hi AlaskanRogue,

    >>In the final implementation, is WCF lighter (bytes) / faster (msec) than EF? I am assuming it is since EF is WCF based, but more user code is needed to implement WCF.

    You cannot compare the two - they're totally different beasts, and in many solutions, they will be working together, but cannot compare with each other.

    • Entity Framework is an OR mapper to make your database access easier; you can compare this to e.g. NHibernate, Linq-to-SQL, Subsonic, Genome, or other OR mappers

    • WCF  is a way to expose your data models to the outside world over HTTP/REST; compare this to legacy ASMX webservices, pure WCF services, other service technologies

    For more detailed information, please check the following link:

    WCF Data Services or Entity Framework

    Here is a sample implement a simple WCF Service using Entity Framework as the backend ORM.

    http://www.codeproject.com/Articles/127395/Implementing-a-WCF-Service-with-Entity-Framework

    Hope it helps!

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by cheong00Editor Monday, October 17, 2016 10:32 AM
    Monday, October 17, 2016 3:10 AM
  • Thanks Kristin. Actually the link to your previous answer held the answer indicating that WCF was an layer on top of EF. Is that the correct?
    Monday, October 17, 2016 12:20 PM
  • The example given by Kristin's answer just happens to demonstrate how to use both technologies: Entity Framework to provide easy database access and WCF to expose that data as a service.

    However, they are still separate technologies.

    If you wanted, you could use WCF as the service layer and some other Object-relational mapper to access the database (or even just access the database directly with ADO.Net if you wanted).

    Conversely, you could use Entity Framework to access the database but some other service technology to expose that data over http.

    Entirely up to you and your requirements!

    Monday, October 17, 2016 12:44 PM
  • Hi AlaskanRogue

    >>Thanks Kristin. Actually the link to your previous answer held the answer indicating that WCF was an layer on top of EF. Is that the correct?

    No, It's wrong.

    As I mentioned before,  they will be working together, but cannot compare with each other.

    And thanks for RJP1973's help, because you mean what I mean.

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Kristin Xie Tuesday, October 18, 2016 1:34 AM
    Tuesday, October 18, 2016 1:32 AM
  • Thanks Kristin and RJP. Understand.

    So back to the basic questions:

      Query database to answer received which is faster?

      Code size? (impact of life on a phone 24/7???)

    Tuesday, October 18, 2016 3:32 PM
  • Hi AlaskanRogue,

    >>So back to the basic questions:

      Query database to answer received which is faster? 

    From my side, it is hard to decide which is faster. Each have their own advantages. I would suggest you ask in WCF forum or EF forum.

      Code size? (impact of life on a phone 24/7???)

    Sorry, I cannot understand what you mean.

    Actually, each post corresponds to one issue. If you have any other issues about WCF, please feel free to post in this .NET Framework Windows Communication Foundation, Serialization, and Networking forum. If your issues related to Entity Framework, please use Data Platform Development   > ADO.NET Entity Framework and LINQ to Entities forum. Anyway, please try these forums.

    Now please help close this thread by marking helpful reply as an answer, thanks for your understanding.

    Have a great day!

    Kristin

     

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Kristin Xie Friday, October 21, 2016 6:11 AM
    Friday, October 21, 2016 6:11 AM