# Django model for a hierarchical database

**URL:** <https://forum.djangoproject.com/t/django-model-for-a-hierarchical-database/17935>\
**Category:** Using the ORM\
**Created:** [January 1, 2023, 12:28am UTC](https://forum.djangoproject.com/t/django-model-for-a-hierarchical-database/17935 "2023-01-01T00:28:39Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [January 1, 2023, 5:41am UTC](https://forum.djangoproject.com/t/django-model-for-a-hierarchical-database/17935/4 "2023-01-01T05:41:34Z")

</div>

Fewer levels isn’t a problem. However, allowing for a larger number of levels does materially change the considerations involved.

In the general case, I suggest you see this post, and the links referenced from it: [Some modelling advice - #12 by KenWhitesell](https://forum.djangoproject.com/t/some-modelling-advice/3284/12)

There are other posts here in the forum discussing hierarchical storage of data - the key item to remember is that the different algorithms optimize different operations. There’s no one-size-fits-all solution for this - it’s one of those situations where the appropriate answer is extremely context-sensitive.

What about answers to the rest of the questions? Depending upon your answers, there may be other simplifications that can be performed.

---

_[View the full topic](https://forum.djangoproject.com/t/django-model-for-a-hierarchical-database/17935)._
