Im making an app that uses both birthday and age to make some deductions, but as the age can be obtain through the birthday and current date, Im questioning if I should be storing them both and not just the date, for one part I could use the age attribute to simplify some querys without converting dates, what would be the right thing to do following conventions?
Calculations based on data should be always... calculated, not stored. Well, not always, usually, but it depends on situation. Below are couple of pros and cons:
Cons
Pros
So, to sum up, you should make calculations, like DATEDIFF(NOW(), DateOfBirth)
to get an age, as the result changes in time and the function don't influence performance much.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With