Search code examples
node.jsreactjsdatabasemongodbredux

Can I use Redux with MongoDB in one project?


I am started learn NodeJS + MongoDB. Before that, I studied React + Redux. As I understand MongoDB replaces Redux or is it not? If not, what data should be stored in Redux and what data in MongoDB?



Solution

  • Redux is state management which is used to transfer data between components, But this data is lost when the tab of browser closes or refreshes.

    redux-saga can be used to store data in the user's browser, which stores the redux data in the browser's local storage.

    But MongoDB is a server-side database for storing data on the server side permanently. To get information in Front-End, a request must be sent to the server using the API and the Back-End data must be sent to the front-end or the user. In general, information including user information and user login information, etc. should be stored in the database.