FSD Unit - 3 - Part-1
FSD Unit - 3 - Part-1
Unit -3 Part-1
Full Stack Development
By B. Lokesh Joel
https://www.softsuave.com/blog/key-trends-in-full-stack-development/
Unit-3: MongoDB
• Need of NoSQL, • Managing Collections,
Database Database
Collection
Row/Record Document
Table
Column
Field
Backend Data Store and MongoDB
▪ Importance of Backend Data Store:
– The backend data store manages data like user account information,
shopping carts, blogs, and comments.
– It ensures accuracy, speed, and reliability in storing and retrieving data,
which is crucial for web applications.
– Common data storage solutions include:
• Direct file system storage
• Relational databases
• NoSQL databases
Why NoSQL?
▪ NoSQL (Not Only SQL) is a type of database technology that offers more flexibility than traditional SQL
databases. The key reasons for using NoSQL are:
– 1. Simplified Designs:
• NoSQL doesn’t require a strict structure like SQL, allowing developers to build data models that better suit their
applications.
– 2. Horizontal Scaling:
• NoSQL scales horizontally, meaning you can add more servers to handle larger data and more traffic, unlike SQL, which
requires more power on a single server..
▪ BSON Format:
– Documents in MongoDB are stored as BSON (Binary JSON), which uses field
pairs similar to JavaScript objects.
– This close relationship with JavaScript simplifies the process of converting
MongoDB records back into JavaScript objects, especially in Node.js applications.
Documents in MongoDB:
• The document includes multiple data types such as strings, integers, arrays,
and nested subdocuments (objects).
Documents in MongoDB:
▪ Field Name Restrictions: ▪ Document Size Limitation:
– Field names in MongoDB cannot contain: – MongoDB limits document size to 16MB to prevent
– Null characters excessive use of RAM and intensive file system
queries.
– Dots (.)
– While most applications won't approach this limit,
– Dollar signs ($)
it’s important to keep it in mind when designing
– The _id field is reserved for a unique Object ID for complex data structures that may contain large files.
each document.
15