Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

Database - A guide for the perplexed

I was asked to introduce the topic of how Relational Databases work by the team I’m working with at the moment. As the material grew I decided it would be useful to gather it together and put it out on the public internet where everyone who might need a quick introduction to some of the most important concepts can easily find them. I’m Francis Fish and I’ve been writing code and all of the activities around it for since 1985. For my sins I’ve worked for companies like KPMG and Oracle. I switched to Ruby on Rails many years ago and don’t regret it, even though it’s probably cost me a few bob moving away from sheltering under the loving arms of big corporations and working for smaller companies.

This text is meant to give folks who work with databases every day a little grounding in what happens underneath and a brief introduction to the academic theory that underpins this important technology. If you work through the lens of something like Rails’ Active Record it may help you understand why you sometimes get results you don’t expect

I am a Ruby/Rails dev so the examples that aren’t SQL will be in Ruby.

Download the Ruby examples

This is a big topic. I’m gonna try and lay this out in a simple way

  1. The theory that lies behind relational databases
  2. How that theory relates to SQL.
  3. How to think about how queries are built
  4. How data is stored
  5. Common pitfalls with nulls and other things
  6. Non-relational approaches

This is quite a large undertaking, but I’m hope to do my best to make it easier for people to follow. by breaking it down into small enough pieces to be digestible.

This theory and its utility doesn’t seem to be taught any more, or at least not well. Most of us talk to databases through ORMs and it’s worth understanding what happens out of sight.

If you would like to print out a copy of this press the print icon at the top right.