How to scale services in cloud
Overview
Running services in scalable environment eg. Kubernetes service allows you to distribute traffic load on multiple application. If you plan to handle huge amount of request then this manual can help you decide which approach may suit you the most.
Environment
Concept
In order to make the most flexible server architecture you should plan it as shown below:
As you can see on the diagram, you need an entrypoint into your network. In GSD we use fully automatic reverse-proxy app called Traefik. It is the best if you have complete Docker ecosystem, scales easily, balances load, automatically generates Let's Encrypt certificates etc. However if you don't have any experience with cloud architecture it may be easier for you to use nginx which can also work as reverse-proxy software.
Below load-balancer there is a GSD Proxy, it is completely optional but allows to group other services into path alias and work on a single port. More info about GSD Proxy
And at the bottom you can see single services scaled depending on your needs.
Below you can see how the load is being balanced between our REST-Api applications in Kubernetes Cloud:
Recommended environment setups
Typical dedicated server or VPS, normal speed, manual scalability, easiest to set up:
This is easiest solution. This setup does not include scalability out of the box. You should use this type of environment in development or small production servers up to 50 simultaneous users per running app.
Normal speed, manual scalability, average difficulty to set up, requires knowledge of Docker:
Docker images. Those allow you to add new machines (application blocks) to your VPN or cluster by changing a single entry in "docker-compose.yml" file.
In GSD, we use this set up because it's relatively easy to maintain, upgrade and scale single instance of an application. We currently do not provide docker images or docker-compose files so you would need to create it by yourself however we have planned to provide those in the future so stay tuned.
High speed, high scalability, very difficult to set up, requires knowledge of Docker & Kubernetes:
Docker and Kubernetes cloud, this is the highest possible grade configuration.
This is a very high quality cluster orchestrator. Using this setup allows you to infinitely scale applications. If you plan to handle 1000+ simultaneous users then you should consider this option.