It is becoming more popular to use systems which use a config to define how your application should run or how the infrastructure (such as a website or monitor) should be setup. This is declarative programming which means you don’t have to spend time writing step-by-step code which would probably be more detailed and error-prone.
Below is a list of systems I have worked with or read about which use config files to manage state (such as deploying and running a web application).
- AWS infrastructure management
- DNS and Cloudfront (cache).
- Configuration is managed by a directory Terraform files. Which includes
.tfvarfiles, depending how you do it.
- DataDog synthetic tests
- Cloud monitoring as a service.
- Configuration is managed by a directory Terraform files.
- See datadoghq.com.
- For Continuous Integration / Continuous Deployments (CI/CD).
- See circleci.com.
- YAML file configs.
- See buildkite.com
- Deploy applications including running tests and building containers.
- GitHub Pages
- This describes attributes like the title, URL, theme, Jekyll plugins. Locally you might use a
Gemfile, but the config itself is sufficient for deploying remotely. See GitHub Pages website.
- Netlify is similar to GitHub Pages but allows more fine-grained control. You can use the config to set similar details but also custom build commands (such as using npm, Hugo or Gatsby). While you can set details through the Netlify UI, having it in a config file makes it easier to manage, especially when setting the website up a second time using the same details as before. See Netlify.
- GitHub Actions
- See Actions page on GitHub.
- Can be used running automated tests and publishing a package or deploying. This could be for a Ruby or Python or GitHub Pages project for example. It can also be used for automation like sending a tweet or maintaining a GitHub repo with a bot.
- Managing servers
Other declarative systems
Here are some other forms of programming which are not config-based but still use declarative logic, or manage tasks or state at a high-level.
- Jenkins Pipeline
pipeline.gvy. This runs in the Groovy language (built on Java) typically on a Jenkins server. This is a way of running named items in a sequence and is useful for deploying to or backing up, especially to multiple servers. You can run groovy scripts and shell commands in the file. See Pipeline doc or Creating your first Pipeline.
- Python Fabric
fabfile.pySee fabfile.org. Similar to Pipeline, Fabric is the Python way of running tasks like shell commands for a deploy.
- See reactjs.org.
- This is a JS library with a main advantage managing state, to make DOM manipulations and preserving state might lighter.
- A flavor of SQL, Postgres is declarative as the SQL query describes what you want to achieve (selecting, grouping, filtering, ordering) and the server decides how to handle this. In fact, you can run the same query multiple times and depending on things like the number of rows or what indexes are available, it can run different logic behind the scenes for the best performance. See the EXPLAIN command.