Server-side Rendering Best Practices: How We Run Decoupled Websites with 110 Million Hits per Month

We value transparency in all things, and while our entire platform Lagoon is open-source, we know it is helpful to share our processes alongside just our code or infrastructure.


This presentation from Decoupled Drupal Days shows how we set up a complex project, including: Infrastructure, Platform, Code, and People. Everything is hosted on Kubernetes/OpenShift and we want to show specific learnings from hosting Decoupled sites within Docker & Kubernetes. It also explores how we use a CDN and reverse proxy caching architecture.


The Infrastructure

Our platform is often hosted on AWS but can run anywhere around the world. Our system is fully auto-scaled. This means if the system realizes that it needs more resources it automatically adds them.


The Platform

Each service (Nginx, PHP, MySQL, Solr, Redis) is running in its own container, with Drush running in a separate container for better security. Decoupled projects just have a Node.js container running beside the regular Drupal containers. Cache Tags are very important and are passed through all Cache layers in order to reach the best cache rates.


Code

We run a Single Monorepo for Frontend (Node.js) and Backend (Drupal), which provides better parallel deployments and coordinated rollouts of changes. The ability to create individual Environments for each Pull Request and Branch allows for better testing of individual features.


People

Client’s developers are part of Pagerduty schedules because they know best when something broke. We use a single chat channel with all involved people (Operations, Developers, Stakeholders) so that communication is better and faster. Our engineers balance support schedules so we always have expert advice ready when it is needed.


Watch the full video to see exactly how all these things work together — and as always we want to hear your questions and comments!


Writer