eugene_trebin
eugene_trebin

Reputation: 1553

What is better way to design models?

I have model Domain and I need to check DNS records for each domain. I have two options

  1. create model DnsRecord with fields record_type(A, CNAME, etc), domain_id, check_result, timestamps

  2. use field jsonb for Domain and save all records in this field

In first case table dns_records will contain a lot of records, but in seconds case not very convenient to work with data What option is better? Does anybody know better solution?

Upvotes: 0

Views: 41

Answers (1)

André Gava
André Gava

Reputation: 268

I think your first option is the best because you could manipulate it individualy. If you put everithing in a json you probably will have probles on handle with this data soon. I could not think another solution for this problem. sorry.

Upvotes: 1

Related Questions