Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Some data modelling tips for the Rails developer

Notifications You must be signed in to change notification settings

diogob/data-modelling-workshop

Repository files navigation

Data Modelling Workshop

This workshop will work with a model that should be familiar to most developers. Software repository management inspired by Github funcionality. The goal is not to model in detail the real funcionality but to narrow down some examples that will illustrate useful tecniques.

Setup

For the workshop you will need to have installed:

Then just clone the repo and install the bundle:

$ git clone https://github.com/diogob/data-modelling-workshop.git
$ cd data-modelling-workshop && bundle install
$ bundle exec rake db:setup

About this repository

This Rails project will be used just as a shell to execute migrations. Keep 2 terminals always open, one in a shell at the project root to execute rake commands and a second one in a psql session so you can inspect the database.

In the psql shell, before starting the tutorial, try the commands \? and \h, they will be very handy.

Get acquainted with the relations that were created and the migrations before proceding.

First tip of the tutorial: UUID keys are awesome.

Solving the exercises

The only files necessary to solve the exercises are migrations that create or alter the database relations, rails models can be omitted. As there is no one right answer for a modelling problem there is no way to automatically verify answers. But an example of solutions are provided in the branch exercises-example-solutions.

Getting started

  1. Removing NULLs from your model
  2. Creating natural keys
  3. Avoid storing impossible states
  4. Modelling events for input and deriving entities from views

About

Some data modelling tips for the Rails developer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published