๐”– Scriptorium
โœฆ   LIBER   โœฆ

๐Ÿ“

Serverless Design Patterns and Best Practices: Build, secure, and deploy enterprise ready serverless applications with AWS to improve developer productivity

โœ Scribed by Brian Zambrano


Publisher
Packt Publishing
Year
2018
Tongue
English
Leaves
254
Category
Library

โฌ‡  Acquire This Volume

No coin nor oath required. For personal study only.

โœฆ Synopsis


Get started with designing your serverless application using optimum design patterns and industry standard practices

Key Features

  • Learn the details of popular software patterns and how they are applied to serverless applications
  • Understand key concepts and components in serverless designs
  • Walk away with a thorough understanding of architecting serverless applications

Book Description

Serverless applications handle many problems that developers face when running systems and servers. The serverless pay-per-invocation model can also result in drastic cost savings, contributing to its popularity. While it's simple to create a basic serverless application, it's critical to structure your software correctly to ensure it continues to succeed as it grows. Serverless Design Patterns and Best Practices presents patterns that can be adapted to run in a serverless environment. You will learn how to develop applications that are scalable, fault tolerant, and well-tested.

The book begins with an introduction to the different design pattern categories available for serverless applications. You will learn the trade-offs between GraphQL and REST and how they fare regarding overall application design in a serverless ecosystem. The book will also show you how to migrate an existing API to a serverless backend using AWS API Gateway. You will learn how to build event-driven applications using queuing and streaming systems, such as AWS Simple Queuing Service (SQS) and AWS Kinesis. Patterns for data-intensive serverless application are also explained, including the lambda architecture and MapReduce.

This book will equip you with the knowledge and skills you need to develop scalable and resilient serverless applications confidently.

What you will learn

  • Comprehend the popular design patterns currently being used with serverless architectures
  • Understand the various design options and corresponding implementations for serverless web application APIs
  • Learn multiple patterns for data-intensive serverless systems and pipelines, including MapReduce and Lambda Architecture
  • Learn how to leverage hosted databases, queues, streams, storage services, and notification services
  • Understand error handling and system monitoring in a serverless architecture a serverless architecture
  • Learn how to set up a serverless application for continuous integration, continuous delivery, and continuous deployment

Who This Book Is For

If you're a software architect, engineer, or someone who wants to build serverless applications, which are non-trivial in complexity and scope, then this book is for you. Basic knowledge of programming and serverless computing concepts are assumed.

Table of Contents

  1. Introduction
  2. A Three-Tier Web Application Using REST
  3. A Three-Tier Web Application Pattern with GraphQL
  4. Integrating Legacy APIs with the Proxy Pattern
  5. Scaling Out with the Fan-Out Pattern
  6. Asynchronous Processing with the Messaging Pattern
  7. Data Processing Using the Lambda Pattern
  8. The MapReduce Pattern
  9. Deployment and CI/CD Patterns
  10. Error Handling and Best Practices

โœฆ Table of Contents


Cover
Title Page
Copyright and Credits
Dedication
Packt Upsell
Contributors
Table of Contents
Preface
Chapter 1: Introduction
What is serverless computing?
No servers to manage
Pay-per-invocation billing model
Ability to automatically scale with usage
Built-in availability and fault tolerance
Design patterns
When to use serverless
The sweet spot
Classes of serverless pattern
Three-tier web application patterns
ETL patterns
Big data patterns
Automation and deployment patterns
Serverless frameworks
Summary
Chapter 2: A Three-Tier Web Application Using REST
Serverless tooling
System architecture
Presentation layer
Logic layer
Data layer
Logic layer
Application code and function layout
Organization of the Lambda functions
Organization of the application code
Configuration with environment variables
Code structure
Function layout
Presentation layer
File storage with S3
CDN with CloudFront
Data layer
Writing our logic layer
Application entrypoint
Application logic
Wiring handler.py to Lambda via API Gateway
Deploying the REST API
Deploying the Postgres database
Setting up static assets
Viewing the deployed web application
Running tests
Iteration and deployment
Deploying the entire stack
Deploying the application code
Summary
Chapter 3: A Three-Tier Web Application Pattern with GraphQL
Introduction to GraphQL
System architecture
Logic layer
Organization of the Lambda functions
Organization of the application code
Function layout
Presentation layer
Writing the logic layer
Implementing the entry point
Implementing GraphQL queries
Implementing GraphQL mutations
Deployment
Viewing the deployed application
Iteration and deployment
Summary
Chapter 4: Integrating Legacy APIs with the Proxy Pattern
AWS API Gateway introduction
Simple proxy to a legacy API
Setting up a pass-through proxy
Deploying a pass-through proxy
Transforming responses from a modern API
Method execution flow
Setting up example
Setting up a new resource and method
Setting up Integration Request
Setting up Integration Response
Complex integration using a Lambda function
Implementing the application code
Setting up a new resource and method
Migration techniques
Staged migration
Migrating URLs
Summary
Chapter 5: Scaling Out with the Fan-Out Pattern
System architecture
Synchronous versus asynchronous invocation
Resizing images in parallel
Setting up the project
Setting up trigger and worker functions
Setting up permissions
Implementing the application code
Testing our code
Alternate Implementations
Using notifications with subscriptions
Using notifications with queues
Summary
Chapter 6: Asynchronous Processing with the Messaging Pattern
Basics of queuing systems
Choosing a queue service
Queues versus streams
Asynchronous processing of Twitter streams
System architecture
Data producer
Mimicking daemon processes with serverless functions
Data consumers
Viewing results
Alternate Implementations
Using the Fan-out and Messaging Patterns together
Using a queue as a rate-limiter
Using a dead-letter queue
Summary
Chapter 7: Data Processing Using the Lambda Pattern
Introducing the lambda architecture
Batch layer
Speed layer
Lambda serverless architecture
Streaming data producers
Data storage
Computation in the speed layer
Computation in the batch layer
Processing cryptocurrency prices using lambda architecture
System architecture
Data producer
Speed layer
Batch layer
AWS resources
Data producer
Speed layer
Batch layer
Results
Summary
Chapter 8: The MapReduce Pattern
Introduction to MapReduce
MapReduce example
Role of the mapper
Role of the reducer
MapReduce architecture
MapReduce serverless architecture
Processing Enron emails with serverless MapReduce
Driver function
Mapper implementation
Reducer implementation
Understanding the limitations of serverless MapReduce
Memory limits
Storage limits
Time limits
Exploring alternate implementations
AWS Athena
Using a data store for results
Using Elastic MapReduce
Summary
Chapter 9: Deployment and CI/CD Patterns
Introduction to CI/CD
CI
CD
Setting up unit tests
Code organization
Setting up unit tests
Setting up CI with CircleCI
Configuring CircleCI builds
Setting up environment variables
Setting up CD and deployments with CircleCI
Setting up Slack notifications
Setting up a CircleCI badge
Setting up deployments
Setting up AWS credentials
Setting up environment variables
Executing deployments
Summary
Chapter 10: Error Handling and Best Practices
Error tracking
Integrating Sentry for error tracking
Integrating Rollbar
Logging
Structuring log messages
Digesting structured logs
Cold starts
Keeping cloud functions warm
AWS Lambda functions and VPCs
Start-up times for different languages
Allocating more memory
Local development and testing
Local development
Learning about testing locally
Managing different environments
Securing sensitive configuration
Encrypting variables
Decrypting variables
Trimming AWS Lambda versions
Summary
Other Books You May Enjoy
Index


๐Ÿ“œ SIMILAR VOLUMES


Serverless Design Patterns and Best Prac
โœ Brian Zambrano ๐Ÿ“‚ Library ๐Ÿ“… 2018 ๐Ÿ› Packt Publishing ๐ŸŒ English

<p><b>Get started with designing your serverless application using optimum design patterns and industry standard practices</b></p><h4>Key Features</h4><ul><li>Learn the details of popular software patterns and how they are applied to serverless applications</li><li>Understand key concepts and compon

Programming AWS Lambda: Build and Deploy
โœ John Chapin, Mike Roberts ๐Ÿ“‚ Library ๐Ÿ“… 2020 ๐Ÿ› O'Reilly Media ๐ŸŒ English

<div><p>Serverless revolutionizes the way organizations build and deploy software. With this hands-on guide, Java engineers will learn how to use their experience in the new world of serverless computing. Youโ€™ll discover how this cloud computing execution model can drastically decrease the complexit

Programming AWS Lambda: Build and Deploy
โœ John Chapin, Mike Roberts ๐Ÿ“‚ Library ๐Ÿ“… 2020 ๐Ÿ› O'Reilly Media ๐ŸŒ English

<div><p>Serverless revolutionizes the way organizations build and deploy software. With this hands-on guide, Java engineers will learn how to use their experience in the new world of serverless computing. Youโ€™ll discover how this cloud computing execution model can drastically decrease the complexit

Programming AWS Lambda: Build and Deploy
โœ John Chapin; Mike Roberts ๐Ÿ“‚ Library ๐Ÿ“… 2020 ๐Ÿ› O'Reilly Media ๐ŸŒ English

Serverless revolutionizes the way organizations build and deploy software. With this hands-on guide, Java engineers will learn how to use their experience in the new world of serverless computing. Youโ€™ll discover how this cloud computing execution model can drastically decrease the complexity in dev