Great Post on NoSQL Data Modeling Techniques

Nope. It’s not mine. Though I wish it was. It is an older post (from the distant past of 2012) on the Highly Scalable Blog entitled NoSQL Data Modeling Techniques.

This past weekend I found myself looking for methods of storing hierarchical data in a key-value store (a subject for another blog), and in the spirit of not reinventing the wheel – I broke out my trusty Google search window. A few search refinements later, I discover this gem of a post. Ilya starts with a pretty simple explanation of the differing NoSQL models. But the real value in this post is when he describes the conceptual techniques, some of pros and cons, and the applicability to specific NoSQL engine types.

I had been looking at adjacency lists, so started there, and found this descriptions:

(12) Adjacency Lists

Adjacency Lists are a straightforward way of graph modeling – each node is modeled as an independent record that contains arrays of direct ancestors or descendants. It allows one to search for nodes by identifiers of their parents or children and, of course, to traverse a graph by doing one hop per query. This approach is usually inefficient for getting an entire subtree for a given node, for deep or wide traversals.

Applicability: Key-Value Stores, Document Databases

source: NoSQL Data Modeling Techniques

It was simple and right to the point. Since I like simple and to the point, I started scanning the rest of the point. The immediate predecessor on the page was equally well laid out as can be seen below.

(11) Tree Aggregation

Trees or even arbitrary graphs (with the aid of denormalization) can be modeled as a single record or document.

  • This techniques is efficient when the tree is accessed at once (for example, an entire tree of blog comments is fetched to show a page with a post)
  • Search and arbitrary access to the entries may be problematic
  • Updates are inefficient in most NoSQL implementations (as compared to independent nodes)
  • Tree Aggregation

    Applicability: Key-Value Stores, Document Databases

    source: NoSQL Data Modeling Techniques

    Summary

    Bottom line is that there is very useful information on Ilya’s post. I may not agree with all his conclusions and assumptions, I still learned something, and found information I can use. That’s the hallmark of a great post for me.

    Go check out Ilya’s NoSQL Data Modeling Techniques post and let him know what you think, or come back here and tell me – I don’t mind.

    Related

    comments powered by Disqus