Musings about FP and CS

A log of my journey through FP and CS

Clean DB schemas talk

by Clement Delafargue on October 15, 2014

Tagged as: talk, sql, database.

I gave a quick talk about DB schemas yesterday during the October Human Talks session as well as during BDX I/O

tl;dr:

  • Design with querying in mind
  • Have a look at Normal Forms
  • don’t let the ORM write the schema
  • use postgresql fully
  • consider using UUIDs as PKs
  • don’t fear joins because of MySQL poor implementation
  • be consistent in PKs and FKs naming
  • fields should be not null by default
  • avoid deleting rows
  • use enums
  • use the expressive types available in PGSQL
  • give jDbT a try: https://github.com/divarvel/jdbt

Download the slides in HTML.

The source files are on GitHub

comments powered by Disqus