Monday, November 26, 2018

Web API over WCF

While designing the service layer for new application, this debate is always happened in my team.

        Are we going to choose Web API over WCF or going with WCF?

Choosing right technology always contribute the major role of the success of application. If without understanding all possible factor and product requirement, you cherry-picked any technology, it could be a reason for application failure or performance issue and also it could limited the exposure of client.  

Let back on our topic ‘Web API vs WCF’. there is no doubt, WCF provides a lots of feature and it is much more versatile in case of supporting to many transport protocols (HTTP, TCP, Named Pipes etc.) and can easily build secure, reliable and transaction enabled service and much more in messaging like two –way communication (duplex channel) .

Web API if you need to build  a lightweight, restful service based HTTP protocol and it can leverage of the full feature of HTTP protocol like cache control, versioning etc and you want to expose your service to a broad range of client i.e. web browser, tables, mobile then web API always have advantage over WCF. WCF has very extensive configuration compare to web API and WEB API is very simple and light weight service and easily accessible in limited bandwidth device like smart phones and tablet. Web API supports any text format including XML so in performance, Web API is faster than WCF.

WCF:

WCF
WCF

·         Should support special scenarios such as one way messaging, message queues, duplex communication etc.
·         Should support fast transport channels when available, such as TCP, Named Pipes, or maybe even UDP (in WCF 4.5), and you also want to support HTTP when all other transport channels are unavailable.
·         Should be transaction enabled service or it will be called under other transaction scope.

Web API:


Web API
WEB API

·         Should be restful service over HTTP that can use the full features of HTTP (like URIs, request/response headers, caching, versioning, various content formats).
·         Should be expose your service to a broad range of clients including browsers, mobiles, iPhone and tablets.

Thanks for visiting !!

No comments:

SQL Server - Identify unused indexes

 In this blog, we learn about the index usage information (SYS.DM_DB_INDEX_USAGE_STATS) and analyze the index usage data (USER_SEEKS, USER_S...