13

My boss's SQL schema has no foreign keys and he said he left them out intentionally because they should be handled in the application layer and they're a large performance impact.

This is a fresh greenfield project and he's already pre-optimizing for problems we don't have yet, on things that may or not be bottlenecks using ideas (e.g. foreign keys have huge performance costs on mariadb/auora) with no hard data or facts to back them up.

Let's start a new project with some technical debt!

Comments
  • 5
    But he's kind of right. If that is an application back end, foreign keys have only one benefit: integrity constraints that serve as hard checks. But since most modern applications use ORMs, schemas are generated automatically, databases are constantly migrated, and foreign keys just stand in the way.

    The simplest solution that works is to just define the data storage. Keys are additional work, that do make the db slower.
  • 2
    Fuck this shit I am going non-relational db.
Add Comment