Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fiscal year handling strategies in database design

By fiscal year I mean all the data in the database (in all tables) that occurred in the particular year. Lets say that we are building an application that allows user to choose from different years.

What way of implementing this would you prefer, and why:

  1. Separate fiscal year data based on multiple separate database instances (for example, on every fiscal year start you could create a new instance with no data)
  2. Have everything in one database, but with logic that automatically separates records from different years.

Personally, I have "seen" both methods, and I would choose the second. The only argument I can think of for the first method is to have less records in case that these are really big databases - but still, you could "archive" old records by joining them in summaries or by some other way. What do you think?

like image 366
Denis Biondic Avatar asked Oct 27 '25 23:10

Denis Biondic


1 Answers

Separate fiscal year data based on multiple separate database instances (for example, on every fiscal year start you could create a new instance with no data)

No. Do not create a separate database instance, database, or table per fiscal year.

Besides not being normalized, you would be unnecessarily duplicating the supporting infrastructure: constraints, triggers, stored procedures & functions would all have to be updated to work with the new, current fiscal year. Which would also complicate data for future years for budgetting and planning.

Have everything in one database, but with logic that automatically separates records from different years.

There's no need for separation, just make sure that records contain a timestamp, which can then be used to determine what fiscal year it took place in.

like image 87
OMG Ponies Avatar answered Oct 30 '25 13:10

OMG Ponies



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!