Database Migration Plan
Load Sample:
Relational vs Document Mapping
Understanding how SQL concepts map to MongoDB is crucial for migration.
| SQL (Relational) | MongoDB (NoSQL) | Description |
|---|---|---|
| Table | Collection | A container for data records. Collections do not enforce strict schemas by default. |
| Row | Document | A record in a collection, stored as a JSON-like (BSON) object. |
| Column | Field | Key-value pairs within the document. |
| Primary Key | _id | MongoDB automatically adds a unique _id field if one isn't provided. |
| Joins | $lookup / Embedding | NoSQL prefers embedding related data within the document over complex joins. |
