3 ms·
I've quite literally spent the last month trying to read, digest, and apply the above to a record layer I'm writing for FoundationDB. Dr. Spivak's work has been
by rubyn00bie 7y ago
I've quite literally spent the last month trying to read, digest, and apply the above to a record layer I'm writing for FoundationDB. Dr. Spivak's work has been absolutely beyond helpful and insightful. There's no way I'd even be able to approach the subject with his efforts.
I'd also recommend these as they're associated with the 7 Sketches and help fill in some blanks:
Functorial Data Migration - https://arxiv.org/pdf/1009.1166.pdf https://arxiv.org/pdf/1009.1166.pdf
Category Theory as a Unifying Database Formalism - https://arxiv.org/pdf/1009.1166.pdf https://arxiv.org/pdf/1009.1166.pdf
Database Queries and Constraints via Lifting Problems - http://math.mit.edu/~dspivak/informatics/LiftingProblems.pdf http://math.mit.edu/~dspivak/informatics/LiftingProblems.pdf
Additionally, there's also https://www.categoricaldata.net/ https://www.categoricaldata.net/ which helps provide more actualized implementation details of "FQL" (Functional Query Language) which he mentions in his papers.
For anyone else looking to get started with Category Theory, I'd also highly recommend choosing a functional library (i.e. something with Applicative, Functor, Category, Monad, Semigroup, Semgroupoid, Comonad, etc) in whatever language you're most familiar with and then _re-implement_ the functions to learn what it's doing (and what properties each class of item must conform to). In Elixir, I've been using Witchcraft... github.com/witchcrafters/witchcraft
For me, it has helped a great deal by forcing me to think about things like associativity, identity, and composition which I normally... didn't really do. It lends some nice patterns and naming conventions, even if you don't adhere to them perfectly. After a month of category theory, and only a crude/rudimentary understanding of it, has been enormously beneficial. My refactor of my FDB record layer after category theory has less code, works more correctly, and has more features. It's crazy...
Category theory gets 10/10 from me.
P.S. You'll probably, at some point, want to learn a little Haskell to help elucidate things in a "pure" context. It also helps as most every functional library is modeled after Haskell's standard library (? I'm still new, heh). To get started, this will save you time, as it seems most things in the Haskell world now-a-days be using this to setup/manage applications: https://docs.haskellstack.org/en/stable/README/ https://docs.haskellstack.org/en/stable/README/
- wooola 7y agois the source code of the record layer available somewhere?
- rubyn00bie 7y agoIt will be in the next few days, I've been in a long sprint to get everything I've been working on done (and my personal website online); so, I can have an online portfolio and apply for jobs again (yay, ~f~unemployment). It's totally not compatible with Apple's record layer I don't use protobufs at all (though there's a good case to be made for using them even despite the article from today's frontpage, heh).
- edwintorok 7y agoYou linked to the 1166.pdf twice, did you mean to link to http://math.mit.edu/~dspivak/informatics/notes/unorganized/PODS.pdf http://math.mit.edu/~dspivak/informatics/notes/unorganized/P... for "Category Theory as Unifying Database Formalism"?
- rubyn00bie 7y agoTotally! Thank you for providing the correct link, I had to step out for dinner and didnt see the screw up until now.
- playing_colours 7y agoThank you for sharing your experience! I think of Category theory and Abstract algebra as great upgrade kits for brain. If, say, a software engineer manages to learn, understand, and internalise those fields up to some level, she will be able to see her daily work - algorithms, architecture, approaches to solve problems - through the mental models those areas of mathematics imprinted into her brain, think and express solutions in those categories. May feel a bit like a superpower :)
- edwintorok 7y agoAnother interesting one about databases and category theory: Relational algebra by way of adjunctions: https://dl.acm.org/citation.cfm?id=3236781 https://dl.acm.org/citation.cfm?id=3236781
- louthy 7y agoThanks for this, super interesting. Your second link is repeated though, I assume it should be this: https://math.mit.edu/~dspivak/informatics/notes/unorganized/CTDB--spivakCurino.pdf https://math.mit.edu/~dspivak/informatics/notes/unorganized/...
- tome 7y agoSince you sound like you're from the category theory community you may already know this, but my database library Opaleye is directly based on David Spivak's ideas. https://hackage.haskell.org/package/opaleye https://hackage.haskell.org/package/opaleye
- rubyn00bie 7y agoI'm totally new to the community! So I have no idea about almost anything I didn't link to or isn't linked here, ha. That is a freakin' awesome link, thank you so much! Though, it'll probably mean yet another rewrite of my record layer :) (at learning is fun)
- tome 7y agoFeel free to email me if you have any questions around Haskell/category theory/databases. My email address is linked in the Opaleye README. (BTW I meant "sounds like you're from the Haskell community" ... thinko)