In Flatiron School’s immersive software engineering course, I learned MVC architecture by building projects with Ruby on Rails and I learned Flux architecture through building projects with React.
MVC is simple to understand even for novice programmers. It stands for Model-View-Controller.
- A Model interacts with the database and represents objects essential to the domain or nature of the application.
- A View renders objects to the DOM through a web server.
- A Controller -- this is where CRUD happens -- sits between the two to control how the data from the Model is manipulated and then represented to the View.
Flux architecture, however, is more complex to understand and from my perspective, much less intuitive. In Flux, everything begins with actions, which are like helper methods. An Action corresponds to something a user does in the UI (the View). It has parameters and a type (e.g. GET_POSTS) and is sent through a dispatcher to a Store where the state is updated and then the changed state is sent back to the UI via another Action (i.e. GET_POSTS_SUCCESS).
Since data is passed back and forth between the Model and Controller and the Controller and the View, MVC is bidirectional. However, with Flux architecture, the flow is unidirectional because data flows into a Store and is kept there.