What is best? one data type with more fields, or multiple data types?

Hello! I know this question has been asked before, and it always seems like the answers are mixed.

I have a log that tracks changes to the following items

Equipment: 9 fields

Tools: 11

Materials: 9 fields

The fields are all similar,

  • which supervisor gave
  • which item to
  • which employee for
  • what job?
  • how many were taken (or added) to inventory
  • Any notes

Currently I have 3 different logs for each item, Equipment, Tools, & Materials AND any time a log item gets created, it ALSO creates a record in the main Change Log which is used on my main dashboard to report “recent changes”

It feels a little sloppy to create 2 log entries, so I’ve been thinking about eliminating the 3 dedicated logs and just using the primary Change Log and using a “type” field to differentiate between the three categories items.

However, my Change Log tracks a number of other items already. It has a total of 17 fields, which already includes most of the fields I’d need to add. I think I’d maybe get up to 25 fields at most.

So I’m not super worried about the total number of fields, but as years pass and users get added, I’m worried about the change long getting a MASSIVE number of rows, which will take time & processing to search through, etc.

Either way, the change log is going to get massive. But I don’t plan to search through it too often. So if I split up the data types I can search faster because its smaller amount of data. But maybe I’m over thinking this?

What is best? one data type with more fields, or multiple data types with fewer fields?

There are many ways you can do logging … I suggest use Option Set as Type of log, and also

  • when you search you will choose the log type and it it will only give that log which will make it faster.

  • Also Do a cleanup after every 3 month for unnecessary and low importance loag, also add another option set with Importance,

  • and make a recurring workflwo , which will do auto cleanup for unnecessary log.

1 Like

multiple data types if the types are different

your particular case is better as one type though - they’re all logs, just different types of logs.

Wide tables in Bubble scale less well than long tables.

1 Like

Use one unified log with the Type field in this case.

You’ve already unified things conceptually by calling them all logs, so Log as a data type is a better choice.

Pros:

  • Easy to search and output data related to a supervisor or order ID.
  • Unified workflows for adding and cleaning logs.
  • Easy to add new log types, such as “Vehicles.”
  • If you need to change or add basic fields to the Log, you only do it once.

Cons:

  • Some overhead from unique fields dedicated to specific types (try to keep these to a minimum).
  • Row count concerns, but with archiving, pagination, and filtering, the performance impact is negligible. And if performance ever becomes an issue, it will mean the business is growing, which is a good problem to have. :slight_smile:
1 Like