I have one question.
Why does everyone keep telling me to specialize in one thing?
Pick one problem. Solve that specific problem.
Ummmm 🤔🤔
I think I found the answer.
When I started studying MongoDB, I finally understood why everyone keeps telling me this.
Because someone built MongoDB on the same principle.
And it's not just MongoDB. Every technology has its own problem definition. They also pick a specific problem and try to solve it.
But to fully understand MongoDB, you need to understand why someone built it in the first place. What problem existed that MongoDB was trying to solve?
So, in the case of MongoDB, the problem starts with applications that have constantly changing data.
Think about social media applications, quick-commerce applications, and other applications with evolving data. They all deal with data that can have different structures.
Let's take an e-commerce application as an example.
An e-commerce application needs to store products from different categories.
Now, different categories have different and unique fields.
Storing all this data in a relational database can become complex, with many optional fields in a table. Another challenge is that retrieving this information can require complex queries.
That doesn't mean relational databases cannot store this type of data. The issue is the complexity of managing it.
Now, this is where MongoDB comes into the picture.
It introduces documents and collections instead of rows and tables.
In documents, you can add different fields according to the type of data you want to store.
You can also keep documents with different fields together in one group called a collection.
One document can have different fields, while another document can have completely different fields. But both can belong to the same collection.
Now, you don't need to maintain the same structure for every document.
This is one of the main advantages of MongoDB. It also offers other advantages, but flexibility in data structure is an important one.
What are your thoughts on MongoDB's flexible structure?
Top comments (0)