How should I structure location and distance data for a real estate website?
03:58 26 Aug 2026

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:

  1. Whether latitude/longitude should be stored directly with each location.

  2. Whether distance should be stored or calculated dynamically.

  3. How travel time should be handled since it can change depending on traffic.

  4. Whether locations should be normalized into a separate table.

  5. 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.

best-practices