I am designing a System which has different types of Addresses. For example, a Person Address, A Hotel Address, An Airport Address, An Office Address.
I am involved in a discussion where I am of the opinion that as the addresses are different(of different entities Hotel, Airport etc.) the addresses should be stored in separate tables. I think this would improve performance.
There is another opinion to have all the addresses in the same table.
I am using PostgreSQL and am looking at over 10 million records.
What do you think is the better design?
I look forward to your opinions.
Regards,
Shardul
I would recommend to keep the addresses in the same table, and have a type field do indicate what type of address it is.
10 million records isn’t an unmanageable amount if you have the correct indexes and udpated statistics.
By having them in the same table, you ensure scalability. What happens if there is another type of address added? The change to code would be drastic for another added table, but it would be minimal if you are just having another address type in your existing table.