Pioneering Serverless Payments at The LEGO Group

Luke Hedger

The LEGO Group

Brick by Brick - Aug 2022

René Magritte

Pioneer of Surrealism

René Magritte challenges us to use ordinary objects in unusual contexts

This is not a pipe

This is not a server

Pioneering Serverless

Payments

September 2018

Brickoin

LEGO.com

Brickbank

20+ Microservices
80+ Lambda functions
100+ GB in DynamoDB
10+ Step Functions workflows
40+ EventBridge rules

Payments platform

Contain complexity

Image from cockroachlabs.com

async

processes

365+ days

shoppers

Scale, scale, scale

Image from leanovia.com

May 4th

What happens after the serverless launch, after the pioneering?

How does mature serverless app stay modern?

Post-Pioneer

Growing up

  • Different challenges today vs start
  • Stability vs speed
  • Serverless has changed
  • Architecture and operations may not scale

The tradeoff

DELIVERY SPEED

APP STABILITY

Decisions

Serverless Things Start → Scale
Delivery pipelines Start with one, scale to many. Move focus from implementation to delivery
Separate concerns Start with few, scale to many. Collect domain knowledge, avoid wrong abstraction
3rd party tools Didn't exist (EventBridge) or unproven (CDK). Evolvable architecture
Emerging standards Serverless matures, community grows, discussion amplifies
Test strategy Stability > speed → stability == speed
Observability Unknowns decrease over time

Finding balance

DELIVERY SPEED

APP STABILITY

Serverless stability is often compromised by complex events

Stability

Plastic events

Consolidate events

Share events cross-application

Standard events

Secure events

Ship!

We need to observe production behaviour ASAP when using managed services

Continuous Serverless Delivery

Serverless SDLC

  • Solution design - architecture, service limits
  • Targeted refactoring, strangler pattern
  • Optimise for test confidence, not coverage
  • Isolated service deployments
  • Use alarms!

Design → Develop → Test → Release → Observe

Speed up tests by reducing coverage

Serverless Square of Balance

Designing a test strategy allows us to ship at a sustainable rate as our codebase grows

Serverless Test Strategy

Serverless Test Strategy

❌ Test everything all the time

❌ Long-running tests

❌ Too-good tests

❌ Ignore failures/hit retry and 🤞

Identify critical paths ✅

Test against the cloud ✅

Test integration points/event sources ✅

Blend with observability ✅

Until next time...

Work in progress

  • Fault tolerance - idempotency
  • Observability - less logs, more metrics

Thanks!

Made with Slides.com