<story><title>Reddit’s database has two tables (2012)</title><url>https://kevin.burke.dev/kevin/reddits-database-has-two-tables/</url></story><parent_chain></parent_chain><comment><author>withinboredom</author><text>I worked at a startup (now fairly popular in the US) where we had tables for each thing (users, companies, etc) and a “relationship” table that described each relationship between things. There were no foreign keys, so making changes were pretty cheap. It was actually pretty ingenious (the two guys who came up with the schema went on to get paid to work on k8s).&lt;p&gt;It was super handy to simply query that table to debug things, since by merely looking for a user, you’d discover everything. If Mongo was more mature and scalable back then (2012ish), I wonder if we would have used it.</text></comment>
<story><title>Reddit’s database has two tables (2012)</title><url>https://kevin.burke.dev/kevin/reddits-database-has-two-tables/</url></story><parent_chain></parent_chain><comment><author>senttoschool</author><text>They were using it like a NoSQL database back in 2010, just one year after MongoDB started. So there were no options.&lt;p&gt;In 2022, there are so many more mature, reliable, battle-tested NoSQL options that could have solved their problem more elegantly.&lt;p&gt;But even today, if I were to build Reddit as a startup, I&amp;#x27;d start with a Postgres database and go as far as I can. Postgres allows me to use relations when I want to enforce data integrity and JSONB when I just want a key&amp;#x2F;value store.</text></comment>