Tag Archives: data
By p medved

Converting the Closure Table from a Weak Entity

I’ve found the closure table very useful in cases where there is a high degree of interaction with hierarchy data. Recently I chose a closure table for shopping cart categories where categories could exist in multiple places in the hierarchy and furthermore an administrator could drag and drop categories anywhere in the hierarchy to rearrange […]

Continue reading

Trimming that hard to reach whitespace

Not all whitespace is created equal, and when LTRIM and RTRIM in T-SQL fails to remove leading and trailing space its easy to stare and panic.  Having worked on a lot of ETL pipelines and legacy databases lately I’ve encountered some pretty nasty data sources and eyebrow-raising moments. In one particular case, I encountered fields […]

Continue reading

Scalability of Reflexive-Transitive Closure Tables

Scalability of Reflexive-Transitive Closure Tables as Hierarchical Data Solutions View Full Paper Abstract Reflexive-Transitive Closure (RTC) tables, when used to persist hierarchical data, present many advantages over alternative persistence strategies such as path enumeration. Such advantages include, but are not limited to, referential integrity and a simple structure for data queries. However, RTC tables grow […]

Continue reading

Hierarchical Data: Rendering with Razor

I’ve walked through persisting hierarchical data via closure tables and then through abstracting the closure table in the application layer.  Now, we’ll look at rendering our hierarchy in an ASP.NET MVC 3 sample application using Razor. For the styling of the hierarchy I use jquery treeview which I quite like for its simplicity.  The typical approach […]

Continue reading

Hierarchical Data: Applying Data Structures

In my previous post I walked through persisting hierarchical data using closure tables.  While closure tables are a great technique for persistence we need a more approachable way to deal with the hierarchy in the application layer.  Since we are dealing with a hierarchy it stands to reason that we could benefit from a tree-like […]

Continue reading

Hierarchical Data: Persistence via Closure Table

Recently, I’ve been working with hierarchical data using closure tables.  The problem this technique solves for me is persisting hierarchical relationships of specific entities without any restriction on the size of the hierarchy and while providing a simple way to query the hierarchy.  Closure tables, above other solutions like path enumeration, maintain referential integrity.

Continue reading