🎄Which config language to choose in 2024🌟
Dec 18 2023
There are different configuration languages and it's hard to choose which one to use. Here is a list of the most popular ones and their pros and cons.
YAML
Example:
server:
port: 8080
host: localhost
endpoints:
- /api
- /health
What are the systems that use it?
- Kubernetes
- Docker Compose
XML
Example:
<server>
<port>8080</port>
<host>localhost</host>
</server>
<endpoints>
<endpoint>/api</endpoint>
<endpoint>/health</endpoint>
</endpoints>
or with springboot:
<bean class="com.mynamespace.Server">
<property name="port" value="8080"></property>
<property name="host" value="localhost"></property>
</bean>
What are the systems that use it?
- Maven
- Spring
JSON
Example:
{
"server": {
"port": 8080,
"host": "localhost"
},
"endpoints": [
"/api",
"/health"
]
}
What are the systems that use it?
- npm
- webpack
pretty much any javascript project
TOML
Example:
[server]
port = 8080
host = "localhost"
endpoints = [
"/api",
"/health"
]
What are the systems that use it?
- Rust
- Hugo
INI
Example:
[server]
port = 8080
host = localhost
endpoints = /api,/health
What are the systems that use it?
- Python
- Java
So what is a conclusion? Which language should I use?
Unfortunately as of 2024 there is no conclusive answer for that.
Use the format that is the most popular in the framework or language you use.
If you are doing Kubernetes, it would have to be YAML.
If you are building JS projects, it would have to be JSON.
Probably TOML with rust.
etc.