azure-spring-cloud

Difference between "Config Server" and "Configuration"


I have an Azure Spring app. There I can create a "Config Server" to get configurations from a Git repository. I can also create environment variables in the respective app.

Where is the difference between these two ways to load configurations into my Java app?

Config Server:

enter image description here

Configuration of one app:

enter image description here

Trying to get the difference from google.


Solution

  • Imagine the "Config Server" as having a personal assistant for your configurations. This assistant lives in a central place (like a server) and keeps all your preferences organized in one neat spot, kind of like a Git repository. When your application needs to know a configuration, it just asks this assistant, and the assistant hands out the right information. The cool thing is, if you change something in that repository, the assistant notices it and updates your configurations without you needing to restart your application. It's like having your personal DJ who always picks the right music.

    On the other hand, environment variables are like sticky notes for your application. You can stick these notes right onto your Azure Spring application. Each note has a piece of information that your application needs to work properly. Imagine that every time your application starts, it reads these notes to know how to behave. However, if you change something on a note, it's like your application already read it and won't notice the change until you restart it. It's like telling your friend how to get to your house and then changing the route without letting them know.

    In short, the "Config Server" is great if you want to keep all your preferences organized in one place and have your application adapt on the fly to changes. Environment variables are more like an easy way to give instructions to your application, but if you change those instructions, you'll need to give it a nudge to notice.

    Does that make more sense now?