Relational databases allow us to model the associations between different types of data in our system domain. Most application database schemas rely on normalization to avoid data duplication. We use SQL to retrieve this data from a database, but SQL has limitations. When we need data from several tables, we’re forced to make trade offs in how we query our data, and our query results often do not contain an ideal representation of the relationships between our data entites.
In order to mitigate this limitation of SQL, we typically transform the data we retrieve via our queries in our application layer. With a system written in Haskell, we can use the Semigroup typeclass and the append operation it exposes (<>) to transform the data into the shape we need by defining our desired custom data types and simple transformation functions. In this post we’ll explore this method of solving this problem in more detail.
Foxhound Systems is a custom software development company founded by Christian Charukiewicz and Ben Levy. We started Foxhound Systems because we care about great software, and having worked as professional software engineers for a long time, we believe we can help other organizations grow by creating fast, reliable, and well-designed software systems. We have both seen and had our hands in creating a wide variety of software and products, and one trait that we’ve shared along the way is that we’ve always been on the lookout for ways to learn, improve, and help others.