Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bill of materials database model

I'm currently working on a project which should help us with our inventory control as well as our purchases to assembly our final product.

We're in the stage of modeling our database and one of the requirements is to generate a BOM (Bill of materials).

I've read this thread and found an example data model for BOM:

conceptual data model and physical data model

enter image description here

but i'm not sure I fully understand.

Our final product consists of a couple of sub-assemblies, so each sub-assembly is a row in the product_hierarchytable, and the final product also a row in that table. Each sub-assembly is made out of seperate (atomic) parts and each part is identified in a table tpart (each part has manufacturer field, minimum reorder quantity and other specific fields).

When generating a BOM all separate parts should also be included, so it's not fully clear to me how to model our database:

  1. a seperate part is a row in product_hierarchy which will never be one's 'parent' (the table tpart is no longer needed)
  2. an N:M relationship between product_hierarchy and tpart: each unit has several parts; each part can belong to several units

I'm leaning towards the second alternative, since a part is basically a total different entity (has a price, several possible suppliers, ...) whereas an assemblied entity has no external (as in: outside our company) properties.

Any input is appreciated! Thanks!

like image 436
user729103 Avatar asked Jul 15 '13 09:07

user729103


People also ask

What is BOM in database?

What Is a Bill of Materials, or BOM? A bill of materials has its roots in manufacturing. It is a list of the raw materials, sub-assemblies, intermediate assemblies, sub-components, parts, and the quantities of each needed to manufacture an end product.

What are the four categories in a bill of materials?

A bill of materials (BOM) is a comprehensive inventory of the raw materials, assemblies, subassemblies, parts and components, as well as the quantities of each needed to manufacture a product. In a nutshell, it is the complete list of all the items that are required to build a product.

What is the BOM and explain with an example?

An example of a Bill of materials is a bakery that needs to sell about 1,000 cakes. A BOM for this bakery will include all the ingredients needed to bake cakes, the baking pans, ovens, and packaging. The quantity, overall cost, and needed time should be also included in the list.


1 Answers

The models you linked fail to address some major properties BOMs normally have:

  • Parts and sub-assemblies can be reused. For example, it is common for a same kind of bolt to be used in many assemblies.
  • There needs to be a BOM-specific quantity. For example, it's important to know that one assembly needs (say) 50 bolts, but the other assembly might only need 30 of the same kind of bolt.

Here is a simple model that addresses these concerns:

enter image description here

The PART table is either a top-assembly or a sub-assembly or a leaf part. It uses a publicly known "part number" to identify its rows, which is not actually a number at all and can contain non-numeric characters.

The BOM table models many-to-many relationship of PART by itself. It's really no different from any other junction table, except both "endpoint" tables are actually the same table. This way, one sub-assembly or part can be reused in multiple parent assemblies.

On top of this model, you can fairly naturally add things like "drawing position" or "unit of measure" (e.g. a paint can be part of BOM but is measured in "kilograms" instead of "pieces").


There are more things you might want to do in reality, but are beyond the scope of a simple StackOverflow post like this.

For example:

  • How do you handle change? Do you have part versioning? Do you version the BOM itself?
  • Different suppliers might use different part numbers for the essentially same part.
  • You might want to keep track of "sites" (warehouses or factories) where parts are stored or assembled/produced. A "same" assembly might even have slightly different BOM for different sites.
  • You might want to differentiate between "made" and "purchased" parts.
  • Do you have a lifecycle workflow (approve/release/obsolete)?
  • You might want to store user-defined attributes. Attributes typically includes things such as mass, volume and material, but there may be many others that cannot be foreseen in advance.
  • You might want to connect the physical CAD models to the data in the database.
  • You might want to disallow certain users from doing certain changes to the database (e.g. procurement department shouldn't be able to change the assembly structure, at least not without supervision).
  • Etc, etc...

These are some of the reasons why real PDM systems tend to be complex. If you actually need all that functionality, you should probably consider using a commercial product instead of trying to re-implement it yourself...

like image 149
Branko Dimitrijevic Avatar answered Oct 11 '22 10:10

Branko Dimitrijevic