Serverless Architectures on AWS, Second Edition

Book description

Design low-maintenance systems using pre-built cloud services! Bring down costs, automate time-consuming ops tasks, and scale on demand.

In Serverless Architectures on AWS, Second Edition you will learn:

  • First steps with serverless computing
  • The principles of serverless design
  • Important patterns and architectures
  • How successfully companies have implemented serverless
  • Real-world architectures and their tradeoffs
Serverless Architectures on AWS, Second Edition teaches you how to design serverless systems. You’ll discover the principles behind serverless architectures, and explore real-world case studies where companies used serverless architectures for their products. You won’t just master the technical essentials—the book contains extensive coverage of balancing tradeoffs and making essential technical decisions. This new edition has been fully updated with new chapters covering current best practice, example architectures, and full coverage of the latest changes to AWS.

About the Technology
Maintaining server hardware and software can cost a lot of time and money. Unlike traditional data center infrastructure, serverless architectures offload core tasks like data storage and hardware management to pre-built cloud services. Better yet, you can combine your own custom AWS Lambda functions with other serverless services to create features that automatically start and scale on demand, reduce hosting cost, and simplify maintenance.

About the Book
In Serverless Architectures with AWS, Second Edition you’ll learn how to design serverless systems using Lambda and other services on the AWS platform. You’ll explore event-driven computing and discover how others have used serverless designs successfully. This new edition offers real-world use cases and practical insights from several large-scale serverless systems. Chapters on innovative serverless design patterns and architectures will help you become a complete cloud professional.

What's Inside
  • First steps with serverless computing
  • The principles of serverless design
  • Important patterns and architectures
  • Real-world architectures and their tradeoffs


About the Reader
For server-side and full-stack software developers.

About the Authors
Peter Sbarski is VP of Education and Research at A Cloud Guru. Yan Cui is an independent AWS consultant and educator. Ajay Nair is one of the founding members of the AWS Lambda team.

Quotes
A comprehensive and practical review of the AWS serverless landscape.
- Eugene Serdiouk, Primex Family of Companies

Filled with indispensable advice you can use to take your AWS serverless architectures to the next level.
- Sal DiStefano, Travelers Insurance

An excellent book providing an overview and explanations of common serverless architectures. A must-read for every cloud developer.
- Mikołaj Graf, Cloudsail Digital Solutions

A clear path to exploring the many services offered by AWS.
- Giampiero Granatell, ManyDesigns

Table of contents

  1. praise for the first edition
  2. Serverless Architectures on AWS, Second Edition
  3. Copyright
  4. dedication
  5. contents
  6. front matter
    1. preface
    2. acknowledgments
    3. about this book
      1. About the code
      2. liveBook discussion forum
    4. about the authors
    5. about the cover illustration
  7. Part 1 First steps
  8. 1 Going serverless
    1. 1.1 What’s in a name?
    2. 1.2 Understanding serverless architectures
      1. 1.2.1 Service-oriented architecture and microservices
      2. 1.2.2 Implementing architecture the conventional way
      3. 1.2.3 Implementing architecture the serverless way
    3. 1.3 Making the call to go serverless
    4. 1.4 Serverless pros and cons
    5. 1.5 What’s new in this second edition?
    6. Summary
  9. 2 First steps to serverless
    1. 2.1 Building a video-encoding pipeline
      1. 2.1.1 A quick note on AWS costs
      2. 2.1.2 Using Amazon Web Services (AWS)
    2. 2.2 Preparing your system
      1. 2.2.1 Setting up your system
      2. 2.2.2 Working with Identity and Access Management (IAM)
      3. 2.2.3 Let’s make a bucket
      4. 2.2.4 Creating an IAM role
      5. 2.2.5 Using AWS Elemental MediaConvert
      6. 2.2.6 Using MediaConvert Role
    3. 2.3 Starting with the Serverless Framework
      1. 2.3.1 Setting up the Serverless Framework
      2. 2.3.2 Bringing Serverless Framework to The 24-Hour Video
      3. 2.3.3 Creating your first Lambda function
    4. 2.4 Testing in AWS
    5. 2.5 Looking at logs
    6. Summary
  10. 3 Architectures and patterns
    1. 3.1 Use cases
      1. 3.1.1 Backend compute
      2. 3.1.2 Internet of Things (IoT)
      3. 3.1.3 Data processing and manipulation
      4. 3.1.4 Real-time analytics
      5. 3.1.5 Legacy API proxy
      6. 3.1.6 Scheduled services
      7. 3.1.7 Bots and skills
      8. 3.1.8 Hybrids
    2. 3.2 Patterns
      1. 3.2.1 GraphQL
      2. 3.2.2 Command pattern
      3. 3.2.3 Messaging pattern
      4. 3.2.4 Priority queue pattern
      5. 3.2.5 Fan-out pattern
      6. 3.2.6 Compute as glue
      7. 3.2.7 Pipes and filters pattern
    3. Summary
  11. Part 2 Use cases
  12. 4 Yubl: Architecture highlights, lessons learned
    1. 4.1 The original Yubl architecture
      1. 4.1.1 Scalability problems
      2. 4.1.2 Performance problems
      3. 4.1.3 Long feature delivery cycles
      4. 4.1.4 Why serverless?
    2. 4.2 The new serverless Yubl architecture
      1. 4.2.1 Rearchitecting and rewriting
      2. 4.2.2 The new search API
    3. 4.3 Migrating to new microservices gracefully
    4. Summary
  13. 5 A Cloud Guru: Architecture highlights, lessons learned
    1. 5.1 The original architecture
      1. 5.1.1 The journey to 43 microservices
      2. 5.1.2 What is GraphQL
      3. 5.1.3 Moving to GraphQL
      4. 5.1.4 Service discovery
      5. 5.1.5 Security in the BFF world
    2. 5.2 Remnants of the legacy
    3. Summary
  14. 6 Yle: Architecture highlights, lessons learned
    1. 6.1 Ingesting events at scale with Fargate
      1. 6.1.1 Cost considerations
      2. 6.1.2 Performance considerations
    2. 6.2 Processing events in real-time
      1. 6.2.1 Kinesis Data Streams
      2. 6.2.2 SQS dead-letter queue (DLQ)
      3. 6.2.3 The Router Lambda function
      4. 6.2.4 Kinesis Data Firehose
      5. 6.2.5 Kinesis Data Analytics
      6. 6.2.6 Putting it altogether
    3. 6.3 Lessons learned
      1. 6.3.1 Know your service limits
      2. 6.3.2 Build with failure in mind
      3. 6.3.3 Batching is good for cost and efficiency
      4. 6.3.4 Cost estimation is tricky
    4. Summary
  15. Part 3 Practicum
  16. 7 Building a scheduling service for ad hoc tasks
    1. 7.1 Defining nonfunctional requirements
    2. 7.2 Cron job with EventBridge
      1. 7.2.1 Your scores
      2. 7.2.2 Our scores
      3. 7.2.3 Tweaking the solution
      4. 7.2.4 Final thoughts
    3. 7.3 DynamoDB TTL
      1. 7.3.1 Your scores
      2. 7.3.2 Our scores
      3. 7.3.3 Final thoughts
    4. 7.4 Step Functions
      1. 7.4.1 Your scores
      2. 7.4.2 Our scores
      3. 7.4.3 Tweaking the solution
      4. 7.4.4 Final thoughts
    5. 7.5 SQS
      1. 7.5.1 Your scores
      2. 7.5.2 Our scores
      3. 7.5.3 Final thoughts
    6. 7.6 Combining DynamoDB TTL with SQS
      1. 7.6.1 Your scores
      2. 7.6.2 Our scores
      3. 7.6.3 Final thoughts
    7. 7.7 Choosing the right solution for your application
    8. 7.8 The applications
      1. 7.8.1 Your weights
      2. 7.8.2 Our weights
      3. 7.8.3 Scoring the solutions for each application
    9. Summary
  17. 8 Architecting serverless parallel computing
    1. 8.1 Introduction to MapReduce
      1. 8.1.1 How to transcode a video
      2. 8.1.2 Architecture overview
    2. 8.2 Architecture deep dive
      1. 8.2.1 Maintaining state
      2. 8.2.2 Step Functions
    3. 8.3 An alternative architecture
    4. Summary
  18. 9 Code Developer University
    1. 9.1 Solution overview
      1. 9.1.1 Requirements listed
      2. 9.1.2 Solution architecture
    2. 9.2 The Code Scoring Service
      1. 9.2.1 Submissions Queue
      2. 9.2.2 Code Scoring Service summary
    3. 9.3 Student Profile Service
      1. 9.3.1 Update Student Scores function
    4. 9.4 Analytics Service
      1. 9.4.1 Kinesis Firehose
      2. 9.4.2 AWS Glue and Amazon Athena
      3. 9.4.3 QuickSight
    5. Summary
  19. Part 4 The future
  20. 10 Blackbelt Lambda
    1. 10.1 Where to optimize?
    2. 10.2 Before we get started
      1. 10.2.1 How a Lambda function handles requests
      2. 10.2.2 Latency: Cold vs. warm
      3. 10.2.3 Load generation on your function and application
      4. 10.2.4 Tracking performance and availability
    3. 10.3 Optimizing latency
      1. 10.3.1 Minimize deployment artifact size
      2. 10.3.2 Allocate sufficient resources to your execution environment
      3. 10.3.3 Optimize function logic
    4. 10.4 Concurrency
      1. 10.4.1 Correlation between requests, latency, and concurrency
      2. 10.4.2 Managing concurrency
    5. Summary
  21. 11 Emerging practices
    1. 11.1 Using multiple AWS accounts
      1. 11.1.1 Isolate security breaches
      2. 11.1.2 Eliminate contention for shared service limits
      3. 11.1.3 Better cost monitoring
      4. 11.1.4 Better autonomy for your teams
      5. 11.1.5 Infrastructure-as-code for AWS Organizations
    2. 11.2 Using temporary stacks
      1. 11.2.1 Common AWS account structure
      2. 11.2.2 Use temporary stacks for feature branches
      3. 11.2.3 Use temporary stacks for e2e tests
    3. 11.3 Avoid sensitive data in plain text in environment variables
      1. 11.3.1 Attackers can still get in
      2. 11.3.2 Handle sensitive data securely
    4. 11.4 Use EventBridge in event-driven architectures
      1. 11.4.1 Content-based filtering
      2. 11.4.2 Schema discovery
      3. 11.4.3 Archive and replay events
      4. 11.4.4 More targets
      5. 11.4.5 Topology
    5. Summary
  22. Appendix A. Services for your serverless architecture
    1. A.1 API Gateway
    2. A.2 Simple Notification Service (SNS)
    3. A.3 Simple Storage Service (S3)
    4. A.4 Simple Queue Service (SQS)
    5. A.5 Simple Email Service (SES)
    6. A.6 Relational Database Service (RDS)
    7. A.7 DynamoDB
    8. A.8 Algolia
    9. A.9 Media Services
    10. A.10 Kinesis Streams
    11. A.11 Athena
    12. A.12 AppSync
    13. A.13 Cognito
    14. A.14 Auth0
    15. A.15 Other services
  23. Appendix B. Setting up your cloud
    1. B.1 Security model and identity management
      1. B.1.1 Creating and managing IAM users
      2. B.1.2. Groups
      3. B.1.3 Roles
      4. B.1.4 Resources
      5. B.1.5 Permissions and policies
    2. B.2 Cost
      1. B.2.1 Creating billing alerts
      2. B.2.2 Monitoring and optimizing costs
      3. B.2.3 Using the Simple Monthly Calculator
      4. B.2.4 Calculating Lambda and API Gateway costs
  24. Appendix C. Deployment frameworks
    1. C.1 Serverless Framework
      1. C.1.1 Getting started
      2. C.1.2 Language support
      3. C.1.3 Invoking functions locally
      4. C.1.4 Plugins
    2. C.2 Serverless Application Model (SAM)
    3. C.3 Terraform
    4. C.4 Cloud Development Kit
      1. C.4.1 Where CDK shines
      2. C.4.2 CDK challenges
    5. C.5 Amplify
  25. index

Product information

  • Title: Serverless Architectures on AWS, Second Edition
  • Author(s): Ajay Nair, Peter Sbarski, Yan Cui
  • Release date: March 2022
  • Publisher(s): Manning Publications
  • ISBN: 9781617295423