Hey all!
Hope everyone is doing well?
I’m driving myself a little bit crazy with second-guessing about how to architect where the data belongs in my app.
The overall project is quite large (ERP/CRM/Audit Control, Customer Portal etc), but it’s the only way I can get what I want for my business. I’ve split it up into a couple of apps at the moment so I don’t get too complicated.
As a business we do contract bottling. That’s when we bottle for other people’s brand. There’s a lot of little bits of information. I’m trying to figure out how people decide when something should be a table of its own versus an option in a ‘choices’ table.
For clarity (and I think I got this from Robert?), I have a ‘choices’ table, where each column contains a set of choices that the user can pick from. Sometimes a column might be a simple ‘yes’ or ‘no’, and other times the data in the column might be a smidge more - for example a list of different pack type - glass bottles, pet bottles, Bag in Box etc. It’s essentially a transpolated table - instead of being ‘sorted’ by rows it’s being sorted by columns.
Now, the question is when should I use this choices table for data v when should the table be standalone? I’m trying to give myself a ‘hard’ rule to follow as I have a bit of a blind-spot in this area. Instinctively I think ‘well, when the data has lots of information that should be in separate columns’. So, let’s look at the example of a box. It has W, D, H (width, depth, height), weight, single/double wall, branded or unbranded, crash construction or top/bottom tape. I can put that into columns. But then I look at it and think 'but that will be one unique box that will only be identified by other an association with a SKU/Customer or its description. It is a standalone entity in its own right. There is no data to manipulate. I could just have a form which has the questions to ask, then template the answers to a string and stick it in the ‘Secondary Packaging’ column of my ‘Choices’ table.
In this exact example I know that I’d use the dims for pallet layout, so this isn’t perfect as I know that I actually do need to have a table for it, but you get the idea.
So what rules do you have for this kind of thing? I’m worried that my natural instinct of discrete data separation makes me want everything to be in its own table, but then I’ll have probably 2 or 3 dozen tables for ‘primary source’ data, then of calculation tables as well - for example a SKU would consist of a BOM, which would consist of parts etc…
It has the potential to be a table-monster, and I don’t know what rules are normal, and I don’t want to rearchitect it for the third time because I make some kind of foolish mistake.
Thanks in advance for the assist!