Can you suggest to me one way for an API service to wait for a database to accept connections to run the database migrations without the API depending on the liveness of the database to start up?
I think the pragmatic answer is you should wait for your database to be live before starting up. One just wants to lean on the side of depending on a few critical services rather than all potentially-utlizied application services.
Interesting idea for a feature request. I would love to read a GitHub issue with your specific case so I can start investigating and think about how to solve a problem like this.
I considered starting to write myself a Rust "wait for it" app myself this past week with more features than the standard one. Not sure how I didn't come across yours during my initial search.
There could be some useful functionality that could be found in startup and health probe topics [1] in Kubernetes for example. But at least in that world, it may be easier, and more transparent, to plug in a startup bash script to run before the main app. For example the Postgres Docker image [2] will run any scripts that may be mounted in a docker-entrypoint-initdb.d directory before starting the server. So putting a bash script in a ConfigMap that gets used as a disk volume, could be easier that downloading/auditing a binary "wait for it" container image.
Regarding zero dependencies, I meant that it is a static binary and does not need any external tools to be installed. For example, some alternatives require netcat to be installed.
This is fine, and what I understood from "zero dependencies", that I can drop it in a directory and it'll just work. As far as I'm concerned, this complaint is moot.
I built it for many reasons:
- Most docker images do not contain netcat so you would have to download one of them in any case.
- In the case of is_ready, you won't have to write this script yourself.
- Repositories like this had a lot of traffic so I supposed that engineers need a similar tool but this repository requires wget and netcat as dependencies. For this reason, I built my own without any dependencies.
https://github.com/eficode/wait-for
I also believe that one week and 30mins are are not enough for 1-on-1s.
In my company, we do 1-on-1s once a month for 1 hour. The manager asks questions like:
- How are you?
- What's the skill that you are trying to improve this month?
- How I (the manager) or the company can help you to improve this skill?
-Do you feel that your responsibilities in the company are common with your personal goals?
I think that these meetings are successful when there is a clear agenda and both sides are prepared.
Personally, I feel very happy with these meetings.
As this repository mentions, this is the example using PostgreSQL.
depends_on: postgres-database: condition: service_healthy
healthcheck: test: ["CMD-SHELL", "pg_isready"] interval: 10s timeout: 5s retries: 5
However, PostgreSQL has already a command for this called pg_isready.
How is this going to work for other cases such as MySQL?