Serverless
Architecture
HELLO! My name is
Dirk Weibel
Technical Lead at Capital One
Building cool stuff with great people
dirk.weibel@gmail.com
linkedin.com/in/dirkw
2
Agenda ▫ Review Important Trends
▫ What is Serverless
Computing?
▫ Rational for Serverless
▫ Ramifications of Serverless
▫ How Serverless works
▫ Serverless Architecture
▫ Code Examples3
Where are we going?
Let’s look at the future state of enterprise computing.
Cloud Computing
From Traditional Ops Teams
To DevOps
▫ Breaking down the wall between
developers and operations
To NoOps
▫ No dedicated team to handle ops
▫ Developers must live with their
code
▫ Incentivizes teams to build low
maintenance systems5
Deployable Units
are Shrinking From Server-based Apps
To VM-based Apps
To Container-based Apps
6
Deployable Units
are Shrinking
From Monolithic Applications
To Service Oriented Architecture
To Microservices
7
Deployable Units
are Shrinking Smaller deployment units:
1) Reduces code complexity
2) Increases our options for scalability
3) Increases environmental complexity
8
What if we could pay by
the function rather than
pay by the server?
9
How far can we go?
10
How far should we
go?How fast should we
go?
Serverless Architecture is the next
step
But what does it mean to be Serverless?
Serverless
Computing
Dirk’s Definition
Deploying small amounts
of functionality without
concern for server
maintenance or scalability
12
Sometimes called Function as a Service (FaaS)
Serverless
Computing
13
Serverless Computing must rely on a
3rd party or separate infrastructure to
manage the servers and services.
Serverless
Computing
14
Ramifications of Serverless:
▫ Lower costs
▫ Operations are simpler (not effortless)
▫ Release Management is more
complicated
▫ Moving between platforms is painful
Serverless
Computing
15
Common Triggers for Serverless functions
▫ Program invocation (i.e. Lambda SDK)
▫ Message (i.e. SQS, SNS, SES)
▫ File creation (i.e. S3)
▫ API gateway
▫ Database event (i.e. DynamoDB event)
Serverless
Computing
behind the
curtain
16
▫ Each service must run on a server
▫ Starting a service on a server takes time
▫ Once a service is started, it handles
requests quickly
▫ A service may passivate between calls
Any given request may have to wait for a
service to either start or activate
Serverless
Computing
behind the
curtain
17
▫ Services must be stateless
▫ Services are able to cache data
▫ Services may need to manage
connections
Passivate/Activate cycle may
result in zombie connections
Serverless
Computing
18
Serverless Operations
▫ Deployment and rollbacks should
be 100% automated
▫ Regression tests should be 100%
automated
▫ Change management is more
important than before serverless
▫ Monitoring is as important as ever
Don’t expect a change in
technology to improve
your teams’ discipline.
19
Serverless
Computing
20
Serverless Designs
▫ Stateless
▫ Single Purpose
▫ Event Driven Pipelines
▫ Microservices Mindset
Serverless
Computing
21
Good Use-Cases for Serverless
▫ Batch Processes
▫ Data Pipelines
▫ Backend Transactions
▫ Scheduled Jobs
Bad Use-Case for Serverless
▫ RESTful Services
Serverless
Computing
Drawbacks
22
▫ Vendor Control
▫ Vendor Lock-In
▫ Startup Latency
▫ Security Concerns
▫ Lack of Tool Support
▫ Poor Support of Versioning
▫ Limited Error Handling
Serverless Usage
Patterns
Real-life examples how Serverless is used today.
“
Make things as simple as
possible, but not simpler.
- Albert Einstein
24
Usage
Pattern
Convert
File
25
LambdaS3User
S3
SES
Lambda
Upload File Upload Event
Save Converted File
Saved File Event
Initiate EmailSend Email
Usage
Pattern
Multiple File
Conversion
s
26
SNSS3User
S3
Lambda
Upload File Upload Event
Save Converted Files
Saved File Event
DynamoDB
Lambda
Lambda
Lambda
Upload Event
Upsert Event
Usage
Pattern
Multiple File
Conversions
(continued)
27
Lambda
User SES
Upsert Event
Initiate Email
Send Email
DynamoDB
Usage
Patterns
ETL
28
SNS
S3
Extract
Process
Redshift
Upload File Read File
Lambda
Lambda
Lambda
Process
Record
Lambda
Persist
Command API
RDS
Command
Enrich
Usage
Pattern
Website
29
Lambda
CloudFrontBrowser
DynamoDBLambda
SPA
APIs
Static Files
API Gateway
Lambda DynamoDB
DynamoDB
S3
OAuth
Service
Authenticate
Code Example
Serverless
Computing
31
▫ Start small
▫ Pick the right use-case
▫ Pick the right patterns
▫ Log extensively
▫ Know your dependencies
▫ Carefully consider release
management
Serverless Computing is the next step
32
THANKS Any questions?
You can find me at
▫ dirk.weibel@gmail.com
▫ linkedin.com/in/dirkw

Serverless Architecture

Editor's Notes

  • #8 Microservices lend themselves to rich internet applications.
  • #14 The top row represents closed source and vendor lock-in. Customers have no control over vendor operations. The bottom row represent open source, granting consumers full control over their environments.
  • #15 AWS uses Lambda as a loss leader, making money on other services. Microsoft and Google are following suit My prediction is that once companies start shifting major workloads into serverless, prices will go up, but will still be less than renting servers. Operations are simpler because you have less control. Your vendor won’t care as much about your application as you do. You’re at the mercy of the vendor’s level of service. We need better tooling in order to handle the different deployment model and higher complexity of release management.
  • #18 AWS Lambda supports limited memory cache and limited amounts of disk writes. When a service is deactivated, those resources disappear
  • #20 Don’t even try to go serverless unless your teams are already doing the right things. Go slow in order to go fast. Temporarily slow down the development of new features in order to build the skills required become a high performance team.