Question

I am working on upgrading and redesigning logic and data involving weekly delivery schedules.

  1. Currently there are integers representing same day, next day or saturday delivery and in the database. This uses less rows but more logic (with some hard coded logic for Sundays)
  2. I am thinking of redesigning the table to have a row for each day and its delivery time. This results in more rows in the table but the logic is really easy now.

We have thousands of vendors, delivery schedules, manual interventions, so my redesign would mean the schedule table could quadruple in row count but would allow granular adjustments.

Both ways work fine, but what is best terms of best practice?

Is this anything to do with normalization/denormalization, is normalization important here? And if normalization is important, which method is more normalized? Or am is this just a matter of opinion?

Was it helpful?

Solution

There are no universal best practices. Do what makes sense in your situation. For example, what's more valuable to you: saving disk space and having complicated logic or paying the disk price for clean logic and easy updates?

Disk space is cheap (and can be unlimited), time* is more expensive and is limited. Your call.

(* developer salary, time to market, time spent on debugging, etc.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top