A
A
Alikon2019-10-15 09:34:43
NoSQL
Alikon, 2019-10-15 09:34:43

Should I choose MongoDB when there is a large JSON definition?

I'm starting to make an application, something like a constructor that generates a large JSON definition.
This JSON is very large and deep, on average it should be about 2mb.
The question was which database to choose?
I thought MongoDB would do just that, and store it all in one document.
And suddenly it turns out that you need to store versions of subobjects (about 7-8 subobjects), a lot of versions are created and it is supposed to be stored in another collection.
I'm not very experienced with databases and have heard that MongoDB is bad with relationships.
But on the other hand, this JSON can change frequently (new fields will be added) and I heard that everything is fine with MongoDB
And one more thing, there will be very frequent reading and writing (due to real-time via sockets)
And what to choose ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Shumov, 2019-10-15
@inoise

Changing the data structure is called migration and this is an absolutely normal process, you should not be afraid of it. The simpler the data structure changes, the more difficult it is for you to write high-quality application logic. The JSON format or not should not be of interest at all, because in logic these are objects and everything is constantly transformed.
The issue of versioning lies in a different plane and does not depend on the database.
Do not think about premature optimization. Ws is not about the fact that there are fewer requests and the application logic is much more difficult to think through to make it right

Y
Yerlan Ibraev, 2019-10-15
@mad_nazgul

Uh-uh, there are also version control systems.
Specifically GIT.
JSON is a text file, so it will go into version control.
And it will not be necessary to write your bike in the database, according to version control. :-)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question