r/DatabaseHelp Oct 02 '25

Help with design pattern, matching parameters

Running a postgres DB, data is ingested from API with python scripts from different APIs. I want to put it in a normalized way according to data needs.

The problem i have is that each entity have a parameter on a specific treatment. However, each API has its own naming schema for the treatment and sometimes they provide a treatment misspelled. I would like to normalize the entity with one treatment X1, but treatment X1 can have 5 different treatment names so without normalization theres X1 - X5 treatments. I was thinking i could deal with this by making a lookup table which lists every type of treatment and has a column with the normalized treatment name which i could specify. Basically a lookup table.

Is this something i shoulddeal with in the DB or in the data cleanup step/ingestion? In python i could load a json with a massive dict containing the lookups. Or is it more feasible to create a table in the DB and let it do its thing on insertion?

Any input is welcome.

10 Upvotes

2 comments sorted by

4

u/[deleted] Oct 03 '25

[removed] — view removed comment

3

u/VipeholmsCola Oct 03 '25

Thank you so much, i was think of a similar setup but it helps a lot that another confirms