I'm building a website that displays information about residential properties and nearby locations such as schools, hospitals, offices, and transport facilities.
I want to store the following information for each location:
Location name
Latitude and longitude
Distance from the property
Estimated travel time
Location category
Property: Example Residential Project
Nearby Location:
Name: Manyata Tech Park
Category: Business Park
Distance: 4.5 km
Travel Time: 15 minutes
Latitude: ...
Longitude: ...
What would be a good database structure for storing this information?
I'm particularly interested in understanding:
Whether latitude/longitude should be stored directly with each location.
Whether distance should be stored or calculated dynamically.
How travel time should be handled since it can change depending on traffic.
Whether locations should be normalized into a separate table.
How this structure could be designed to support hundreds of properties and thousands of nearby locations efficiently.
I'm using a relational database, but I'm open to suggestions about indexing or other approaches that would make geographic searches faster.
What database schema and indexing strategy would you recommend for this use case?
What is an FAQ?
FAQ stands for Frequently Asked Questions.