Pioneering Serverless Payments at The LEGO Group

Image

Luke Hedger

The LEGO Group

Brick by Brick - Aug 2022

Image
Image

René Magritte

Image
Image

Pioneer of Surrealism

Image
Image
Image

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

This is not a pipe

Image
Image

This is not a server

Image
Image

Pioneering Serverless

Payments

Image

September 2018

Image
Image

Brickoin

Image
Image

LEGO.com

Image
Image

Brickbank

Image
Image

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

Payments platform

Image
Image

Contain complexity

Image
Image

Image from cockroachlabs.com

async

processes

365+ days

shoppers

Scale, scale, scale

Image

Image from leanovia.com

Image

May 4th

Image
Image
Image

What happens after the serverless launch, after the pioneering?

How does mature serverless app stay modern?

Post-Pioneer

Image

Growing up

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

The tradeoff

Image
Image

DELIVERY SPEED

APP STABILITY

Decisions

Image
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

Image

DELIVERY SPEED

APP STABILITY

Image

Serverless stability is often compromised by complex events

Image

Stability

Image

Plastic events

Image
Image

Consolidate events

Share events cross-application

Standard events

Image
Image
Image
Image
Image
Image

Secure events

Image
Image

Ship!

Image
Image

We need to observe production behaviour ASAP when using managed services

Continuous Serverless Delivery

Image
Image

Serverless SDLC

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

Design → Develop → Test → Release → Observe

Speed up tests by reducing coverage

Image

Serverless Square of Balance

Image
Image

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

Image

Serverless Test Strategy

Image
Image

Serverless Test Strategy

Image

❌ 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...

Image

Work in progress

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

Thanks!

Pioneering Serverless Payments at The LEGO Group

By Luke

Pioneering Serverless Payments at The LEGO Group

The LEGO Group was a super early adopter of the serverless mindset and associated technology. It is time to review how one of its core products continues to operate and innovate 3 years on. We will take a look at the serverless, event-driven architecture powering The LEGO Group's payments platform, Brickbank, and how it facilitates e-commerce on a global scale. We'll explore the full software delivery lifecycle of the payments platform, including development, testing, release and observability. We will look at some of the key AWS services that play crucial roles in the platform's architecture, including Lambda, Step Functions, DynamoDB, EventBridge, CDK and Macie. We will also assess how a mature serverless application remains up-to-date with constantly evolving best practices, industry trends and feature requests.

  • 1,701