Arm on Yii2. How to implement the formation and preservation of dynamic information?

Hello! Make arm the Manager of the cleaning Department. Decided to choose the Yii 2 framework. That would be clear overall about what is at stake here is the schema of the database
and the view of the main window with the explanation

The problem is that - When you reserve (settlement) customer to specify the room set the start date of the reservation and check out.
From the starting date (for example 02.03.2015) to the date of departure (for example 20.03.2015), the room should be clean on the day of arrival, departure and 1 time in 7 days jobs Clinton day (for example Tuesday of each week).

In addition to all the regular cleaning I did not know how best to implement a regular cleaning.

So far I have 3 options:
1) you need to do some extra table with entries for each booking of the room;
2) you can also in the model to do the calculations for each actual booking, but this is the worst option because it is not flexible.
3) Do the same calculations on the client side JS.
What if the client will change their "cleaning day" from Tuesday to Wednesday.

Perhaps in Yii2 there are some tools that will simplify my task, such as working with Redis, etc.!
Tell Junior's how to do it! Thank you!
September 19th 19 at 00:08
1 answer
September 19th 19 at 00:10
When creating a reserve, create record cleaning status, for example, "planned" on the server.
What's the problem then?
I guess the problem is that such records will be very many and the selection is large.. as the rooms in this hotel may be reserved for a year or more... of rooms 250 .. for mysql right?
thought maybe somehow in Redis for each reservation to place all records of harvest, and stored until the booking of the room for a specific client is still relevant.. feel..
You can do everything, but I want best practices )
Thanks for the reply! - casimer96 commented on September 19th 19 at 00:13
: 250 rooms. 365 days a year. It 91250 records per year. Suppose your app will work 100 years, and every day in each room will sleep a new tenant, it will be 9'125'000 records. It's not so much for DB - Grayce.Mohr29 commented on September 19th 19 at 00:16
Yes... But you need to each 91250 reservations, do the calculation cleanups (unless the customer has reserved a room for the year you need to add 52 (52 weeks in a year) records of cleaning) after it's move to the database will be kept of old which is no longer necessary. And then will arise the question of how to keep the old as much as you want? - casimer96 commented on September 19th 19 at 00:19
Why delete, if the information is not enough. 91250 records is nothing. If it is necessary so once a year, last year's record, delete or save to an archive(different table) - Grayce.Mohr29 commented on September 19th 19 at 00:22

Find more questions by tags Web DevelopmentDatabasesRedisYii