Nearby lessons
1 of 22π Introduction to MongoDB
π What is MongoDB?
MongoDB is a NoSQL (non-relational) database. It stores data in a JSON-like format called BSON.
A Database is a collection of data stored in a format that can easily be accessed.
π Types of Databases
- SQL Databases: Relational databases using SQL (Structured Query Language)
- NoSQL Databases: Non-relational, schema-flexible databases like MongoDB
π Difference Between JSON and BSON
JSON (JavaScript Object Notation):
- String
- Number
- Boolean
- Array
- Object
- Null
BSON (Binary JSON):
- String
- Double
- 32-bit Integer
- 64-bit Integer
- Boolean
- Array
- Object
- Null
- Regular Expression
- Timestamp
- Date
- ObjectId
π Comparison: JSON vs BSON
- Format: JSON β Text-based (human-readable), BSON β Binary (not human-readable)
- Size: JSON β Larger due to text overhead, BSON β More compact
- Speed: JSON β Slower to parse and write, BSON β Faster to parse and write
- Usage: JSON β Web APIs and data exchange, BSON β MongoDB and database storage with rich data types
β Benefits of MongoDB
- Flexible schema design
- Horizontal scalability through sharding
- High performance for read and write operations
- Powerful query language
- Built-in replication for high availability
- Geospatial data support
- JSON-like BSON data format
- Real-time analytics capability
- Easy integration with big data tools
- Open-source and community-driven
Keep Going!MongoDB - Installation