Deploying Your API
Go is an ideal language for deployment. Its ability to build a single statically linked binary makes deploying and running in any environment easy. The cross-compilation support is another key feature that makes Go an excellent choice for deployment anywhere. You can build your Go binaries on any platform and deploy them on the destination platform. This suits you incredibly well when running them in other architectures, such as ARM for Raspberry Pi or MIPS for routers. Nowadays, there are a lot of options for deployment, from real hardware to modern orchestration systems such as Kubernetes, and many other things in between, such as Docker, virtual machines (VMs), or serverless functions. Go can be very convenient for any of those deployments, but how should you deploy each of them?
We are going to explore the following in this chapter:
- What kind of deployment options suit your needs
- How I deploy in a bare-metal or virtual server
- How I...