Documents, Not Rows
Learn how to manage flexible, evolving data using MongoDB’s document-based storage and CRUD operations.
We’ve already explored NoSQL databases, each tailored to different data needs. Now, let’s focus on a type built for flexibility—document databases. MongoDB is one of the most popular examples. Unlike traditional databases that rely on rigid tables, MongoDB stores data in flexible documents that can adapt as your application evolves.
MongoDB stores its documents in a format called BSON (Binary JSON). This format extends JSON by supporting more data types, such as dates and binary data, making it more powerful for real-world applications.
Imagine you’re building a fitness app. At first, users log simple details like their weight or exercise duration. But soon, one user wants to track protein intake, another uploads progress photos, and someone else logs mood or gym buddies. Each user’s data looks different, and that’s perfectly fine in MongoDB.
Now think about how that would work in a traditional relational database. You’d need to keep updating the schema, adding new columns, and tweaking queries to support a few new fields. That kind of rigid structure can slow you down. MongoDB avoids this by letting each document store exactly what’s needed, no more, no less.
Meet MongoDB
MongoDB takes a different approach from traditional databases. Instead of storing data in fixed tables with rows and columns, it uses flexible, self-contained documents usually in a JSON-like format. Each document can have its unique structure, so one user’s record might include photos and mood ratings, while another’s includes only text. MongoDB handles all of this seamlessly, without requiring any schema changes.
Note:
eBay powers its search suggestions and real-time recommendations using MongoDB’s flexible document model.
Adobe relies on MongoDB Atlas for content management and analytics in its Creative Cloud services.
Uber uses MongoDB to store and query high-velocity geospatial data for trip matching and pricing.
This flexibility makes MongoDB a strong choice for apps where data is semi-structured, varied, or constantly evolving, like social platforms, e-commerce, or fitness apps. In this lesson, we’ll see how MongoDB stores data and how we perform core operations like creating, reading, updating, and deleting documents.
Get hands-on with 1400+ tech skills courses.