Category: JavaScript

Modeling Hierarchical Data in Postgres

Hierarchical data has historically been a challenge with relational databases. There are well-known solutions for implementing a hierarchy in a purely relational fashion, but their complexity and performance are not generally desirable. To overcome this, some modern RDBMSs have a special data type for hierarchical values. In the case of Postgres, this data type is the ltree.

The ltree data type allows for storing paths similar to filesystem paths or DNS records, and provides the ability to perform hierarchical queries which are much cleaner and more efficient than their purely relational counterparts. But often we want to have further constraints, such as requiring the existence of all ancestors in each path, and this requires additional work. Here we develop a complete implementation of the common use case of an entity hierarchy with the same properties as a filesystem directory tree.

ltree Basics

The ltree documentation refers to each ltree value as a path, and each component of the path as a label. A path is a series of labels separated by Continue reading

Implementing An Internal Software Development Project In A Technology Consulting Firm (aka EATING YOUR OWN DOGFOOD!)


 Part One

 “The task of the software development team is to engineer the illusion of simplicity” – Grady Booch

At Pinnacle, we are blessed with a population of senior technologists well versed in a multitude of modern development languages, approaches, frameworks, tools, apps and processes. Each of these elements are honed daily in the various customer environments we are actively engaged in. From time to time, we ask members of the organization to contribute to internal efforts that make life easier for all parties. We are currently in the midst of one of those times.

Like any project we perform for customers, we work with the team to understand the requirement and disseminate information and access pertinent to what we are looking to achieve. The next step is where it gets interesting. We tend to have options that more traditional businesses may not in choosing the technologies in which to construct our solution. We have partnerships with certain technology providers that minimizes our investment costs. And we have strong opinions on the most viable technology stack to use to solve this problem. In a recent LinkedIn post (, I wrote that one reason technology has gotten harder is due to Continue reading

HTML5 WebSockets

All code and slides can be found on GitHub:

Know When You Need Real-time

Real-time applications need instant updates from the server, often when an external event triggers the need to receive new data. The most popular solution involved long polling, where the page makes an AJAX call to the server that remains open until the server sends information and then a new AJAX call is made to restart the process. Note the difference between this and short polling, where an AJAX is made at Continue reading