Skip to content
StackDecode
System Design
3. Client-Server ArchitectureAnimated

Model-View-Controller (MVC)

Separates data, display and input handling.

The idea

The controller handles input, updates the model, and the view renders the model.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

UserControllerModelView
  • client
  • gateway / proxy
  • service
  • cache
  • data store
  • queue / stream

The user acts on the page.

step:
1/4
at:
User
1/8

The green dot is a request moving through the system.

Step by step

  1. 1User acts on the view
  2. 2Controller handles the action
  3. 3Model changes
  4. 4View updates

Where it is used

Web frameworks.

Watch out for

Controllers grow fat unless logic stays in the model or services.

Related