Posts

Showing posts with the label MERN/MongoDB

MongoDB & Mongoose - A Refresher

 1. What is MongoDB? MongoDB is a no SQL database, which stores Documents in Collections instead of Records in Tables as in SQL It is used to store application data Stored data doesn't enforce a specific data schema or any relations MongoDB can also be easily connected to Node and Express, but we do not connect it directly to our front end (React) MongoDB is a powerful database and it can be easily integrated into a node express environment 2. SQL vs NoSQL NoSQL(e.g MongoDB) do not enforce a strict data schema(collections can contain documents with different schemas),  have less focus on relations, works with independent documents SQL(e.g MySQL) enforce a strict data schema(define the tables and the corresponding records, normally don't deviate from that structure ), relations are a core feature the records are related 3. Connecting React to a Database? Connecting react to the database is a bad idea It is a highly insecure approach, secure authentication is not really possible