ASP.NET MVC on Azure: combine or separate web roles? -


i'm working on asp.net mvc 5 web application, hosted on azure, has following setup:

  • web role 1: asp.net mvc project ui: single page application angularjs , bootstrap
  • web role 2: asp.net mvc web api project: contains api controllers, handles authorization, data access (entityframework 6), caching, etc. api controller rest operations called async via angularjs ui in web role 1

these web roles combined in 1 azure cloud service, including sql azure database data storage. web role 2 uses in-role caching cache used entities. reason using cloud service, in-role cache shared between instances of web role 2, inside cloud service.

my initial reason seperate ui actual 'work' on 2 web roles, optimize performance, not having cache , data handling interfere presenting ui. also, when needed, can configure instances of roles in azure, , can specify maximum cache size use role 2 without having take memory role 1. works well.

now question... can pain maintain , update these 2 roles. also, client-side can little tricky cors http post not working in (mobile) browser on https etc. thinking of combining 2 applications 1: 1 project in 1 web role, both mvc , mvc web api stuff. perform separate setup? configure web role use more instances/memory in azure. having 2 separate roles own instances, on high loads lot of async calls going on client server?

on side note: playing around asp.net 5 (vnext), mvc 6, has eliminated differences between 'normal' mvc controllers , web api controllers. tempts me make 2 separate projects 1 asp.net 5 project. there's no support in azure sdk/visual studio deploy asp.net 5 project in azure cloud service, that's matter of time.

what concern web ui role? if it's single page application, server index.html file , few static files (very few , relatively small if bundle everything). shouldn't have impact if put in api role.

on other hand, use different solution. deploy spa files blob storage. have 1 role api , single index action method goes blob storage, gets index.html, injects blob storage base url needed (basically css, js , images paths) , serves client. web role handles single light browser call every time spa loaded in browser. rest of load goes blob storage (and it's not lot anyway).

i hope helps.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -