Modeling compatibility between products and equipment
To model which products fit which equipment, keep products and equipment as two collections and connect them. A multi-reference on the product is enough when a fit is a plain yes or no; when a fit carries facts of its own, such as axle position or whether it is the factory size, give each fit its own entry in a compatibility collection that references both sides.
To model which products fit which equipment, keep products and equipment as two collections and connect them. A multi-reference on the product is enough when a fit is a plain yes or no; when a fit carries facts of its own, such as axle position or whether it is the factory size, give each fit its own entry in a compatibility collection that references both sides.
Requirements
None to read this page. To build it: a role that can create collections and fields.
The problem
A distributor of agricultural tires sells by size. Its buyers search by machine: they know they drive a particular tractor model, not which size it takes. The same question appears elsewhere under other names: which filters fit which compressor, which parts fit which vehicle, which cartridge fits which printer. In each case, one product fits many machines and one machine takes many products. That is a many-to-many relationship, and a single text field listing compatible models cannot answer it reliably.
Option 1: a multi-reference on the product
Keep a Tire Sizes collection and a Machine Models collection. On each size, add a multi-reference (elsewhere: linked records, many-to-many relation) to the machine models it fits.
- What it gives: one place to maintain, and the site can list every machine a size fits.
- What it costs: the fit itself has nowhere to hold a fact. You cannot record that a size is fitted on the rear axle only, or that it is an alternative rather than the factory size.
Option 2: a compatibility collection
Add a third collection, Compatibility, where each entry is one fit: this size on this machine. It has a reference to the size, a reference to the machine model, and fields for what is true of that pair: axle position, factory or alternative, notes from the field.
- What it gives: every fit carries its own facts, and each side can be searched from the other. The site filters compatibility entries by machine model to show the sizes that fit it, and by size to show the machines it fits.
- What it costs: one entry per pair. A size that fits forty models means forty compatibility entries to create and keep current.
New collection vs new field gives the general rule behind this choice: when the connection itself has facts, it becomes a collection.
Making both sides useful
- A rollup on the machine model can count its compatibility entries, so each machine shows how many sizes fit it.
- A lookup on a compatibility entry can show a value from the referenced machine, such as its brand, without retyping it.
Rollup vs lookup covers both.
How the site uses it
The public site reads the three collections the same way the team does. Access is granted collection by collection, so the compatibility collection needs read access alongside sizes and machines, and only published entries are shown. How collections power a site covers that mechanism.
Notes and limitations
- A reference always points at another collection, never its own, which is why the pair lives in a third collection rather than on either side.
- A compatibility entry whose size or machine is archived loses that reference; the entry itself stays until you archive it.
- Agents can maintain compatibility entries in bulk, for example when a new machine model is added, through the same actions as any other entries.