Unlocking Sustainability
at Scale

...with SSG and Composable Architecture (+ more!)
 

@zajkowskimarcin

Is it just a buzzword?

It's not a new thing...

Interesting fact: In 2022 it was ~2-3%.

Source: https://umbraco.com/blog/announcing-the-2024-umbraco-awards-nominees/

Let's blame AI for that!

"As technology evolves, power demand from data processing is expected to double nationwide in three years. One small example of this demand surge — OpenAI’s ChatGPT requires 2.9 watt-hours per request, and that’s nearly 10 times more power than a typical Google search.” - Benjamin Fowke

Is it a lot?

  • one YouTube video = 15 queries
  • boiling a kettle = 16 queries
  • laundry = 139 queries
  • San Francisco <> Seattle = 92593 queries

We're all gonna die.

You are Taylor Swift of IT.

More than just {your_spec}.

 

DATA TRANSFER

COSTS $$$

SECURITY

TIME

PEOPLE

TECHNOLOGY

PROCESSES

LATENCY

STORAGE

"You might fight for sustainability and systems that are clean and end up with editors uploading tons of a big videos/images or shitty js tracking libraries."

Start with WHY(s).

WHY we need to build / rebuild / update it at all?

And do we?

WHY we need microservices and not a good, old monolith?

And do we?

WHY we want to go composable and/or
API-first
?

Do we have enough competencies in the team?

WHY we want to host it on Azure (or other Cloud)?

Play the cards you're dealt.

"Lies, damned lies, and statistics"

  • Education of new competencies = new costs + time
  • What we prioritize and what are our goals/KPIs - "is sustainability a thing/feature" at all?
  • Server-side vs. client-side rendering or maybe static site generation?
  • Use common patterns (e.g. Circuit Breaker, queues / event-driven message buses etc.) or even repeat failed requests with Polly (in .NET)
  • Involve UX (good UX) as early as possible and collaborate on the app design for its sustainability

Green Hosting.

Good (enough) infrastructure.

Scalability.

Observability.

Reliability.

Buzzwordability.

On-Prem, IaaS, PaaS, SaaS?

Size matters.

Location matters.

On-demand resources.

Do you need CMS for 24/7?

Do we use Development / Staging / UAT environments now?

Are those "real time" updates really need to be "real time"?

Do we need to keep old data? How long retention?

Are you truly headless now?! ;) Can you live without your head?

Single VM is OK!

See @levelsio's startups or @dhh's Rails apps.

 

Speaking databases for example, SQLite can handle 400k to 400k HHTP requests per day. 200 SQL statements per page request. It's more than enough for most of the small/mid scale projects.

 

(Rails new, Umbraco and Laravel has SQLite set as its default DB)

Cloudflare /

Connectivity Cloud?

goto start;

Green (Carbon Aware) DevOps.

Eliminate first

  • Reduce pipeline runs
  • Reduce the number of jobs
  • Remove ghost pipelines / not needed ones

Increase run efficiency

  • Execute intense testing runs (integration, load testing, performance testing) during low-carbon periods (e.g. nights)
  • Scale workers when (and only if) needed
  • Cache where possible
  • Split repositories
  • Automate what's possible = less time spent by people doing boring, manual things

Measure, measure, measure

  • Track and monitor built minutes/hours
  • Analyse hardware efficiency and set baselines for future builds

Green Code?

Green Good Code!

DDD

(Polish) Dawaj Dawaj Deploy...
(Russian) Davai Davai Deploy...

Instead...

  • Listen to your IDE
  • Don't listen to GPTs
  • Use Common.Sense!

Umbraco <3 Sustainability

Community Team

Umbraco.Community.Sustainability

Reduce number and size

of requests.

gzip all the things.

gzip

index.html

  • Original: 147 kB

  • Minified: 123 kB

  • Gzipped: 22 kB

  • Gzip + minify: 20 kB

- task: PowerShell@2
  inputs:
    targetType: 'inline'
    script: '& 7z.exe a -tgzip $(Build.StagingDirectory) $(Build.SourcesDirectory)\README.md'

-64% (.html)

-80% (markup)
x 20 000 pages..

Best Green Website.

😂

Sustainability

...as a Feature

Incremental Content Caching

Incremental Static Regeneration

Incremental Team Education ;)

Marcin Zajkowski

zajkowskimarcin

mzajkowski

zajkowskimarcin

tbpgtsm.com

Country Manager @ Novicell PL

Solution Architect @ Novicell UK

CTO @ Novicell NO

CTO / CKO @ WOW School

Marcin @ umbraCoffee (Last Friday's 11:30 on YT)

Blogger @ udfnd.pl

YT Wannabe / Podcaster @ The Busy Programmer

Tools used/mentioned

Thank you!

@zajkowskimarcin  /  mza@novicell.co.uk

Unlocking Sustainability at Scale with Static Site Generation and Composable Architecture

By Marcin Zajkowski

Unlocking Sustainability at Scale with Static Site Generation and Composable Architecture

Sustainability is no longer a nice-to-have, side effect feature or just a KPI we need to report on. It's a serious design consideration in many solutions we plan and implement. Can we combine modern, dynamic design and complex business requirements with a lightweight, dev's friendly implementation? How can we have a real impact on data consumption and deliver high performant digital experiences? Let's deep dive into the technical intricacies of sustainability at scale. We will examine a large-scale global website with 1000s of pages, where each one seamlessly integrates CMS content alongside data from various other sources. The example explored will show you how to build a resilient, true headless, and composable content layer with a preprocessed, incrementally and statically generated site based on Astro and Vue.js using latest Umbraco CMS and a suite of best-of-breed services such as Enterspeed (Content federation layer), Cloudinary (DAM/CDN) and Algolia (Search as a service).

  • 137