Reputation: 7632
I am working on a .Net application that uses the WCF to communicate with the business layer. The WCF services are hosted in a windows service.
Now I am transferring the application to a cloud application using the windows azure platform, so I hosted my WCF service in a worker role and they are working normally.
I want to know if this is the correct decision to host the WCF services in a worker role or is there any another better solution to do so.
Upvotes: 0
Views: 397
Reputation: 31641
You only have (2) options - Web or Worker Role (or VM - but that isn't useful here). Worker Roles will never restart to release memory, while Web Roles will recycle (unless using IIS autostart/AlwaysRunning). Essentially - they are doing the same thing (they even use the same host). The only issue I could see is how IIS manages process lifetime versus a standard windows always-running process. The other consideration is that IIS (web role) probably has more security checks and permissions than the standard windows process (worker role). I would certainly take a look at improving the default security of your WCF host.
Upvotes: 1