part 1: Techstack

Imperative and Declarative Ways:-

Imperative way involves manual works eg. get the specific VM up, install packages e.g nginx, go, postgresql. Copy the source code from some repository and start the webserver [cannot handle broken changes automatically]

Declarative way involves automation using tools like Terraform, ansible,puppets. It can check if the resource[nginx versionX,databaseX, configX from git repo] already exists(it has already been done? apply necessary changes only) or not