Mysql – Schema Design with “Seasonal” Data

archivedatabase-designMySQLschema

I am developing a SaaS web application for School Management. What I need help is this:

The whole application is purposed for the current year that the School is in. However, some data and statistics should be able to be accessed from passed years.

For example: It is extremely important to keep old students contact details or grades etc. However I don't think its a good idea to keep all the old and current students on the same table, because I will have to manually use "WHERE" clauses everywhere (Grades, evaluations, comments etc.) and that might be a bit "messy".
So, another approach would be to use a different database perhaps for each year. Keep in mind i intend to use a single-tenant approach.

Any ideas on these two approaches or perhaps something else?

Best Answer

How large do you expect the data to grow? No harm in keeping older data in the same table. You could plan to use partitioning and implement date range partitions (per year). Using WHERE statements is completely natural in SQL so don't consider this as "messy" at all.