So, I have everything in one server on GCP and have not separated things.
It has been working fine so far, but today I was woken up because they said the system was not working due to "database connection failed" error. The moment I ssh'ed into the server, the system came back up and started working again.
Checking resources, everything was fine and maximum resource usage was at <40%.
Now, I am not sure what went wrong and logs told me nothing. The system was not overwhelmed.
How do I know why that error occurred?
How do I make sure such issues don't happen again?
Ideally, I would like to know why, then go to how to fix.
Many thanks for your assistance, guidance in advance.