MVC architecture works by dividing an application into three cooperating roles—the model, which holds data and business rules; the view, which renders information to the user; and the controller, which receives input, decides what should happen, and coordinates the other two. The point of the split is not to create three folders for their own sake but to keep presentation logic separate from business logic so that each part can change without dragging the others along. A request typically enters through a controller, which asks the model for data or to perform an operation, then selects a view and supplies it with the results to display.

That is the short answer. The longer answer has to do with how the three parts actually communicate, why the flow is usually one-directional in some places and not in others, and where the textbook description diverges from the frameworks developers use every day.

The three roles, defined by responsibility rather than by code

MVC is a pattern of responsibilities, and the responsibilities matter more than the file layout. Many implementations place models, views, and controllers in separate directories, but a project can follow MVC conceptually without that structure, and a project with those three folders can still violate MVC badly.

The model represents the application's knowledge: the data, the rules that govern it, and the operations that change it. In a web application, the model often includes database access, validation rules, calculations, and domain concepts such as "an order cannot be shipped before it is paid for." A common misconception is that the model is just a database table wrapper. It can be, but the model's real job is to be the authoritative source of state and behavior. If a rule about the data lives in a view or a controller, the model has been weakened.

The view turns model data into something a user can perceive—HTML, JSON, a PDF, a terminal table, a mobile screen. A well-behaved view renders; it does not decide. It may loop over a list and format a date, but it should not query the database or decide whether a discount applies. Keeping the view dumb is what allows the same model to serve a web page, an API response, and a command-line report.

The controller is the traffic director. It receives input from the outside world (an HTTP request, a button click, a command), interprets that input, invokes the appropriate model operations, and chooses what the user sees next. Controllers are typically thin: they translate an external event into an internal action, then hand off. When controllers accumulate business logic, the application drifts toward what is sometimes called a "fat controller" problem, and the separation that MVC promised starts to erode.

The request flow, step by step

Consider a typical web request: a user visits /orders/42. The flow generally proceeds like this.

1: Routing maps the incoming URL and method to a controller action. The router is not strictly part of MVC, but nearly every MVC framework includes one, because something has to decide which controller handles which request. 2: The controller receives the request, extracts parameters (here, the order ID 42), and may perform light input handling such as checking that the ID is numeric. 3: The controller asks the model for the relevant data—say, Order.find(42)—or asks the model to perform an operation, such as canceling the order. 4: The model applies its rules and returns data or a result. If the order does not exist, the model might return nothing, and the controller decides that this means "show a not-found page." 5: The controller selects a view and passes it the data the model returned. 6: The view renders the order details into HTML, which goes back to the browser.

The important structural feature is that the controller mediates. The view does not call the model directly in the classic pattern; the controller fetches what the view needs and hands it over. This keeps the view independent of how data is stored and keeps the model independent of how data is displayed.

One-way flow and the observer exception

In the simplest description, information flows in a loop: user input goes to the controller, the controller manipulates the model, and the view reads the model. But there is an important variation worth knowing, because it explains a lot of confusion about "how MVC really works."

In the original Smalltalk-80 formulation, the view observed the model directly. When the model changed, it notified its dependent views, which updated themselves. The controller handled input events and told the model what to do, but the model-to-view connection was direct and event-driven. This observer relationship is why the pattern is sometimes drawn as a triangle rather than a line.

In most server-rendered web frameworks—Ruby on Rails, Django, ASP.NET MVC, Spring MVC—that observer loop is largely absent because the request-response cycle is short-lived. The controller fetches data and renders a view once per request; there is no long-lived view watching a model for changes. In client-side frameworks that borrow MVC ideas, such as Backbone.js, the observer pattern reappears: models emit change events and views listen for them.

So the honest answer to "how does the flow work" depends on the environment. Server-side MVC is mostly controller-mediated and one-shot. Classic and client-side MVC include model-to-view notifications. Both are legitimate MVC; the difference is whether the view persists long enough to observe anything.

Why the separation pays off

MVC's benefits come from specific, testable consequences rather than from abstract purity.

Parallel development. Once the interfaces between the parts are agreed on, one developer can build the view while another builds the model. This was one of the pattern's original motivations and remains a practical advantage.

Testability. Business rules in the model can be tested without a browser, a database server, or a rendered page. Controllers can be tested by supplying fake models and checking which view was selected. Views can be tested by feeding them fixed data. When logic is smeared across all three, every test requires the whole stack.

Reuse. A single model can serve a web interface, a REST API, and a background job. If the model were entangled with HTML, the API would need a duplicate of the logic.

Change isolation. Redesigning the interface touches views; changing a tax rule touches the model; changing a URL scheme touches controllers and routes. Each change has a contained blast radius.

Replaceability. You can swap a template engine, a database layer, or a routing scheme with less disruption because the other parts depend on behavior, not on implementation details.

None of these benefits is automatic. MVC is a set of conventions, and conventions fail when teams ignore them. A codebase can have model, view, and controller folders and still be an unmaintainable knot if the model is anemic, the views query the database, and the controllers contain the real logic.

Where MVC stops applying

MVC is a presentation-layer pattern, and that scope limit is frequently misunderstood. It does not tell you how to structure your database schema, how to organize domain logic across many entities, how to handle authentication, or how to decompose a large system into services. Those are separate concerns, addressed by other patterns and architectures.

A few distinctions clarify the boundaries:

MVC is not a full application architecture. It organizes the interaction between user interface, input handling, and data. A large application still needs decisions about persistence, transactions, background processing, and service boundaries. MVC is not the same as a layered architecture. Layers (presentation, domain, infrastructure) cut horizontally; MVC cuts the presentation layer into three roles. The two can coexist: the model often sits on top of a domain layer and a data-access layer. MVC is not MVVM or MVP. Those patterns reorganize the same problem differently. MVVM binds views to a view-model that exposes data and commands, which suits frameworks with declarative two-way binding. MVP puts a presenter between view and model, with the view typically reduced to an interface. The differences are real, and choosing among them depends on the UI technology, not on which acronym sounds more modern. MVC is not a guarantee against complexity. It manages one kind of coupling. It does nothing for the coupling between your model and your database, which is where many large applications actually struggle.

Common confusions and how to resolve them

"The model is the database." It often uses the database, but the model is the concept, not the storage. A model can be backed by an in-memory object, an external API, or a file. Frameworks that generate model classes from tables encourage the confusion, but the pattern does not require it.

"The view can read the model directly." In classic MVC it can—that is the observer relationship. In most request-response frameworks the controller passes data in. Either way, the view reads; it does not write, and it does not contain business decisions.

"The controller is where the logic goes." The controller decides which logic runs, not what the logic is. If a controller is computing shipping costs or validating business invariants, that logic belongs in the model.

"More layers mean better design." Adding a service layer, a repository layer, and a view-model layer on top of MVC can help a complex application, but it can also produce ceremonial indirection. The test is whether each layer hides a real decision or merely forwards calls.

When MVC is a good fit and when it is not

MVC suits applications with substantial user interaction, multiple presentation targets, and meaningful business rules—content sites, dashboards, administrative tools, and APIs with a rendering layer. It also suits teams that benefit from splitting UI work from domain work.

It is a weaker fit for very small scripts, where the ceremony outweighs the benefit, and for purely data-processing pipelines, which have no views or controllers in any meaningful sense. It is also a poor fit as a total organizing principle for a large distributed system; there, MVC may describe only the outer layer of each service.

A practical mental model

If you remember one thing, remember the direction of dependency. The view depends on data prepared for it, the controller depends on the model's operations, and the model depends on nothing in the presentation layer. Keeping the model ignorant of HTML and the view ignorant of SQL is the discipline that makes MVC work. The folder names are incidental; the dependency direction is the architecture.

When you evaluate an MVC codebase, ask three questions: Can the business rules be tested without rendering a page? Can the interface be changed without editing the rules? Can a new interface be added without duplicating the rules? If all three answers are yes, the pattern is doing its job. If any is no, the problem is not that MVC is outdated—it is that the separation has leaked, and finding the leak is usually more useful than replacing the pattern.