Read more

Using sets for many-to-many relationships

Henning Koch
November 14, 2012Software engineer at makandra GmbH

A technique to vastly reduce the number of join model records that need to be stored in the database.

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

The technique is only effective when there is a high redundancy in your data, e.g. combinations of the same 20 tags are used to label thousands of books.

The technique is also limited in that your join models cannot have additional logic, such as attributes or callbacks.

Ther has-many-with-set gem Show archive.org snapshot is an implementation of this technique.

Posted by Henning Koch to makandra dev (2012-11-14 20:30)