Embracing Complexity in Serverless!
Source: thehindubusinessline.com/
Simple
Easy
Complex
Hard
The human body is the most complex
system ever created. The more we
learn about it the more appreciation
we have about how rich system it is.
- Bill Gates
We’re born with a complex system.
We Embrace It!
1. Acknowledging Complexity
Agenda
3. Managing Complexity
2. Understanding Complexity
#TheServerlessBook #TheSpeakerBook
Engineer. Architect. Author
AWS Serverless Hero
Team Topologies Advocate
SheenBrisals.com
Sheen Brisals
1# Acknowledging Complexity
Complexity is Almost Everywhere
Our Lives. Environment. [Software] Engineering
Mainframe Computers …To…Mobile Phones
Self-hosted Systems …To… Cloud Computing
Monoliths …To… Microservices
Every application has an inherent amount of
complexity that cannot be removed or hidden.
Instead, it must be dealt with either in product
development or in user interaction.
- Larry Tesler (Tesler’s Law)
Law of Conservation of Complexity
Complexity is Not Always Bad
For Safety. High Performance. To Trust
Largest passenger airliner
Range: 14,800 km / 9,200 mi
Speed: 903 km/h / 561 mph
Altitude: 43,000 ft/ 13,000 m
Complexity is Often a Necessity
Serve Customers. Tech Evolution. Business
Survival
Kitchen
notification
Food dispatch
Customer
notification
Checkout Route planner
Instore orders Online orders More!
Stock Phone orders
Loyalty
Menu
Driver tracking
Payments
Order
management
Personalization
3rd
Party
systems
Customer
service
Kitchen
notification
Food dispatch
Customer
notification
Checkout Route planner
Instore orders Online orders More!
Stock Phone orders
Loyalty
Menu
Driver tracking
Payments
Order
management
Personalization
3rd
Party
systems
Customer
service
Essential Complexity
2# Understanding Complexity
Complexity is the behavior of a system whose
components interact in multiple ways, so possible
interactions are difficult to predict.
- Wikipedia
Know it!
The Sign of Complexity
The Sign Expression of Complexity
It’s a nightmare!
I can’t touch it
It’s hopeless
It’s just a piece of ****
Cognitive Load
Source: Balancing Coupling in Software Design
Object
store
Object
store
Function
Function
Function
Function
Function
Function
Queue
NoSQL
store
Topic
Topic
Event
bus
Event
bus
Object
store
Workflow
The Two Sides of Complexity
Accumulated
Disorganized
Distributed
Organized
Hidden Visible
Local Global
Org, domain,
department, team
boundary
Communication line
Monolith
Microlith
Lambdalith Functionlith
Distributed System
3# Managing Complexity
Simplexity
Complex systems built against
simplicity principles for
manageability!
- Dr. Werner Vogels, at AWS re:Invent 2024
Decompose Complexity!
To Find Simplexity!
Decompose the business before
decomposing the systems.
Domain: Ecommerce
Domain: Ecommerce
Subdomain: Products
Subdomain: Orders
Subdomain: Payments
Subdomain: Loyalty
Subdomain:
Personalization
Domain: Ecommerce
Subdomain: Products
Subdomain: Orders
Subdomain: Payments
Subdomain: Loyalty
Subdomain:
Personalization
Content Catalogue
Promotions Stock
Next Best
Actions
Fulfillment
Cart
Recommenda
tions
Segments
Checkout
Rewards
Earnings
User
Payments
Fraud
Prevention
Payment
Methods
Members
Domain: Ecommerce
Subdomain: Products
Subdomain: Orders
Subdomain: Payments
Subdomain: Loyalty
Subdomain:
Personalization
Content Catalogue
Promotions Stock
Next Best
Actions
Fulfillment
Cart
Recommenda
tions
Segments
Checkout
Rewards
Earnings
User
Payments
Fraud
Prevention
Payment
Methods
Members
Systems Distribution
Domain Boundaries
Responsibility Boundaries
Team Boundaries Ownership:
Codebases
Cloud Accounts
Service Contracts, Types
Sync
Async
Communication Complification!
Prevent it at All Cost
Building an Event-Driven Architecture (EDA) without a brain is a
gateway to a distributed monolith.
System A
System B
System C
System D
System E
Event Broker
Resources / Services
Cross-account
EventBridge Communication
System A
System B
System C
System D
System E
Some technologies are complex by nature.
Often, we create complexity with simple technologies!
Wikipedia
Accidental Complexity
https://tinyurl.com/z3e6dhbz
System A
System B
System C
System D
System E
System A
System B
System C
System D
System E
Cross-Account Chaos that leads to a Distributed Monolith
Don’t let…
Simplification causes complification!
Cross-account communication leads to
cross-account chaos!
Event drivers turn into event intruders!
Essential Complexity becomes Accidental
Complexity!
System B
System C
System D
System E
Domain Bus
Enterprise Bus
Architecture Evolution
Leverage the Power of Small
Think
Modular
Primitives Functions
Constructs Microservices
Modularity Controls Complexity
1. Eliminates accidental complexity – avoiding poor design.
2. Encapsulates complex parts – preventing complexity spilling across.
- Balancing Coupling in Software Design
Serverless microservice is a composition of cloud services
knitted with infrastructure as code (IaC).
Protect with Patterns
Prevent Complexity
Design Patterns Service Patterns
Event-Driven
Patterns
Integration
Patterns
Cloud Patterns Storage Patterns
Architecture
Patterns
Sustainability
Patterns
Serverless Patterns
Credit: ormecgroup.com/
Anti-corruption Layer (ACL)
Protection from Complexity
Collaboration type
Customer-supplier Separate ways
Cooperation
Partnership
Shared kernel
Conformist
Anticorruption layer
Open-host service
Patterns
ACL is an integration pattern between two bounded contexts
and acts as a translation layer to map data between two
systems to protect their data models.
Prevent. Protect.
Upstream
Supplier
Bounded Context
Downstream
Consumer
Bounded Context
Data
ACL
If a bounded context conforms to a mess,
it risks becoming a mess itself.
Continually Refactor!
Don’t Stack up Complexity
Complexity sneaks in all the time and it is
something you really need to control.
- Dr. Werner Vogels, AWS re:Invent 2024
Refactoring is a process of changing a
software system.
Pre-cloud refactoring focused on the
software programs [code].
Serverless refactoring is not just about code rewrite but
service re-wiring as well.
Serverless allows refactoring at a granular level.
Program refactoring Infrastructure refactoring
Architecture refactoring Refactoring for cost
Cloud service updates Uptake patterns & practices
Refactor Complexity!
To Close…
Being disciplined: Prevent, Protect, & Refactor
Avoiding event intruders to eliminate tangled systems
Building modular systems that can evolve
Decomposing complexity: From top down
Acknowledging the need: When, Where, & Why
Accepting the essential & avoiding the accidental
Embrace complexity by…
Complexity is inherent in modern systems.
Therefore, apply systems thinking and
simplicity principles to manage it effectively.
Embrace the Essential. Avoid the Accidental.
#TheServerlessBook #TheSpeakerBook
Sheen Brisals
Thank
You!
Engineer. Architect. Author
AWS Serverless Hero
Team Topologies Advocate
SheenBrisals.com
Embracing Complexity in Serverless! GOTO Serverless Bengaluru

Embracing Complexity in Serverless! GOTO Serverless Bengaluru

Editor's Notes

  • #1 There is no Lambda hack or AI magic show.
  • #15 To remember and recognize Larry Tesler, think of the the most popular task a software engineer does? Copy-paste!
  • #67 Ffumigation service