MongoDB
MongoDB is a document-oriented NoSQL database. Instead of storing rows in relational tables, it stores JSON-like documents in collections.
Intuition
MongoDB is useful when the data shape is flexible or nested. A document can contain arrays and subdocuments, so the stored shape can resemble the objects used by an application.
This differs from SQL, where data is usually normalized into tables with explicit schemas and relationships.
Common Use Cases
- application data with flexible schema
- user profiles
- event logs
- content metadata
- prototypes where the schema is still changing
Self-host Deployment
Reference:
Install MongoDB Community Edition on macOS - MongoDB Manual
VS Code Integration
MongoDB can be connected from VS Code for inspection and query work. This connects to VSCode because database extensions can turn the editor into a lightweight database client.
Connect to Your MongoDB Deployment - MongoDB for VS Code
Tradeoffs
MongoDB gives schema flexibility, but that flexibility can become messy if the application does not enforce structure elsewhere. For analytical workloads and joins, a relational database or warehouse may be easier.