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 UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
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)