Architecting Cloud-Native Serverless Solutions

Book description

Get up and running with serverless workloads across AWS, Azure, GCP, Kubernetes, and virtual machines with real-life examples and best practices for design, development, and security of serverless applications Purchase of the print or Kindle book includes a free PDF eBook

Key Features

  • Learn with DIY projects and step-by-step instructions for different serverless technologies and vendors
  • Explore detailed sections on running serverless workloads across Kubernetes and virtual machines
  • Discover Cloudflare Serverless Solutions to modernize your web applications

Book Description

Serverless computing has emerged as a mainstream paradigm in both cloud and on-premises computing, with AWS Lambda playing a pivotal role in shaping the Function-as-a-Service (FaaS) landscape. However, with the explosion of serverless technologies and vendors, it has become increasingly challenging to comprehend the foundational services and their offerings.

Architecting Cloud Native Serverless Solutions lays a strong foundation for understanding the serverless landscape and technologies in a vendor-agnostic manner. You'll learn how to select the appropriate cloud vendors and technologies based on your specific needs. In addition, you'll dive deep into the serverless services across AWS, GCP, Azure, and Cloudflare followed by open source serverless tools such as Knative, OpenFaaS, and OpenWhisk, along with examples. You'll explore serverless solutions on Kubernetes that can be deployed on both cloud-hosted clusters and on-premises environments, with real-world use cases. Furthermore, you'll explore development frameworks, DevOps approaches, best practices, security considerations, and design principles associated with serverless computing.

By the end of this serverless book, you'll be well equipped to solve your business problems by using the appropriate serverless vendors and technologies to build efficient and cost-effective serverless systems independently.

What you will learn

  • Understand the serverless landscape and its potential
  • Build serverless solutions across AWS, Azure, and GCP
  • Develop and run serverless applications on Kubernetes
  • Implement open source FaaS with Knative, OpenFaaS, and OpenWhisk
  • Modernize web architecture with Cloudflare Serverless
  • Discover popular serverless frameworks and DevOps for serverless
  • Explore software design and serverless architecture patterns
  • Acquire an understanding of serverless development and security best practices

Who this book is for

This book is for DevOps, platform, cloud, site reliability engineers, or application developers looking to build serverless solutions. It’s a valuable reference for solution architects trying to modernize a legacy application or working on a greenfield project. It’s also helpful for anyone trying to solve business or operational problems without wanting to manage complicated technology infrastructure using serverless technologies. A basic understanding of cloud computing and some familiarity with at least one cloud vendor, Python programming language, and working with CLI will be helpful when reading this book.

Table of contents

  1. Architecting Cloud-Native Serverless Solutions
  2. Contributors
  3. About the author
  4. About the reviewers
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Download the color images
    6. Conventions used
    7. Get in touch
    8. Share Your Thoughts
    9. Download a free PDF copy of this book
  6. Part 1 – Serverless Essentials
  7. Chapter 1: Serverless Computing and Function as a Service
    1. Evolution of computing in the cloud
      1. Benefits of cloud computing
      2. CAPEX versus OPEX
      3. Virtualization, software-defined networking, and containers
      4. Types of cloud computing
      5. Cloud service delivery models – IaaS, PaaS, and SaaS
    2. Serverless and FaaS
      1. FaaS and BaaS
    3. Microservice architecture
      1. Containers, orchestration, and microservices
    4. Event-driven architecture
      1. Events
      2. Structure and components of an EDA
      3. Benefits of EDA
      4. Use cases
      5. Disadvantages
      6. Brokers
    5. FaaS in detail – self-hosted FaaS
      1. Cloud FaaS versus self-hosted FaaS
    6. API gateways and the rise of serverless API services
    7. The case for serverless
    8. Summary
  8. Chapter 2: Backend as a Service and Powerful Serverless Platforms
    1. BaaS
    2. Messaging systems
      1. Message queues
      2. Pub-sub
      3. Message brokers and clusters
      4. Messaging protocols
      5. Push versus pull
      6. Guarantees in messaging
      7. Dead-letter queues
      8. Cloud messaging
    3. Object stores
      1. Design and features
    4. Workflow automation
      1. Cloud workflows
    5. NoSQL platforms
      1. Cloud NoSQL platforms
    6. Edge computing
      1. PoP
      2. CDNs
      3. Serverless at the edge
    7. IoT clouds
    8. Stream processing
    9. Future of serverless
      1. Trends in serverless
    10. Summary
  9. Part 2 – Platforms and Solutions in Action
  10. Chapter 3: Serverless Solutions in AWS
    1. Technical requirements
    2. Useful AWS concepts to know and refresh yourself on
    3. CloudFormation primer
      1. Advanced constructs in the CloudFormation template language
    4. Lambda – FaaS in AWS
      1. How Lambda works
      2. Important concepts
      3. Important configurations
      4. Lambda programming model
      5. Edge computing
    5. API Gateway
      1. HTTP API
      2. WebSocket API
      3. REST API
      4. Private REST API
      5. API Gateway security
    6. S3 – object store
      1. S3 – components
      2. S3 and serverless
    7. DynamoDB
      1. Fundamentals
      2. Primary keys and indexes
      3. DynamoDB and serverless
    8. SQS
      1. Types of queues
      2. Features
      3. SQS and other AWS messaging products
      4. SQS and serverless
    9. SNS
      1. SNS and serverless
    10. AWS EventBridge
    11. Step Functions
      1. AWS service integrations
      2. Triggering workflows
    12. Doing by example – lightweight alert manager
      1. High-level solution design
    13. Summary
  11. Chapter 4: Serverless Solutions in Azure
    1. Technical requirements
    2. Azure fundamentals
    3. Azure Functions
      1. Function apps and creating your first function
      2. Developing and deploying a Python function
    4. Azure Blob Storage
      1. Creating and managing blob storage
      2. Blob Storage and Azure Functions
    5. Azure Cosmos DB
      1. Elements of Cosmos DB
      2. Data partitioning and partition keys
      3. Creating and managing Cosmos DB
      4. Cosmos DB and Azure Functions
    6. Azure event and messaging services
      1. Azure Event Grid
      2. Azure Event Hubs
      3. Azure Service Bus
      4. Azure Event Grid with Azure Functions
    7. Azure Logic Apps
      1. Key concepts of Logic Apps
      2. Creating a Logic Apps workflow
    8. Project – image resizing with Azure Functions
    9. Summary
  12. Chapter 5: Serverless Solutions in GCP
    1. Prerequisites and GCP basics
    2. Cloud Functions
      1. Core features
      2. The pricing model
      3. Operating system (OS) and runtime support
      4. Function triggers
      5. Function's structure and dependency management
      6. Creating your first function
    3. GCP Pub/Sub
      1. The different types of Pub/Sub flavors
      2. Core concepts
    4. GCS
    5. Cloud Workflows
      1. Common use cases
      2. Writing a workflow
      3. A sample workflow
    6. More serverless services
      1. Cloud Run
      2. Eventarc
      3. Cloud Scheduler
      4. Databases and data stores
    7. The project – nameplate scanning and traffic notice
    8. Summary
  13. Chapter 6: Serverless Cloudflare
    1. Cloudflare service portfolio
    2. Cloudflare Workers – the workhorse at the edge
      1. Service Workers – the namesake and power behind Cloudflare Workers
      2. Cloudflare Workers – functionality and features
      3. Other languages supported
    3. Cloudflare Workers KV
    4. Cloudflare Pages
      1. JAMStack
    5. Cloudflare Pages and JAMStack
    6. Newest Cloudflare serverless offerings
      1. Cloudflare R2 storage
      2. Durable objects
    7. Workers and KV – learning by example
      1. Setting up the development environment with Wrangler
      2. Creating your first worker
      3. Deploying your worker
      4. Workers KV store
    8. Project
      1. Implementation
    9. More vendors in edge computing and JAMStack
    10. Summary
  14. Chapter 7: Kubernetes, Knative and OpenFaaS
    1. Containerization and Docker fundamentals
      1. Docker images
    2. Container orchestration and Kubernetes
      1. Kubernetes architecture and components
      2. Kubernetes how-to with minikube
    3. Knative
      1. Knative components
      2. Knative Eventing
      3. Knative and service meshes
      4. Knative installation and setup
    4. OpenFaaS
      1. OpenFaaS architecture
      2. Function runtime and watchdog
      3. Asynchronous functions
      4. FaaSD
    5. OpenFaaS installation and setup
    6. Example project – implementing a GitHub webhook with a Telegram notification
      1. High-level solution
      2. Design and architecture
      3. Application code and infrastructure automation
    7. Summary
  15. Chapter 8: Self-Hosted FaaS with Apache OpenWhisk
    1. OpenWhisk – concepts and features
      1. Actions and action chains
      2. Architecture
    2. Creating and managing actions and entities
      1. Creating your first action
      2. Triggers and rules
      3. Packages
      4. Feeds
      5. Web actions
    3. Administration and deployment
    4. Project – IoT and event processing with IBM Cloud functions
    5. Summary
  16. Part 3 – Design, Build, and Operate Serverless
  17. Chapter 9: Implementing DevOps Practices for Serverless
    1. General SDLC practices for serverless
    2. The serverless framework
      1. Getting started with the serverless framework
      2. Framework concepts
      3. Events
      4. Updating and deploying the serverless service
      5. Other features of serverless in a nutshell
    3. Zappa – the serverless framework for Python
      1. Creating and testing the IP information API in Flask
    4. Infrastructure as code with Terraform
      1. Terraform concepts
      2. Terraform workflow
      3. Getting started with Terraform
    5. Infrastructure as code with the Pulumi SDK
      1. Getting started with Pulumi
    6. Testing serverless
      1. Testing in serverless – challenges and approaches
      2. Local manual tests
      3. Unit testing for serverless
      4. Integration tests
    7. CI/CD pipelines for serverless
    8. Summary
  18. Chapter 10: Serverless Security, Observability, and Best Practices
    1. Security vulnerabilities and mitigation guidelines
      1. The OWASP Serverless top 10
      2. The CSA top 12 serverless vulnerabilities
      3. Event injection
      4. Broken authentication
      5. Insecure configurations
      6. Insecure secrets and credentials storage
      7. Broken access control
      8. Inadequate function monitoring and logging
      9. Obsolete serverless resources
      10. Insecure dependencies
      11. Improper exception handling and verbose error messages
      12. Cross-execution data persistence
      13. Insecure deserialization
      14. Other common vulnerabilities – XXE and XSS
    2. Serverless observability
      1. The challenges of serverless observability
      2. Serverless observability in AWS
      3. Serverless observability in GCP
      4. Serverless observability in Azure
    3. Serverless best practices
    4. Summary
  19. Chapter 11: Architectural and Design Patterns for Serverless
    1. Design patterns primer
      1. Creational design patterns
      2. Structural design patterns
      3. Behavioral design patterns
    2. Architectural patterns
    3. Cloud architecture patterns – vendor frameworks and best practices
    4. Three-tier web architecture with AWS
    5. Event-driven architecture with Azure
    6. Business process management with GCP
    7. More serverless designs
      1. The webhook pattern
      2. Document processing
      3. Video processing with the fanout pattern
      4. Serverless job scheduling
    8. Serverless applications in the Well-Architected Framework
    9. Summary
  20. Index
    1. Why subscribe?
  21. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Share Your Thoughts
    3. Download a free PDF copy of this book

Product information

  • Title: Architecting Cloud-Native Serverless Solutions
  • Author(s): Safeer CM
  • Release date: June 2023
  • Publisher(s): Packt Publishing
  • ISBN: 9781803230085