28

I had an argument with one of my friends who is an architect at a pretty large internet company. Basically he was saying that ASP.NET MVC is not for large-scale enterprise applications, that it is not as flexible as WebForms, and that an MVC app will be slower than a web forms app.

From my own experience working with MVC, I can say that it is more flexible and it is lighter weight because there is no page life cycle, viewstate, etc.. It should thus load faster at the very least. As far as I know, MVC is designed for medium to large scale traffic.

What do you guys think? Has anyone compared speed and performance? And is ASP.NET MVC better for large scale apps than ASP.NET WebForms?

In short, between these two choices, which would you choose to use for a large scale enterprise application?

Sergey
  • 3,214
  • 5
  • 34
  • 47

4 Answers4

29
  • Development Speed: WebForms
  • Performance Speed: MVC
  • Ease of Use: WebForms (Typically)
  • Unit Testing: MVC (Typically)
Spencer Ruport
  • 34,865
  • 12
  • 85
  • 147
  • 15
    Ease of Use is subjective. I've seen people who think webforms are easy and those that think MVC is easier. Development Speed I think will stabilize over time as asp.net MVC becomes more mature and supported. – dtc Jun 23 '09 at 22:57
  • 7
    You can unit test web forms applications just as easily as MVC applications if they're created correctly, with proper separation of concerns. We didn't need the introduction of MVC to teach us how to do that. It's just that many ignored unit testing, period. – John Saunders Jun 23 '09 at 23:05
  • I prefer WebForms in general but it really does sound like your friend is pretty clueless. Spencer's got the right answer here - especially with his qualifiers . – Mark Brittingham Jun 24 '09 at 00:36
  • I totally agree with John Saunders... – Harold Javier Mar 29 '13 at 14:54
  • 2
    -1 this entire answer is purely subjective musings and in terms of performance, actually flat out wrong. See http://stackoverflow.com/a/20253243/37055 for actual metrics – Chris Marisic Nov 27 '13 at 21:17
7

This site is a best example of ASP.net MVC's performance and scaling

Some features which I think which is necessary for Enterprise and which MVC provides are

  1. Unit testing - even though it takes time to implement this initially it saves lots of time in the future

  2. Separation of Concerns - this really improves development and modification speed

  3. Performance - since both MVC and Webforms use the same ASP.net as the core framework and MVC is lighter and HTTP compliant it gives you better performance

Chris
  • 2,955
  • 1
  • 30
  • 43
Rony
  • 9,331
  • 2
  • 22
  • 22
4

I think MVC is a lighter framework, and more performant because it doesn't do a lot of the things that the WebForms framework does out of the box, like viewstate for example. I don't think it would be fair to say that MVC is not for larger scale applications, as it probably scales better than WebForms would in terms of performance. In terms of out of the box features, WebForms does more for you because it handles state between posts for you, via viewstate, etc.

I don't have any links to performance comparisons with me, but I would be extremely surprised if there aren't any out there. Even microsoft probably has some.

Jeremy
  • 44,950
  • 68
  • 206
  • 332
1

The groupthink and cargocult programming is strong in this thread. Your architect friend is both right (probably for the wrong reasons) and wrong at the same time.

that it is not as flexible as WebForms

This is just silly. You can do anything with anything. They are both incredibly flexible. In terms of flexiblity MVC is likely the clear winner here as you can easily achieve Aspect Orientated Programming (AOP) using ActionFilters. Another reason MVC is likely the winner here is that dependency injection is thought of in MVC. You can have inversion of control and dependency injection in WebForms but it requires complex implementations involving the Model-View-Presenter pattern.

MVC app will be slower than a web forms app.

This is invalid to claim, as written. Any application can be written slower comparatively as it's a complex process involving many aspects to reach an end product. However, in terms of raw speed. Webforms is substantially faster. https://stackoverflow.com/a/20253243/37055

it is lighter weight because there is no page life cycle, viewstate, etc.. It should thus load faster at the very least

This is also an invalid statement to make. Page life cycle is irrelevant in all aspects because there are corollary life cycles in MVC in regards to controllers and action filters. View state is interesting... if you choose to stuff 100s and 1000s of kilobytes of data into view state requiring every postback to the server to have 1MB-5MB request, yes it will obviously be faster to do nearly anything differently. This isn't webforms fault, nevertheless webforms allows you to fall into the pit of failure very easily with viewstate.

is ASP.NET MVC better for large scale apps than ASP.NET WebForms?

No. Yet the answer to this question "is ASP.NET WebForms for large scale apps than ASP.NET WebForms ?" The answer is also No. The answer is no, because the answer is always it depends. Every framework has pros/cons and you need to measure those, there is not definitive answers.

If you're building a content driven site who's job is to have the fastest possible page load times such as www.microsoft.com then you might very well choose webforms.

which would you choose to use for a large scale enterprise application?

First, you very likely don't have this problem. You would not be in a position to ask this question if you were truly responsible to architect a large scale enterprise application. (or the hiring process didn't actually require large scale development experience).

In terms of a large scale application the framework you choose is almost meaningless. Large scale applications are built on queuing. They will leverage tools such as MSMQ either directly or through a servicebus such as: Mass Transit, Azure Service Bus, or NServiceBus. Only with queuing can you reach the scale to handle millions of requests the way Amazon, Ebay and every other major player does.

Community
  • 1
  • 1
Chris Marisic
  • 32,487
  • 24
  • 164
  • 258