An Online / SaaS platform, scalable, safe and fast | The Docker container architecture: a prototype

Jan 25, 2019

Thomas Dik - Lead Developer
+31 (0)20 - 261 14 99

In order to be able to scale an SaaS Platform safely and stably, a good dose of dev-ops knowledge is required: a fast, scalable Docker container structure is essential for the online application. We develop online platforms in which an infinite number of customers can work in isolated environments: one central SaaS platform, an infinite number of customer environments. What does this software architecture look like? A prototype:

Why is a Docker container foundation needed? Read here.

What can the Docker container architecture look like for an SaaS Platform, a concept:

Generic information

  • This concerns the container architecture for a SaaS application in which, fully automatic, infinite environments can be generated: a subdomain per customer is created, but also infinitely many main domains can exist in this.
  • The SSL certificates are automatically generated and extended for each environment with LetsEncrypt.
  • After initial production, constant optimization of this container architecture will be necessary to keep the online platform safe, fast and stable. And so that the server costs continue to fit into the business model.

Architecture of Docker containers

First of all, the entire container architecture must be given a stable operation, even without the actual application: all Docker containers and automatically generated container sets must become stable in one platform.

Further necessary tasks so that unlimited new, isolated application environments for customers can be generated:

1. ‘Bash script’ development

As soon as a new environment for a customer needs to be created, this is done with the help of a custom Bash script, which among other things has to perform the following tasks to generate a new container set:

2. ‘Docker gen’ container

The Docker Gen tasks:

  • Forwards the 'Gateway proxy' (Nginx in Gateway container set) routing for the new environment.
  • Creates Virtual Host.
  • Generates Nginx config for each environment.
  • Reads the generated environment variables from all 'Application container sets'.
  • Creates Docker containers in relevant application set, which get the correct environment variables.

3. SSL Tasks container in 'Gateway container set'

  • Creates SSL certificates via LetsEncrypt
  • Docker-gen ensures that the correct SSL certificate is linked to the relevant environment.
  • Automatic renewal of the SSL certificate for all domains, also via the LetsEncrypt API.

4. Interfaces between custom SaaS application and open source code

  • The majority of the application code lives in the containers 'PHP / Web application' and 'NodeJS'.
  • This custom application code has to interface with all other containers within the 'application container set' to get the integral SaaS platform working.
  • The Proxy / Nginx container works as a router: all traffic within the 'application container set' he handled.

Many of these containers are available open source but the architecture to develop this container platform as described is not available, we will have to develop it to measure, test and iterate.

And, before you can start producing this architecture, a prototype will first have to be made, in which a lot of research, configuration and testing is required.

You also can not escape the development of custom containers, because not all containers are immediately available, or work as desired out-of-the-box.

Wrap up

So far Docker container structure concept for an online SaaS Platform. We previously realized platforms in which this architecture was implemented.

Our experience is, to get this working properly, you need a specialist software development team. Where everyone can think full stack, but specializations are divided. These software specializations are necessary to get such an online platform safe, stable and scalable. So, call us if you need us ;)

Photo by Martin W. Kirst ofUnsplash

Wanna stay informed?

Monthly Newsletter →

Comments

Need even
more knowlegde?