1
votes

I have an MVC front end application (relatively small) with its own DAL implementation using repository pattern. I am thinking of moving the DAL in its own WebAPI project to maintain cleaner separation. The MVC app is hosted in Azure using a cloud service (web role). The WebAPI will only be used by the front end application and would not be exposed to any other external application for now, but even then i would still want it to be hosted as a separate app/web/worker role rather than keeping the DAL in same project.

Would it be a good idea to:

1) Host the WebAPI project within the same Cloud Service as a Web/Worker role or should I create a new website/cloud service for hosting it? Using the same cloud service is preferred keeping the cost factor and n/w latency issues in mind.

2) If I host in same cloud service, what is more advisable to use for web api project - web or worker role?

3) Somewhere i read that I should make use of Service Bus in Azure for interaction between MVC frontend and WebAPI backend. Is this the suggested way of doing it or is there any simpler way of getting it done?

1
It will very much depend on the purpose of the site, if it is your own private blog that gets a few requests then that is a very different answer than if you are creating an application that you want to scale to handle a few million requests. 'What objective are you looking to achieve' is usually a good place to start.Michael B
It's a relatively small product based website. Scaling would not be needed in immediate future but should still be robust enough to handle few thousand requests.user869375

1 Answers

0
votes

I would suggest you to use the same cloud service. The reason being complexity and failure scenarios, when you split your app into multiple cloud services the problem comes when you are updating them service from your source control

You will need to do two deployments and make sure they are in sync etc.

I would keep the service runtime simple in one cloud service.

Again it is preference and comfort, if you really want to separate them at code level and know they will work fine. The two cloud services should be OK.

From experience, refactoring decision like these add a lot of work in the future. Positive or negative depends on your understand of the problem and the image of the bigger picture you have in your head that cannot be put on paper :).

Happy to Help, Yours Truly -CB