Articles
/
Other

How we handle settings required by different stages of Aidbox work.

Artyom Bologov
April 11, 2025
2 min

Any program has stages of its life. Startup, initialization, regular working, cleanup, error, shutdown. At all of these stages, the program (say, Aidbox) needs to know its settings to behave in ways the user expects. 

But settings might come from different places, like database or config files, and the program doesn’t have access to all of these from the start. For example, a database connection cannot be established if the program doesn’t know where to connect to. This is an engineering problem of deciding how to bootstrap Aidbox from no settings to proper user-configured system.

We solve it with multi-stage initialization. First, we take essential settings from environment variables. With these, we start the database and take more settings from there. And after we have all the vital settings, we can load the rest of the setting sources (like additional configuration files) and apply them to Aidbox.

With this multi-stage approach, Aidbox FHIR server starts with no knowledge of settings and builds up the understanding of these reliably and predictably.

How did you like the article?

contact us

Get in touch with us today!

By submitting the form you agree to Privacy Policy and Cookie Policy.
Thank you!
We’ll be in touch soon.

In the meantime, you can:
Oops! Something went wrong while submitting the form.

Never miss a thing
Subscribe for more content!

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
By clicking “Subscribe” you agree to Health Samurai Privacy Policy and consent to Health Samurai using your contact data for newsletter purposes