title: Where do I store my non-private data in a React App?
body: <p>So I'm trying to make a full website for the first time, e-commerce. Of course the user data should be stored in database, and reached by a backend like nodejs. But what about the non-private data, like all the products.</p>
  <p>Is there any difference between having all the products as an object inside my react code, in a like Product.js file vs Having all the products on the server, and fetch them ? Which one is recommended ?</p>
  <p>One difference I can think of is, fetching them from database would make the initial load of the website faster, since the user isn't downloading all the data until they visit products page. But that can be achieved with react's built in lazy loading anyways.</p>
  <p>So which one of those is recommended ? And why ? Thanks.</p>
  <p>option1- Keep products as object in frontend. And use lazy loading so user doesn't download all products only if they visit products page, instead of the initial visit.</p>
  <p>option2- Fetch them from database to frontend directly. Normally bad practice but; from a whole different, second database. The firebase database for example. The other database (mongodb) which has private data will never be accessed from the front-end.</p>
  <p>option3- Fetch them from database -&gt; to backend -&gt; to frontend. I'm guessing this approach isn't good because it would make the load quite slow ?</p>