HackerPapers

arXiv:1602.03501math.CT

Algebraic Databases

Patrick Schultz, David I. Spivak, Christina Vasilakopoulou, Ryan Wisnesky

Abstract

Databases have been studied category-theoretically for decades. The database schema -- whose purpose is to arrange high-level conceptual entities -- is generally modeled as a category or sketch. The data itself, often called an instance, is generally modeled as a set-valued functor, assigning to each conceptual entity a set of examples. While mathematically elegant, these categorical models have typically struggled with representing concrete data such as integers or strings. In the present work, we propose an extension of the set-valued functor model, making use of multisorted algebraic theories (a.k.a. Lawvere theories) to incorporate concrete data in a principled way. This also allows constraints and queries to make use of operations on data, such as multiplication or comparison of numbers, helping to bridge the gap between traditional databases and programming languages. We also show how all of the components of our model -- including schemas, instances, change-of-schema functors, and queries - fit into a single double categorical structure called a proarrow equipment (a.k.a. framed bicategory).

arXiv comments
80 pages
Journal reference
DOI
Subjects
math.CTCategory Theory cs.DBDatabases

On Hacker News

Linked by 3 identifiable commenters in 3 comments across 3 threads, from May 2016 to Jan 2025. Found in 1 HN submission from Jan 2025 to Jan 2025. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments3 threads

  1. Composable SQL 1 comment
    • The Codd 1971 stuff on Wikipedia looks like a mess, and I think the original is propbably a bit crufty too (though I don't want to disrespect the old masters, SQL was a high water mark of business thinking about computing in many ways). I would follow the citations of…

      Ericson2314View on HNParent context

    • I wonder about this too. It seems like some ideas from category theory and pure functional programming could really help here to provide an abstraction over the top of the (pseudo)relational model. While doing some research on an unrelated topic, I stumbled on some potentially…

      harveywiView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.