The popularity of Serverless is growing strong every day. Though it is gaining strength in the industry, its adoption in larger enterprises is not on par with others. Unlike start-ups, large organizations look for a systematic and carefully planned approach to adopt serverless. The experience is not readily available nor shared with the larger community. This talk aims to fill in the gaps by sharing a unique serverless adoption story at the LEGO Group. It will take you through the evolution of serverless adoption, ways to grow serverless teams, best practices, and achieving sustainability with serverless.
2. Introduction
Challenges with the legacy system
The reasons for change
Startingwith serverless
Developing with serverless
Lessons and experiences
The Future
Agenda
10. Black Friday with a monolith
VPC
Node.js
+
React
Elastic Beanstalk
container
Server contents Server contents
Tax
Products CRM
Fulfillment Rewards
VPC
Gateway
503 Service
Unavailable
Corporate
data center
Server contents
11. Points of failures
VPC
Node.js
+
React
Elastic Beanstalk
container
Server contents Server contents
Tax
Products CRM
Fulfillment Rewards
VPC
Gateway
Corporate
data center
Server contents
Monolith
One big database
Fixed scaling
On-premises
Tightcoupling
Unstable3rd party
gateway
Containers
chaos
Scaling
constraints
Legacy
LimitedDB
connections
Deployment
nightmare
Non cloud 3rd
party system
No end-to-end
observability
13. Business
Expansion
Reach more children - Enter new markets
Development
Agility
Product innovation – Teamvelocity – MVP to MVP
Operational
Visibility
Platform observability– Proactive monitoring - DevOps
Business demands
Minimum Viable Product
Maximum Valuable Product
15. Too many options… Off the
shelf?
…and wait for every feature
request?
Cloud version from the same
vendor?
…not cloudat all but a wrapper
Build own microservices?
Innovative, but how do we run?
docker
Container
Container management
Isn’t that what we’re trying to avoid?
18. serverless
Pay for
compute &
storage
Auto scalable
& highly
available
Cloud
computing
model
Scale to zero
& low cost
No server
management
for you
what
Singlepurpose functions
Managed services
Nocontainerprovisioning
Noloadbalancing
Payas youuse
Nocostforidletime
Granular costvisibility
Auto scaledown
Individual servicescaling
Service&data redundancy
19. serverless
Ecosystem of
serverless
services
Ideal for
iterative
development
Optimisation
at granular
level
Engineering
diversity in
teams
Deeper level
security &
data privacy
why
Individual resourcelevel
Multi options perservice
Notjust functions
Fullymanagedservices
Beyondbeingaprogrammer
Multipleresponsibilities
Startsimpleandscaleup
Event-drivenandextendable
Leastprivilegeprinciple
Encryption&multilayerprotection
26. Admin user Vouchers API Request queue Generate vouchers Vouchers store
Voucher topic
Email notification
Email with AmazonS3 signed URL
Acknowledge
POST
GET
Async
Sync
Rewards generation and notification
1000s of voucher
generation at a time
Learned the decoupling of batch
jobs and event notifications
28. Customer topic
New commerce
platform
New customer
datahandler
Customer
created
Fetch
data
Updatedata
Reward customer
handler
Saved payment
datahandler
Fetch
data
Fetch
data
Updatedata
Updatedata
On-demand customer data migration
Serverlessand legacyin
harmony!
Take bold steps, think differently & trust
event-driven architecture
29. Shop
POST
GET
Submit order
API
Submit order
function
Submit order
queue
Process order
function
Update
status
Order status
API
Status provider
function
Order
cache
(TTL)
Order number
Query status
Payment
providers
New commerce
platform
User-facing checkout services evolved
Serverlessfor performant
user-facingAPIs
Admired the serverless scaling and performance to
serve customers efficiently!
40. # Accept change. Prepare to change
Serverless requires a mind-shift to see the products as
event-driven orchestration of managed services, knitted
with infrastructure code.
Sheen Brisals
Mindset shift from a traditional monolith mountain thinking to
a molehill microservices thinking
41. Serverless requires a new way of thinking, working, and
running applications. Meaning, we need to change our old way of
thinking, working, and running applications.
42. Old vs Serverless Way
Old way of thinking
Idea Design Build Operate Sustain
Serverless way of thinking
Requirements Analysis Design Development Testing Release Maintenance
BigBang
Incremental &Iterative
Done& Dead Doing&Alive
Siloed Specialists
Full stack& Diverse
Serverlessrequires a new way of thinking,
working, and running applications. Meaning, we
needto changeour old way of thinking,
working, and running applications.
43. # Think of business domains
Domain-Driven Design
It’s not a book. It’s an industry!
44. Domain model
Supple design
Bounded context
Anticorruption layer
Distillation of core domain
A system that is hard to understand is hard to change
50. # Develop in set-pieces
I just don’t think it’s that simple. Nothing is.
Everything is, when you break it down!
Mama Mia! Here We Go Again
51. A scene or sequence of scenes
whose execution requires logistical
planning
A realistic piece of stage scenery
built to stand independently as part
of a stage set
52. A rehearsed team manoeuvre
practised in training in
advance of matches
Parts of a model that are built
separately and assembled
together
53. Developing as Set-Pieces requires planning and
execution, but can be developed and tested
independently, and brought together.
56. Payments
Higher degree of change
If a part changes frequently, how can
we isolate the disruption?
How can we prevent deploying
everything every time?
Subdomain view
58. commit build test stage production
Refunds
Reports
Authorization
commit build test stage production
commit build test stage production
Independent delivery pipelines
63. # Use proven patterns
Patterns help a designer get a design ‘right’ faster
Patterns can offer a solution
Patterns can be associated with a problem
Successful designs and architecturesthat can be reused
66. Choreography
Event Bus
Publisher Subscriber
Publisher Publisher
Publisher
Subscriber
Subscriber Subscriber
No conductor
Pub-sub model
Service decoupling
Asynchronous
Idempotency
Traceability
Use choreography to coordinate
different microservices
76. # Automation & DevOps
Account separation
Infrastructureas Code (IaC)
Grow CI/CD pipeline
Instil a DevOps culture
Integrationtests
Test in real environment
Alerts and alarms
Service ownership
80. Iterative and Incremental Approach
design
review
agree
develop
Start small and evolve
MVP to MVP mindset
Solution first. Perfection next
Iterateand improve
Fast decision making
81. CI / CD Pipelines
Repository separation
GitHub Actions
Squad owns their pipelines
Pipeline per microservice
90. Code Refactoring
Refactoring is a process of changing a
software system.
Refactoring, by Martin Fowler
Pre-cloud era influenced by,
Object Oriented Principles
Programming Language
92. Justifying Serverless Refactoring
Turn refactoring needs into business goals
Keep refactoring part of development process
Promote refactoring as a technology motivator
93. Justifying Serverless Refactoring
Turn refactoring needs into business goals
BusinessAPI
improvements
Low latency
NPS Score
Queue batch
increase Increasedthroughput Serving more customers
E
n
g
i
n
e
e
r
i
n
g
B
u
s
i
n
e
s
s
94. Justifying Serverless Refactoring
Keep refactoring part of development process
Set aside a sprint or two every quarter
Keep a team idea board to collect ideas
Discuss the benefits and get the business buy-in
Monitor and circulate improvement metrics
95. Justifying Serverless Refactoring
Promote refactoring as technology motivator
New services & features
New patterns
New CI/CD possibilities
New metrics & observability options
98. If you spend too much thinking about a thing, you will
never get it done
- BruceLee
You cannot create experience,
you must undergo it
- Albert Camus
99. Understand serverless. Make a humble start
Have the mind-shift. Set the guard rails
Think granular. Think Set-Piece microservices
Grow your serverless teams. Develop talents
Continue refactoring. Accelerate business value
Think sustainability. Be sustainable!