How does Node.js MVC work?

I'm really interested in systems written in node.js. In particular, using it to create an MVC application.

I was thinking about the differences between node.js MVC design and the same thing in PHP. Since PHP is loaded and interpreted at runtime, changing one of my controllers or views will be reflected in server performance in real time as soon as the file on the server changes.

I am wondering since node.js is compiled, does it need to restart the application every time you push changes?

If not, does MVC really affect the performance of the server as a whole, since the server has to read files at the time of the request and have the entire application sitting in memory? Or maybe all this is wrong, and I completely miss the point? (if so, please enlighten me, because I am dying to know!).

Thank! - A

+3
source share
2 answers

A typical node.js MVC application will store model data in memory and on some stored database, such as mongoose.

Every time a model changes, it goes through js and saves the database. It should not restart at all.

If you changed the code, you really need to restart the server. I assume that there are various programs to prevent this from happening.

: EventedIO

+2

Express Node. - MVC. URL- URL-, Node, "", .

Node SQL (Postgres ..) No-SQL (CouchDB, Mongo ..)

"restart- node -on-changes"

- / Node

+6

Source: https://habr.com/ru/post/1796320/


All Articles