At my current workplace there is a common pattern in database design: they don't use foreign keys but they list all corresponding ids in a column like this:
some_table
id name image_ids
1 a 1,2,3
2 b 4,6,7
images
id url
1 ...
2 ...
...
They store self references in a same manner:
some_table
id name some_table_id
1 a 2,3
2 b 1,3
...
They encourage me to use this pattern but it does not feel right for me. I would never design a database like that. I have some counter arguments against it:
- What if some day I would add some arbitrary data to a self reference? Using this model I would not be able to.
- It does not ensure referential integrity. I can easily add non-existent ids which will lead to problems
- Searching through strings is not fast either
I need to justify my complaints so my question is: What persuasive counter-arguments can you come up with against this hacky design approach?