As DevOps and operations engineers, serverless provides new and exciting opportunities but will lead to uncertainty in our roles. What do we do when the server goes away?
blog: https://www.serverlessops.io/blog/serverless-ops-what-do-we-do-when-the-server-goes-away
17. @TMCLAUGHBOS
TL;DR: A SERVERLESS SOLUTION IS ONE THAT
COSTS YOU NOTHING TO RUN IF NOBODY IS
USING IT (EXCLUDING DATA STORAGE)
Paul Johnston / @PaulDJohnston
SERVERLESS OPS
18. @TMCLAUGHBOSSERVERLESS OPS
CHARACTERISTICS OF SERVERLESS
▸ Little to no maintenance (no “servers” to maintain)
▸ Everything is a system
▸ Event driven
▸ Consumption (not capacity) priced
▸ You scale systems, the component pieces auto-scale
24. @TMCLAUGHBOSSERVERLESS OPS
WHAT EXISTING SKILLS ARE REALLY VALUABLE?
▸ Systems engineering
▸ Building
▸ Operating
▸ Understanding
▸ Scaling
▸ Debugging
▸ Knowing how things work
▸ AWS service limits, performance, etc.
▸ Tooling
▸ Understanding how things fail
27. @TMCLAUGHBOSSERVERLESS OPS
DEFINING THE OPS ROLE ON THE TEAM
▸ Developing system standards and best practices
▸ Knowing the build, deploy, and management tooling
▸ Reliability of systems
▸ Code review
▸ Performance tuning systems
▸ Evaluating costs of systems
30. @TMCLAUGHBOSSERVERLESS OPS
AWS RESOURCE PATTERNS: MESSAGE PASSING (SNS)
▸ Pros
▸ Extensible
▸ Guaranteed delivery
▸ Cons
▸ If subscriber fails… Oh well.
▸ Questions
▸ How many messages will be passed; how
many Lambda subscriber invocations?
31. @TMCLAUGHBOSSERVERLESS OPS
AWS RESOURCE PATTERNS: MESSAGE PASSING (SQS)
▸ Pros
▸ Message druability
▸ Cons
▸ SQS is not a Lambda event source
▸ Questions
▸ How do you trigger Lambda?
▸ What is your consumer profile?
34. @TMCLAUGHBOSSERVERLESS OPS
AWS RESOURCE PATTERNS: MESSAGE PASSING (LAMBDA FANOUT)
▸ Pros
▸ Fast!
▸ Cons
▸ Caller Lambda needs to handle errors
▸ Hidden service dependencies
▸ Questions
▸ How confident am I this is the best
idea?
46. @TMCLAUGHBOSSERVERLESS OPS
LAMBDA CODE BEST PRACTICES
import boto3
import logging
import os
_logger = logging.getLogger(__name__)
# Initialize objects outside of handler to make use of container reuse
s3_client = boto3.client('s3')
def handler(event, context):
# Do one thing and do it well.
'''Archive a a message to S3.'''
# The S3 bucket name is set by deployment
# framework referencing the S3 bucket resource it creates.
s3_bucket_name = os.environ.get('S3_BUCKET')
resp = s3_client.put_object(
Body=event.get(‘Records')[0].get('Sns').get('Message').encode(),
Bucket=s3_bucket_name,
Key=event.get('Records')[0].get('Sns').get('Subject')
)
return resp