C
C
chelkaz2016-03-09 01:45:58
MySQL
chelkaz, 2016-03-09 01:45:58

What will be more logical, serialization or in the new table?

There are for example categories for ads.
Where is the best place to store them? In a separate table, or in a table with declarations, but serialize? In Bitrix, for example, all such properties are serialized.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
6
65536, 2016-03-09
@65536

Bitrix is ​​the bottom of technology. you can ignore the assurances of the sectarians, do not enter into dialogues.
whoever deletes my answer will be boiled alive in Bitrix

D
Dmitry Evgrafovich, 2016-03-09
@Tantacula

In the new one. Bitrix is ​​not a standard at all. To confuse you, I will leave the link www.getinfo.ru/article610.html

A
Alexander N++, 2016-03-09
@sanchezzzhak

in a separate table it's easier to maintain
Category table
advert_category
id mpath parent_id name
*** I prefer to store the nesting of categories/comments as Materialized Path + parent-child
We need to store the ad in several categories create a table (this rule works for everything that needs to be stored many to one or to many - an intermediate table via pivot, etc.)
advert_category_pivot
id advert_id category_id
PS do not use data serialization to search for such data is very difficult and it will work without indexes.
If you really need to save the array in the database, then only JSON mysql 5.6 or 5.7 can work and index json. But in new versions there is a regression with performance
Yes, and tie with Bitrix, we do not advise bad)

S
Silm, 2016-03-09
@Silm

If the data requires selections and / or searches, then they should not be stored in a serialized form.
Serialization may be appropriate when data of type object or array only needs to be stored and displayed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question