Skip to content
HomeVideosBooks
AllTopicsTrends
BlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    Cover of SQL antipatterns

    SQL antipatterns

    Bill Karwin · 2010

    Illustrating some of the most common misconceptions and pitfalls software developers face using relational databases, this book helps readers use a database to produce the most efficient results, and turn sluggish, inflexible code into high-quality, reliable solutions.

    Systems & OS
    Open LibraryAmazon
    Stats for nerds
    31recommend
    43mentions
    37people
    2010–2025years
    86% recommend12% neutral2% critical

    Mentions per year

    201020122014201620182020202220242025

    What Hacker News says

    1. dondraper36Aug 2025
      There's a great book SQL Antipatterns, by Bill Karwin where this specific antipattern is discussed and criticized.

      That said, sometimes when I realize there's no way for me to come up even with a rough schema (say, some settings object that is returned to the frontend), I use JSONB columns in Postgres. As a rule of thumb, however, if something can be normalized, it should be, since, after all, that's still a relational database despite all the JSON(B) conveniences and optimizations in Postgres.

      thread
    2. KronisLVDec 2024
      > But even then, I'm afraid I am not producing the software to the highest standards of the industry since we don't have any rigorous cross-checking,

      I wouldn't worry about this too much. As long as what you're doing seems to vaguely match whatever information about best practices you can find online, you're probably good. As long as you're not inventing your own security tech, using floating point values for financial data or reusing feature flags in a high frequency trading scenario, any bad decisions made along the way probably won't be catastrophic and are more likely to be learning experiences.

      More eyes on code is a good thing, but can go too far where a person is cargo culting their beliefs and subjective experience as objective things, leading you to learn the wrong stuff, or at least to a degree where you have an irrational attachment to some practices (e.g. some people always lean towards EAV in DB design, even though that practice has a time and place, same for microservices vs monoliths vs modular monoliths etc.).

      > ...and might be missing out on a lot of learning.

      This is probably what you should focus on. See if you can attend industry events, watch some talks done by people who've been in the industry for a long time, there's actually lots of nice stuff on YouTube that's not just advertisement for the latest technology or practice. Here's some people whose content I enjoy:

        Dylan Beattie
        Venkat Subramaniam
        Kevlin Henney
      
      Maybe look at some of the better received books. Here's a starting point:

        A Philosophy of Software Design
        Algorithms
        Building Secure & Reliable Systems
        Clean Architecture A Craftsman Guide to Software Structure and Design
        Clean Code
        Code Complete
        Design Patterns  Elements of Reusable Object-Oriented Software
        Next-Level Database Techniques For Developers
        Patterns of Enterprise Application Architecture
        Peopleware
        SQL Antipatterns
        The Clean Coder
        The Mythical Man Month
        The Pragmatic Programmer
        Working Effectively With Legacy Code
      
      Again, take none of that as gospel, but maybe give them a passing glance.

      Also, props to whoever mentioned learning by doing in a low stakes environment (side projects) and online communities!

      thread
    3. smartmicJul 2023
      There is a valuable section about alternative tree models in the book "SQL Antipatterns" from Bill Karwin.

      In the end, he compares five hierarchical data designs. Unsurprisingly, all have pros and cons and it is a (somehow advanced) matter of picking the right tool for the job. Closure tables may in fact be the lesser know variant, adjacency lists and recursive queries one of the better knows. But there are also path enumerations and nested sets.

      thread
    4. jjiceFeb 2023
      Related to studying the pitfalls and how to avoid them, I really enjoyed SQL Antipatterns by Karwin. Sounds like the same format, but for RDBMSs.
      thread
    5. dondraper36Oct 2022
      After several years of playing around with different tools, it turns out it's easiest for me just to use Notion and its simplest features (basically creating pages).

      What I have discovered recently is that it's really useful (or at least I am inclined to do that) to keep track of you daily findings or useful ideas as a developer.

      An example is a pretty simple technical concept like dealing with polymorphic associaions in database modeling. There is nothing rocket sciency here, but having read a chapter in Bill Karwin's SQL Antipatterns book, I feel like I have learned a lot.

      That said, it often happens that you might not encounter certain techniques or approaches for a long time and your knowledge fades.

      This is why I briefly described the problem solved on my Notion journaling page, noted the book chapter and tried to summarize the approaches I considered and the one I ended up with (and why). At least, now I feel some kind of mental relief :)

      What approaches do you use to make sure that your new pieces of knowledge do not evaporate too fast?

      thread
    6. hobsMay 2022
      One of my favorite books to throw out for noobs is both a pattern and antipattern book for database folks. https://www.amazon.com/SQL-Antipatterns-Programming-Pragmati...
      thread

    Related

    SQL Performance ExplainedMarkus Winand
    2014–2025

    SQL Performance Explained

    Markus Winand
    26 recommend · 34
    Cover of SQL Cookbook
    2012–2020

    SQL Cookbook

    Anthony Molinaro
    7 recommend · 7
    Cover of The art of SQL
    2008–2021

    The art of SQL

    Stephane Faroult
    8 recommend · 10
    Cover of Developing time-oriented database applications in SQL
    2013–2025

    Developing time-oriented database applications in SQL

    Richard T. Snodgrass
    6 recommend · 14
    Database InternalsAlex Petrov
    2019–2026

    Database Internals

    Alex Petrov
    31 recommend · 54
    Cover of Designing Data-Intensive Applications
    2014–2026

    Designing Data-Intensive Applications

    Martin Kleppmann
    457 recommend · 846
    SQL for Web NerdsPhilip Greenspun
    2008–2013

    SQL for Web Nerds

    Philip Greenspun
    recommend · 11
    7
    Cover of Database systems
    2010–2026

    Database systems

    Hector Garcia-Molina
    11 recommend · 19