Better way to store hierarchical data with known depth?

kschiffer

I have a (actually quite simple) data structure that has a tree-like adjacency. I am trying to find a good way to represent data for a film-industry based web-app which needs to store data about film projects. The data consists of: project -> scene -> shot -> version - each adjacent to the previous in a "one-to-many" fashion.

Right now I am thinking about a simple adjacency list, but I am having trouble believing that it would be sufficiently efficient to quickly retrieve the name of the project, given just the version, as I'd have to cycle through the other tables to get it. The (simplified) layout would be like this: simple adjacency layout

I was thinking about - instead of referencing only the direct parent - referencing all higher level parents (like this), knowing that the hierarchy has a fixed depth. That way, I could use these shortcuts to get my information with only one query. But is this bad data modeling? Are there any other ways to do it?

Tim Almond

It's not good data modelling from the perspective of normalisation. If you realise that you put the wrong scene in for a project, you then have to move it and everything down the hierarchy.

But... does efficiency matter to you? How much data are you talking about? How fast do you need a response? I'd say go with what you've got and if you need it faster, have something that regularly extracts the data to a cache.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Big data signal analysis: better way to store and query signal data

From Dev

What is better way to store temporary data [Memcache or MySQL]

From Dev

Implementing hierarchical data structures with JPA (fixed depth)

From Dev

Implementing hierarchical data structures with JPA (fixed depth)

From Dev

Better way to store image in JSF

From Dev

How to store hierarchical structure data in java?

From Dev

How to store hierarchical data within Firebase

From Dev

Is there a way to construct and store a 3D Map from point cloud and depth data?

From Dev

Is there a way to construct and store a 3D Map from point cloud and depth data?

From Dev

C# Data structure to store items in a hierarchical way that once a branch is built, it allows me to retrieve it and add it as part of another one

From Dev

Fast way to mockup hierarchical data easily

From Dev

Java better way to store procedural Information

From Dev

Better way to store a set of files with arrays?

From Dev

Better way to aggregate timestamped data?

From Dev

Pandas Better Way To Trim Data

From Dev

Better way for storing a lot of data?

From Dev

Looking for a better way to sort data

From Dev

Which C# data structure is best/feasible to store hierarchical data

From Dev

Way to store data in shopify

From Dev

Efficient way to store data

From Dev

How do I store this hierarchical data using MySQL?

From Dev

Is it better to store recursive data in one OR two tables?

From Dev

The best way of storing many to many hierarchical data in sql

From Dev

What is the best way to pass data in a hierarchical structure? Swift

From Dev

Data mining with postgres in production environment - is there a better way?

From Dev

Better way to segment aggregated data in Pandas?

From Dev

Better way to produce data frame using table()

From Dev

What's a better way to summarize this data frame?

From Dev

Is there a better way to display multivalue data as a column?

Related Related

  1. 1

    Big data signal analysis: better way to store and query signal data

  2. 2

    What is better way to store temporary data [Memcache or MySQL]

  3. 3

    Implementing hierarchical data structures with JPA (fixed depth)

  4. 4

    Implementing hierarchical data structures with JPA (fixed depth)

  5. 5

    Better way to store image in JSF

  6. 6

    How to store hierarchical structure data in java?

  7. 7

    How to store hierarchical data within Firebase

  8. 8

    Is there a way to construct and store a 3D Map from point cloud and depth data?

  9. 9

    Is there a way to construct and store a 3D Map from point cloud and depth data?

  10. 10

    C# Data structure to store items in a hierarchical way that once a branch is built, it allows me to retrieve it and add it as part of another one

  11. 11

    Fast way to mockup hierarchical data easily

  12. 12

    Java better way to store procedural Information

  13. 13

    Better way to store a set of files with arrays?

  14. 14

    Better way to aggregate timestamped data?

  15. 15

    Pandas Better Way To Trim Data

  16. 16

    Better way for storing a lot of data?

  17. 17

    Looking for a better way to sort data

  18. 18

    Which C# data structure is best/feasible to store hierarchical data

  19. 19

    Way to store data in shopify

  20. 20

    Efficient way to store data

  21. 21

    How do I store this hierarchical data using MySQL?

  22. 22

    Is it better to store recursive data in one OR two tables?

  23. 23

    The best way of storing many to many hierarchical data in sql

  24. 24

    What is the best way to pass data in a hierarchical structure? Swift

  25. 25

    Data mining with postgres in production environment - is there a better way?

  26. 26

    Better way to segment aggregated data in Pandas?

  27. 27

    Better way to produce data frame using table()

  28. 28

    What's a better way to summarize this data frame?

  29. 29

    Is there a better way to display multivalue data as a column?

HotTag

Archive