3

I have some hierarchy of objects in my program (i.e. PHP). Its composite design pattern used. I.e. countries -> states -> cities -> districts. Whithin my code I often work with this objects as some abstract area unit. Now, I should save all of this objects in database (i.e. MySQL).

What is best database structure for comfortable storing and getting back thus objects? Should I create different tables for each type of objects (country_table, state_table, city_table ...) or store all objects in one table areaUnit_table?

Anirudh Ramanathan
  • 46,179
  • 22
  • 132
  • 191
Ivan Velichko
  • 6,348
  • 6
  • 44
  • 90
  • 3
    Take a look at this [awasome post][1] about this topic. [1]: http://stackoverflow.com/questions/4048151/what-are-the-options-for-storing-hierarchical-data-in-a-relational-database – kothvandir Sep 06 '12 at 08:16

0 Answers0