There is a server, there is a certain class on it, when creating an object of which the time begins. The countdown continues as long as the object exists. At any time, the client may request - how much time has passed since the beginning of the creation of the instance. And there are thousands of such copies. Everyone counts time from the beginning of their creation.
Question: how to implement it so that when the server crashes, the time count in all objects does not stop.
Possible solution: I understand it is necessary at the time of creating an object to save this time somewhere on the disk, and not in temporary memory, so that after the server crashes, you can restore the time of the first object creation.
Upd:
And, perhaps, to save RAM when working with a large number of objects, it is better to always save them immediately in the database and destroy, and then take out and create a new equivalent object when it is needed?