@
@
@estluced2020-11-20 20:36:06
MySQL
@estluced, 2020-11-20 20:36:06

Is it advisable to store user posts in json?

Hello!
The question is a little strange, I explain:
There is a Mysql database, user posts can be stored in this database, each post can contain images, videos, and so on. I want to put all the posts in a separate json file and store the paths to the files in Mysql.
Is this method reasonable given that json is easier to pass to the frontend?
Again, I apologize for my strange question, just curious.
Who so already did otpishite please, I will be glad!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vasily Bannikov, 2020-11-20
_

Not in the way you propose. Tk what's the point then in the SQL-base, if everything is possible in files?
Take a look at MongoDB - I think that's what you need.
Another option - you can create separate labels for different attachments to the post and save there some identifiers of pictures / videos in an external system (files are also an external system).
But if you do not plan any kind of relationship between entities, then mongo is a good choice, especially since there is already a ready-made solution for storing files - GridFS

S
Sergey Karbivnichy, 2020-11-20
@hottabxp

given that json is easier to pass to the frontend

Json serves just to transfer information, but not for storage (if this is not some kind of config)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question