Skip to main content

Blog

Thoughts, tutorials, and insights on development, technology, and more.
Media engineeringReact and TypeScriptAI and retrievalDjango backendPython automationDevOps and reliability

Distinguish liveness from readiness in an application health check

A process that answers HTTP requests may still be unable to serve useful work. If its database is unavailable, a request to a trivial route can succeed while an order lookup fails. Give process health and dependency readiness distinct meanings so that an outage produces the intended operational response.

Verify a PostgreSQL backup by restoring it

A backup file can exist and still fail to restore. Test recovery into a separate disposable database, then check the records and constraints that the application needs. File size and a successful dump exit code are useful observations, but they do not show that the restored application can work.

Run Django's deployment checks before a release

Django's deployment checks can catch a release that still uses development-oriented settings. Run them with the same settings module and environment that the deployed process will read. A clean local development check says little about a different production configuration.

Set proxy timeouts for a streamed API response

A streamed response can remain useful for several minutes while sending small updates. A proxy that buffers those updates can make the browser look idle, and a long pause between upstream writes can close the connection. Diagnose buffering and idle timeouts separately before changing a timeout value.

Keep deployment secrets out of a Docker image

A credential copied during a Docker build can remain in the resulting image history or a previous layer. Removing the visible file in a later instruction does not establish that the image is safe to distribute. Keep deployment credentials outside the build context and supply them only when the container starts.

Wait for database readiness in Docker Compose

A web container can start while PostgreSQL is still initializing its data directory. If the application opens its first connection during that interval, an otherwise valid release can fail with a connection error. Give the database a readiness check and make the application's initial startup depend on that check.