Search code examples
wcfasp.net-web-apiodata

what is the future of Microsoft WCF data services technology? Should be start migrate to WebAPI?


We have been using WCF data services (aka Astoria) for exposing the ODATA recently i am reading that microsoft is not investing any more on this they are prefering to use ASP.NET WebAPI as mechanism to expose ODATA. Did any one did any comparision on using ASP.NET WEB API vs WCF Data Services ? Should we start migrating to ASP.NET WebAPI instead of WCF Data Services?


Solution

  • My simple suggestion is to stick with the simplest option that is available in the form of REST API. You could use any technology to build REST; provided it follows some standard defines by REST Specification.

    You can read about my guidelines on WEBAPI REST: http://imcodebased.com/restful-webapi-best-practices/

    You can use MVC or even WebApi2 for REST; however don't go beyond that Microsoft may produce for you. It might save some time, like in case of OData (paging/filter) but you will find that Microsoft will stop spending money on further enhancements, or even cutting off completely. Then you will go back to the drawing board on moving away.

    So you are right, you should move out from OData. Now on your question about whether you move to WEBAPI or WCF, then again the question that you need to ask is do you want complexity or you just want to expose a data through only HTTP protocol.

    If you want to support only a HTTP protocol then WebApi is the solution for you other. You need to look for WCF.

    You choose the Web API if you want to expose the HTTP services to a broad range of clients. These includes the mobile , iPhone and browsers.

    Main Reason of choosing the WCF:

    You can choose the WCF if you want to create the service that supports one-way messaging, message queues, duplex communication etcetera.

    You can choose the WCF if you want to create a service that uses the fast transport channel, such as TCP, UDP, Named pipe etcetera.

    You can read more about the comparison here https://msdn.microsoft.com/en-us/library/jj823172(v=vs.110).aspx

    But the million dollar question is, who is your audience of this API? if you want to expose, regardless of devices etc.. then I bet you are talking about Http protocol and WebApi is your best solution.

    You can start with WebApi, and then you can easily move to WCF; if at all you need to support any other platform/ protocol.