Hacker News new | ask | show | jobs
by Flamkuchlo 104 days ago
I think the best approach is to have an endpoint which returns the current state without probing the database when you check the endpoint.

Like you have a threat which does all your checks for connectivity write it into memory and the api endpoint checks the last values written.

Then you can respond to different upstream issues differently: Your DB says 'permission denied' due to broken auth data? Your Pod is not ready.

Your backend understand what a db maintenance mode is and should still return "Maintenance", your pod stays ready.

It can be more nuanced.

But the problem with restarting is, as he stated in the blog: What if now EVERY pod restarts in parallel.