How to best design address locations in any SQL Database?

前端 未结 5 710
攒了一身酷
攒了一身酷 2020-12-28 11:03

Overview

I\'m working on some Emergency Services reporting and mapping application for California (kind of weird, considering the fires there, right now...)

5条回答
  •  执笔经年
    2020-12-28 11:50

    This a problem I've had to deal with and RDBMS systems aren't the best at storing hierarchical data. You might want to look at using an object database since these have to deal with nested objects and are optimized for the problem.

    If you need to use an RDBMS, you may have to stick with a de-normalized schema though. Having separate tables to maintain your cities, streets etc may be handy for tracking changes though. If a city or street needs to be renamed, you can update the master record in the respective table and schedule a job to update a text copy of the string in your 'main' table. This will prevent you from having to run updates on 10's 100's of thousands of rows during prime time, but still lets you store the most up-to-data data in the db. Of course, this makes the data duplication situation even worse, but it's the price to pay for performance.

提交回复
热议问题