11.6 Circular Foreign Keys and How to Handle Them
Right, so you’ve decided to build a Rube Goldberg machine of a database. Congratulations. Circular foreign keys are one of those ideas that seem brilliant in a whiteboard session after three espressos and then become a waking nightmare when you actually have to put data in the thing. I’m talking about a situation where Table A points to Table B, and Table B, in a stunning act of poor judgment, points right back to Table A. Or maybe it’s a longer, more convoluted chain that ultimately loops back on itself. It’s the database equivalent of that “you hang up first / no, you hang up first” conversation we all had in middle school.