Customer Address Question

In a Neo4j customer database, we have an Address node. I want to link it to separate nodes for State, Zip Code, and Country, as there are there are numerous use cases for searching on them. My question is this. Is it better to redundantly add State, ZipCode, and Country properties in the Address node, so that it contains the complete address in one spot? Or to leave just the HouseNumber, Street, and City properties in Address, and require consumers to always navigate to the other nodes. On one hand, redundancy is usually to be avoided, and opens the possibility of getting out of sync (i.e. the Address property says Minnesota, but it links to Wisconsin as the State node). On the other hand, the Address node feels incomplete and doesn't really stand on its own without including State, ZipCode, and Country.

Hi Doug,

As ZipCode is very unique, I would model ZipCode as a separate node. This worked for me when I created hospital hierarchy.

This way you will not have any problems with same city names in different states as the ZipCode will be different.

The hospital node has name, address, city as properties.


1 Like