Answer the question
In order to leave comments, you need to log in
Is it worth storing the array in the database?
The user must enter certain links (about 30 links)
What is the best way to store this data?
Serialize array and write to database?
Answer the question
In order to leave comments, you need to log in
Serialize array and write to database?
What database are you using?
If the data structure is not relational in the project, look towards mongodb.
MongoDB is a document-oriented database, the format of each document in the collection is an extended JSON specification.
Using such a solution will allow you to:
1. Not bother with data serialization / deserialization.
2. Provides a convenient way to get, for example, all records that have or do not have this or that link in the array.
3. Allows you to store the data structure of any nesting of arrays and a simple selection from it, as well as conveniently update the data in the collection.
4. Each document is not strictly tied to the structure of the collection structure, as, for example, in relational databases such as MySQL (all rows have the same data set (that is, it is not possible to store some records with the same set of fields in one table, and in the second with another)). It can be both a plus and a minus, it all depends on the specific requirements for the architecture and the directly stored data.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question