This post is meant as a ‘high-level’ survey of the Active Record Pattern, Object-Relational Mapping (ORM), and the Ruby on Rails’ implementation of the Active Record Pattern — the ActiveRecord gem. There are many concepts and technologies involved in working with databases, so I only mean to give you a comfort with how the parts work together to make data-backed applications — not a deep-dive on the individual technologies and concepts.

In the world of databases and database management systems, the big dog is SQL and all of the systems built on top of SQL. However, in the past few years, a newcomer has started rapidly grabbing market share in the database game (the game be real, yo). This upstart is called NoSQL. The reason you should care about this is that SQL and NoSQL aren’t just different ‘products’ — they are different in kind.

There are a lot of articles on the web covering the differences between inheritance and composition in software design – when to use one or the other, how inheritance is the devil, blah blah bliggityblah. I am writing this piece to solidify my own understanding on the topic, so I might take some liberties with my presentation. Also, all examples will be using Ruby, though most of the concepts are programming-language-agnostic. Allons-y!