100% found this document useful (1 vote)
14 views

Serverless Beyond the Buzzword: A Strategic Approach to Modern Cloud Management 1st Edition Thomas Smart pdf download

The document promotes various ebooks and textbooks available for download at ebookmass.com, including titles on serverless architecture, solutions architecture, and strategic management. It highlights the second edition of 'Serverless Beyond the Buzzword' by Thomas Smart, which provides insights into serverless technology for readers of different technical levels. The book aims to help organizations understand the strategic implications of adopting serverless architecture and improve their cloud management practices.

Uploaded by

jedzkesley
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
14 views

Serverless Beyond the Buzzword: A Strategic Approach to Modern Cloud Management 1st Edition Thomas Smart pdf download

The document promotes various ebooks and textbooks available for download at ebookmass.com, including titles on serverless architecture, solutions architecture, and strategic management. It highlights the second edition of 'Serverless Beyond the Buzzword' by Thomas Smart, which provides insights into serverless technology for readers of different technical levels. The book aims to help organizations understand the strategic implications of adopting serverless architecture and improve their cloud management practices.

Uploaded by

jedzkesley
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 78

Download the full version and explore a variety of ebooks

or textbooks at https://ebookmass.com

Serverless Beyond the Buzzword: A Strategic


Approach to Modern Cloud Management 1st Edition
Thomas Smart

_____ Follow the link below to get your download now _____

https://ebookmass.com/product/serverless-beyond-the-
buzzword-a-strategic-approach-to-modern-cloud-
management-1st-edition-thomas-smart/

Access ebookmass.com now to download high-quality


ebooks or textbooks
We have selected some products that you may be interested in
Click the link to download now or visit ebookmass.com
for more options!.

Solutions Architecture: A Modern Approach to Cloud and


Digital Systems Delivery 1st Edition Wasim Rajput

https://ebookmass.com/product/solutions-architecture-a-modern-
approach-to-cloud-and-digital-systems-delivery-1st-edition-wasim-
rajput/

Toyota Supply Chain Management: A Strategic Approach to


Toyota's Renowned System 1st Edition Iyer

https://ebookmass.com/product/toyota-supply-chain-management-a-
strategic-approach-to-toyotas-renowned-system-1st-edition-iyer/

Marketing Management: A Strategic Decision-Making Approach


8th Edition

https://ebookmass.com/product/marketing-management-a-strategic-
decision-making-approach-8th-edition/

eTextbook 978-0132720823 Retail Management: A Strategic


Approach

https://ebookmass.com/product/etextbook-978-0132720823-retail-
management-a-strategic-approach/
Solutions Architecture: A Modern Approach to Cloud and
Digital Systems Delivery Wasim Rajput

https://ebookmass.com/product/solutions-architecture-a-modern-
approach-to-cloud-and-digital-systems-delivery-wasim-rajput/

Strategic Management: A Competitive Advantage Approach,


Concepts 16th Edition, (Ebook PDF)

https://ebookmass.com/product/strategic-management-a-competitive-
advantage-approach-concepts-16th-edition-ebook-pdf/

eTextbook 978-0133457100 Strategic Compensation: A Human


Resource Management Approach

https://ebookmass.com/product/etextbook-978-0133457100-strategic-
compensation-a-human-resource-management-approach/

eTextbook 978-0134153971 Strategic Management: A


Competitive Advantage Approach Concepts (16th Edition)

https://ebookmass.com/product/etextbook-978-0134153971-strategic-
management-a-competitive-advantage-approach-concepts-16th-edition/

Strategic Management : A Competitive Advantage Approach —


Concepts and Cases, 17th Global Edition Fred R. David

https://ebookmass.com/product/strategic-management-a-competitive-
advantage-approach-concepts-and-cases-17th-global-edition-fred-r-
david/
Thomas Smart

Serverless Beyond the Buzzword


A Strategic Approach to Modern Cloud Management
2nd ed.
Thomas Smart
Singapore, Singapore

ISBN 978-1-4842-8760-6 e-ISBN 978-1-4842-8761-3


https://doi.org/10.1007/978-1-4842-8761-3

1st edition: © 0

© Thomas Smart 2023

This work is subject to copyright. All rights are solely and exclusively
licensed by the Publisher, whether the whole or part of the material is
concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in
any other physical way, and transmission or information storage and
retrieval, electronic adaptation, computer software, or by similar or
dissimilar methodology now known or hereafter developed.

The use of general descriptive names, registered names, trademarks,


service marks, etc. in this publication does not imply, even in the
absence of a specific statement, that such names are exempt from the
relevant protective laws and regulations and therefore free for general
use.

The publisher, the authors, and the editors are safe to assume that the
advice and information in this book are believed to be true and accurate
at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, expressed or implied, with respect to the
material contained herein or for any errors or omissions that may have
been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.

This Apress imprint is published by the registered company APress


Media, LLC, part of Springer Nature.
The registered company address is: 1 New York Plaza, New York, NY
10004, U.S.A.
The Consultant’s Purpose
What is a consultant, what is our purpose – why do we exist?
We help organizations in many ways, sometimes even when they resist.
Some will say they love solving problems, but that isn’t a purpose – it’s a
skill.
Like engineering, design, or writing, it just takes experience and will.
Our real purpose is to deliver truths; with honesty they are quoted.
Harsh as they often are, they should never be sugarcoated.
We present them diplomatically as needed, with all the proof and every
fact.
That is the commitment to our clients, our guarantee, our pact.
To fulfil that purpose, we never shy away from questioning nor flinch at
digging deep.
We challenge the status quo and overcome distractions; our focus we
must keep.
Pretty PowerPoints are but a medium, not the goal that we pursue.
Our integrity demands each project is given the attention it is due.
While we provide recommendations for our clients to decide,
Sometimes they choose wrongly, but we take that in our stride.
We mustn’t take it personally, lest our mental health be assailed.
To the right clients, the best ones, as personal advisors, we will be hailed.
That is our calling: for our harsh truths to be honest and by our clients to
be trusted.
The experience, capabilities, and medium are but a means when all is
done and dusted.
Thomas Smart, 2022
Prologue
Technology is best when it brings people together.

—Matt Mullenweg, Social Media Entrepreneur


Who Is This Book For?
This book is for anyone interested in Serverless, regardless of their
technical level. I share strategic insights for entrepreneurs and
executives, planning and team insights for project managers, and
technical insights for architects and team leads. The intent is to provide
a deep understanding of Serverless architecture and how it could
impact your business and your projects.
This book is not intended to be a Serverless development guide.
Because of the sheer number of programming languages and the rapid
pace of change in this area, the Internet is the best source of
information for finding specific code examples. This book will provide
an essential understanding of Serverless, best practices, security
guidelines, and other topics that will help an organization productively
deliver Serverless applications.
If any of the following scenarios sound familiar, then this is the right
book for you:
You are an executive or manager, and your technical people have
been talking about Serverless for some time. You are interested but
want to make sure it’s the right strategic choice for your business or
project.
You are a project manager or team lead tasked with digital
transformation and are looking for a technology strategy that will
give you an unfair advantage.
You are an entrepreneur or innovation manager looking for a way to
rapidly prototype ideas using a cost-effective approach.
You are a software architect or developer who wants to find out more
about the broader implications of Serverless, for example, to gain a
deeper understanding or to pitch it to your stakeholders.

Technical Levels Used in This Book


As you may have noticed, each section header has a little icon. This icon
indicates the technical level of that section, helping you to quickly
identify if it’s suitable for your own technical level and interest.
The briefcase icon indicates a section that is not technical and
is appropriate for readers who want a better understanding of the
business and strategic implications of using Serverless.
The clipboard icon indicates a section that may contain some
technical references relevant to project managers and product owners
who want a deeper understanding of the technology so they can
improve project planning and communication with developers.
The gear icon indicates a section containing technical
concepts. Some architecture or coding experience is required to fully
understand these sections, which are of most value to solution
architects, team leads, and developers.

What Will You Learn?


This book will help you understand what colleagues or friends mean
when they are talking about Serverless.
I want to share the facts about and background of Serverless to help
you decide for yourself if it is a technology fad or a technology
evolution. You’ll be able to determine if it’s relevant to you, your career,
and your organization and what impact it might have if you were to
start using it in your projects.
About a quarter of this book addresses “why Serverless?”. This
includes some history and discusses how the cloud has evolved its
Serverless capabilities.
Another quarter explores the what of Serverless, providing a deeper
understanding of the technology, how it can be used, and the challenges
and benefits it can bring to an organization.
The remaining half addresses the how. Where do you go from here?
How to find the right people and how to enable productive delivery of
Serverless applications in your organization?
Chapter 1 introduces Serverless and its challenges and benefits. It
will be helpful to anyone looking to understand on a high level what
Serverless is and its potential relevance to their business.
Chapters 2–5 delve deeper into the strategic impact of Serverless on
cloud management, finance, security, and people within an
organization. It answers questions such as
How can we enable application teams to benefit from Serverless in
an enterprise while remaining compliant?
How are business models, estimates, and budgets evolving with
Serverless?
How does Serverless impact security and GDPR or similar privacy
regulations?
Where do I find and how do I assess the right talent for a Serverless
team?
Chapters 6–8 get a bit more technical. We explore DevOps concepts
and tooling that can improve the developer experience and automate
deployment processes. We will also look at some cloud capabilities
such as logging and testing that are essential for Serverless.
Lastly, Chapters 9 and 10 are the most technical, looking at
architectural best practices and several examples of Serverless
components and entire applications.
Glossary
Before we start, here are some words used frequently throughout the
book, along with definitions, for those not entirely familiar with cloud
jargon.

Provider, cloud provider, cloud service provider, CSP


A business that makes cloud services available publicly. The top three
businesses by market share are Amazon Web Services, Google Cloud,
and Microsoft Azure.

Service
Another word for a feature, tool, or software product in the cloud. For
example, Amazon S3 is a storage service. Services are typically owned
by the cloud provider and offered through their platform where they
can be used by application and cloud teams.

Serviceful
Often an aspect of Serverless architecture, this means to prefer cloud
services over writing custom code. For example, instead of writing code
to validate user input, we can use a feature of the API Gateway service
called models. This reduces the amount of custom work that needs to be
created and maintained and avoids reinventing the wheel.

Solution
We commonly see an application as an answer to a given problem, so
we also call applications solutions. In the context of this book, it will
usually refer to a cloud-based application.

Architecture
This does not refer to buildings in our industry, although it has some
similarities conceptually. Architecture refers to the structure and
design of a solution at different levels:
We call it software architecture when talking about the application
code.
We call the entire application, including the design and configuration
of the cloud services, solution architecture.
An even higher level, including integration with corporate networks,
is called enterprise architecture.

Component
A component typically refers to a piece of a larger Serverless
application. It could be a configuration for a single cloud service, a
microservice, or an entire user interface. Components are generally
considered independent, and they can be shared and reused between
different applications.

Solution architect
The title of a person typically responsible for designing the
infrastructure of a cloud-based application. Similar to the levels in
architecture, there are also software architects – who focus more on the
application code – and enterprise architects – who focus on broader IT
strategies and integrations within the organization.

Instance
This is another word for servers in the cloud. They are not physical
servers but a software-defined section of a physical server. In the cloud,
physical servers are typically split into multiple sections or virtual
servers to improve utilization. We will explore this in more detail later
in the book.

Provision
This means configuring and activating a particular cloud service for use
in your solution. For example, when we launch a server in the cloud, the
industry terminology would be to provision an instance.

Parameters, variables, configurations, settings, options


These all effectively mean the same thing and can usually be used
interchangeably. These are used to make services behave in the way
required for the solution. For example, the size of an instance can be
configured with the instance type parameter.

Lambda function vs. Lambda microservice


Lambda is an AWS service for hosting microservices, but the official
AWS term is Lambda functions or even just Lambdas. The terms are
interchangeable but can cause confusion as microservices can also be
deployed on containers. This book will specifically call those containers
or container microservices to avoid confusion, and the term
microservice on its own will always refer to a Lambda function.

Code base
The code base can include scripts, developed code, unit tests, and
infrastructure configuration templates used for an application. With
monolithic applications, due to dependencies and how monolithic
applications are made, the code base will typically include everything
for the entire application. With modern cloud architecture, the entire
application could be in a single code base, or each component of the
application could be separated in its own code base – depending on
how the team structures the project.

Amazon Web Services (AWS)


Most of my experience is on Amazon Web Services, so the cloud
services and examples I mention in this book are often for their
platform unless otherwise specified. The more strategic aspects of the
book and the high-level concepts described can often be applied to all
major cloud providers.
Amazon is the largest e-retailer in the world, as well as the largest
cloud provider. As cloud services seem to generate more revenue, some
people liken it to an IT firm with a gift shop. Joking aside, Amazon’s
hands-on experience through the e-retail business is one of the reasons
that its cloud services are such a success. They have been tried and
tested in Amazon’s production environments with massive volumes of
users and data. 2021 figures reveal that when a service needs to be
hosted in the cloud, there is a 33% chance it will be hosted on AWS.
The history of Serverless (discussed in Chapter 1) provides some
insights into how AWS started the Serverless evolution. They have been
my preferred cloud partner for several years, in part due to their
strength in Serverless.
In 2019, in recognition of my Serverless activities, they invited me
to join their exclusive AWS Ambassador Partner Program as one of the
few independent consultants. I joined Sourced in 2020, where my
target audience changed to regulated enterprises. I continued
promoting, training, and talking about Serverless and, soon after,
rejoined the AWS Ambassador Partner Program as a Sourced employee.

Second Edition
The first edition was published in 2020, and, with the pace of change
being as brutal and unforgiving as it is, I started making notes for the
second edition within a month of finishing the manuscript. The overall
structure has remained the same. We start less technical, more focused
on strategy, and work our way up to technical walk-throughs of
complex Serverless architectures. However, some of the earlier
chapters do have more technical sections where it didn’t make sense to
split the information.
Almost every chapter has new content added. I go into far more
detail on all topics and have added several new topics and entire
chapters. There are also considerably more visuals in this edition to
help explain some of the more complex concepts.
More attention is paid to the bigger picture strategy of transforming
a large organization to be able to deliver Serverless applications
productively. This often requires changes to team organizational
structures, KPIs, and cloud security and management processes.
One thing that sets this book apart from others in the market is that
much of it is written with the limits, challenges, and opportunities of a
large enterprise in mind. Often, these are significantly different from
those faced by startups and tech companies who find it easier to adopt
and experiment with new technologies. Large enterprises, especially
regulated ones, need more assurance that a particular cloud strategy is
secure, auditable, and resilient before even considering it. This is one of
the reasons that it’s only now, 6 years after Lambda was launched, that
large enterprises are starting to look at Serverless as a potential cloud
strategy.
Any source code or other supplementary material referenced by the
author in this book is available to readers on the Github repository:
https://github.com/Apress/Serverless-Beyond-the-Buzzword. For
more detailed information, please visit
http://www.apress.com/source-code.
Acknowledgments
A big thank you to my wife, Meiting, whose tolerance and patience with
me knows almost no bounds, and to my boys, Blaze, Dash, and Max,
who inspire me daily to share my knowledge with the next generation.
Many thanks to my editor, Mary Whitehouse, who helped make the
book considerably more readable; Won Jenn Lee, who implemented
some of the case studies in the final chapter; and Eden Fall-Bailey, for
being an amazing help in researching, assembling, and editing the
content for this second edition.
I want to thank KangZheng Li, a Sourced colleague who was
instrumental in making the Serverless Training Program a reality. That
program was largely based on the first edition of this book, and
working with KangZheng to create the program led to many new
insights and knowledge gained that have made their way into this
edition of the book.
Table of Contents
Chapter 1:​Serverless Basics
What Is Serverless Architecture?​
Pay for What You Use
Server vs.​Fully Managed vs.​Serverless
What Serverless Is Not
Microservices
Independence
Reusability
Security
Separation of Front End (User Interface) and Back End
(Processing)
Serverless Example
History of Serverless
Virtual Servers
The Cloud
Software
Modern Containers
Serverless
Types of Projects
Key Challenges
Vendor Lock-In
Finding Talent
Less Control
Service-Level Agreements (SLAs)
Latency
(Almost) Unlimited Scaling
Calculating Cloud Operational Costs
Cloud Management
Service Limits
Key Benefits
Near-Zero Wastage
Reduced Scope of Responsibility and Effort
Accurate Operational Cost Estimation and Tracking
Highly Reusable Microservices
Better Access Security
Agility and DevOps Are Easier to Implement
Easier to Manage Time, Budgets, and Teams
Highly Scalable, Fast Scaling
Significantly Lower Maintenance Cost
Common Objections
Less Stable
Less Observable
A Lot to Configure
Architectural Complexity
Public Case Studies
NorthOne Bank
Liberty Mutual
Coca-Cola
Chapter 2:​Strategy
Introduction
Traditional Organization Structure vs.​Serverless
Cloud Center of Excellence (CCoE)
Platform Architecture and Operations Roles
From a Traditional Org Structure to a CCoE
Cloud Controls as Compliance Guardrails
Directive Controls
Preventive Controls
Detective Controls
Corrective Controls
Which Controls to Prioritize?​
Supporting Tools
Self-Service Portal
Shared Central Library
Developer Tools
Serverless Adoption:​Current State
Serverless Adoption:​Desired State
Serverless Adoption Framework:​Business Perspective
Serverless Adoption Framework:​People Perspective
Serverless Adoption Framework:​Governance Perspective
Serverless Adoption Framework:​Platform Perspective
Serverless Adoption Framework:​Security Perspective
Serverless Adoption Framework:​Operations Perspective
Serverless Adoption:​Gap Analysis
Application Suitability for Serverless
Serverless Application Risk Assessment
Assessment Domains
Assessment Guide
Event Storming
Common Challenges
Event Storming Basics
Event Storming Steps
Architecture Design
Final Notes
Public Case Studies
Toyota
Netflix
T-Mobile
Chapter 3:​Finances
Total Cost of Ownership (TCO)
The Value of Paying for Utilization
Scaling User Numbers
Per-User Cost
The Cost to Develop Serverless
The Research
The Project
Comparing the Estimates
Development Time
The Cost of Migrating Applications
The Cost of Maintenance and Operations
Estimating the Cloud Operational Costs
Collecting the Input Data for an Estimate
Business Parameters
Technical Parameters
Pricing Parameters
Service Pricing
Request Fees
Data Transfer
Other Costs
Architecture Examples
Calculating the Estimate
Calculator Tab
Processing Tab
AWS Service Pricing Tab
Pricing API
Cost Management
AWS Cost Management Services
Custom Tracking
Resource Tags
Regional Differences
Cost Optimization
S3 Cost Optimization
S3 Lifecycle Policies
Lambda Cost Optimization
AWS Cost Reductions
AWS Credits
Consolidated Billing for AWS Organizations
Chapter 4:​Security
Shared Responsibility
Examples of Shared Responsibility
Serverless Security
Principle of Least Privilege
PoLP Applied to Teams
Static vs.​Dynamic Privileges
PoLP Applied to Servers
PoLP for Serverless
Identity and Access Management (IAM)
Wildcards
IAM Tips
AWS Security Services
AWS Organizations
Single Sign-On (SSO)
AWS Config (Detective Controls)
Amazon GuardDuty
AWS X-Ray
AWS Shield
AWS Resource Access Manager or RAM
Firewall Manager
Amazon Cognito
AWS Directory Service
Amazon Detective
CloudHSM
AWS Certificate Manager
ECR Image Scan
CodeGuru
API Gateway
API Authentication and Authorization
Security Best Practices for API Gateway
Serverless S3 Antivirus Scanning
S3 Policies and ACLs
Securing Containers by Decoupling
Security Is Hard!
User Input Validation
API Gateway Model Schemas
Storing Credentials
$45,000 Bill for Losing Credentials
AWS Public Scanning
Systems Manager Parameter Store
Secrets Manager
Encryption
Encryption of Data at Rest
Encryption of Data in Transit
Public/​Private Key Encryption
Envelope Encryption
Encryption Exceptions in AWS Cloud
Protecting Data
CloudFront
Other S3 Features
S3 Monitoring
On-Demand Data Redaction
Securing Databases
Tokenization
Database Monitoring
Privacy and GDPR
What Is Privacy in a Technology Context, and Why Is It
Important?​
Complying with GDPR
Cloud and GDPR
Why Serverless for GDPR Compliance
Implementing for Compliance
Security Monitoring with ElectricEye
Key Points
Deployment and Setup
Chapter 5:​People
Evolving Teams
Build, Buy, or Borrow
Building a Team
Buying a Team
Interviews
Serverless Roles:​Solution Architect
Serverless Roles:​Cloud Security Engineer
Serverless Roles:​Deployment Automation Engineer
Serverless Roles:​Full-Stack Developer
Serverless Roles:​Database Engineer
Serverless Roles:​Project Manager
Serverless Training
Foundational Certification
Associate Certification
Professional Certification
Specialty Certification
Online Resources to Learn About Serverless
Serverless Team Structure
Serverless Careers
Key Performance Indicators (KPIs)
Borrowing a Team:​Working with Serverless Vendors
Experienced Serverless Vendors
Capable Vendor
The Three Pillars
General Best Practices
Vetting Serverless Capabilities
Chapter 6:​DevOps and Tooling
What Is DevOps?​
Principles and Practices of DevOps
Problems Solved by DevOps
Evolution of DevOps
Infrastructure-as-Code
Key Values of IaC
IaC Tools and Frameworks
AWS CloudFormation
Declarative vs.​Imperative
CloudFormation Example
CloudFormation Challenges
AWS CloudFormation Planning
Nested Stacks
Modules
Macros
Terraform
Challenges
AWS Serverless Application Model (SAM)
Serverless Application Repository
Challenges
AWS Amplify
AWS Cloud Development Kit (CDK)
Differences Between Amplify and CDK
CDK Technical Considerations
Local Dev and Testing
Existing CloudFormation Projects
Extending CDK
CDK DevOps
CDK Tips
Serverless Framework
Challenges
Code Repositories
Mono-repo
Multi-repo
GIT Submodules
Common Challenges
Lambda Layers
Developer Tooling
AWS Command-Line Interface (CLI)
LocalStack
Integrated Development Environment (IDE)
Other Tools
Code Quality Assurance
AWS Well-Architected Framework
AWS Trusted Advisor
AWS CodeGuru
Amazon CodeWhisperer Preview
Chapter 7:​Data
Data Is a Valuable Asset
Database Selection
Event Sourcing
Data Tenancy
Relational Database Service (RDS)
RDS Proxy
Amazon Aurora
Aurora Serverless
Aurora Serverless Data API
Redshift Serverless
DynamoDB
Billing Models
Transactional Operations
Comparison of DynamoDB Billing Models
Keys and Queries
Adaptive Capacity
DynamoDB Indexes
Query Examples
Other DynamoDB Features
AWS DynamoDB Checklist
NoSQL
Serverless NoSQL Databases
Amazon Keyspaces
Amazon Timestream
Amazon Quantum Ledger Database
Managed NoSQL Databases
DocumentDB
Amazon Neptune
NoSQL Databases Comparison
In-Memory Databases
ElastiCache
MemoryDB
AppSync
Under- and Over-fetching
Simple Storage Solution (S3)
S3 Events
Signed URLs
Multipart Upload
S3 Object Lambda
Avoiding Size Limit Issues in Lambda
Elastic File System (EFS)
Chapter 8:​Logging and Testing
Logging
Reactive Logging
Proactive Logging
General Considerations
Logging Format and Content
Service Logs in the Cloud
Cloud Logging Services
CloudWatch
CloudWatch Metrics
CloudWatch Logs
CloudWatch Alarms
CloudWatch Metric Filter
Exporting Logs to S3
CloudWatch Subscriptions
Managed Services for Proactive Logging
Error Monitoring
CloudWatch Events
Performance Optimization
Lambda Rightsizing
Lambda Insights
X-Ray
Cost Tracking
Lambda Cost Tracking
S3 Cost Tracking
Tracking the Cost of Other Services
Security Monitoring
Macie
GuardDuty
CloudWatch Subscription
Logging Best Practices
Centralized Logging
Error Messages
Sensitive Data in Logs
Testing
Testing Challenges in Serverless
Testing Environments
Creating and Maintaining Tests
Local Testing
Integrated Managed Services
Debugging Failed Tests
What to Test
Types of Tests
Unit Tests
Integration Tests
End-to-End Tests
User Simulation
Contract Testing
Pact
Comparing the Types of Testing
Contract Testing with Pact for Serverless
Asynchronous Testing
Risk Assessment for Testing
Test Pyramid vs.​Test Honeycomb
Deployment Pipeline
AWS Testing Services
Serverless Application Model (SAM)
LocalStack
CodeBuild
CloudWatch Synthetics
CloudWatch Real User Monitoring (RUM)
CloudWatch Evidently
Fault Injection Simulator (FIS)
Device Farm
Chapter 9:​Architecture
Challenges and Mitigations
Vendor Lock-In
Service-Level Agreements (SLAs)
Stateless Microservices
Latency
Fully Managed Scaling
Maturity of the Technology
Service Limits
Learning Curve
Database Strategy
Other Challenges
AWS:​Microservices and APIs
Lambda Scalability and Cold Start
Reserved Concurrency
Layers
To VPC or Not to VPC?​
Lambda DevOps
Lambda Environment Variables
Lambda and CloudWatch
What Metrics to Monitor for CloudWatch and Why?​
Lambda and API Gateway
WebSockets
Proxy vs.​Non-proxy Integration
Request Transformation
Dynamic HTML
Error Reporting
Other Integrations
Lambda and Application Load Balancer
Design Patterns
When Not to Use Strict Microservice Architecture
Microservice Example Architectures
Basic CRUD API
Triggered or Decoupled
Gatekeeper
CRON or Scheduled
Edge Compute
Stateless Architecture
Decoupling Microservices
Decoupling Started with Servers
Benefits of Decoupling
Challenges of Decoupling
Decoupling Example
AWS:​Decoupling
Simple Queue Service (SQS)
SQS Message Delay and Visibility Timeout
SQS and Lambda Integration
Dead Letter Queue (DLQ)
SQS Buffer Example
Simple Notification Service (SNS)
EventBridge
Step Functions
Workflow Studio
Event-Driven Architecture
Asynchronous Design Pattern
Parallel Processing
Containers
Lambda vs.​Containers
Serverless Containers
Lambda Custom Containers
AWS:​Edge
Lambda@Edge
FreeRTOS
IoT Greengrass
Snowball
Outposts
AWS:​Internet of Things (IoT)
AWS Robotics
Industrial Internet of Things (IIoT)
Predictive Quality
Predictive Maintenance
Asset Management
AWS:​Managed Machine Learning (ML)
Rekognition
DeepLens
Textract
Polly
Transcribe
Lex
QnA Bot
Comprehend
AWS:​Ledger Technology
Managed Blockchain
Quantum Ledger Database (QLDB)
AWS:​Call Center
Well-Architected Framework
The Five Pillars of the Well-Architected Framework
The Design Principles
Why Use the AWS Well-Architected Framework?​
AWS Well-Architected Tool
Serverless Lens and Its Layers
Serverless Tips
Uploading Files
Layers of Caching
Multilingual
TypeScript
Pick the Right Tool for the Job
Cognito as a User Database
Chapter 10:​Case Studies
Introduction
Proactive Logging
Cost Tracking
Parsing S3 Logs
Parsing API Gateway Logs
Serverless Data Lake
Serverless Video
Elemental Media Services
Making the Media Services More Serverless
Video Processing and Analysis
Serverless Minecraft
Minecraft Server Setup
Notes
SEO-Friendly Website and CMS
Serverless Websites
Another Approach
Serverless Website Tips
Virtual Host
True Serverless Containers1
1.​Create, Configure, and Build Our Docker Container
2.​Put the Container in a Registry
3.​Enable Long ARN Names in ECS
4.​Create Any Support Services
5.​Create the Policies and Roles
6.​Create a Task Definition
7.​Add the Container to the Task Definition
8.​Create the Cluster (and VPC) That the Task Will Run In
9.​Launch the Container
The Lambda Microservice
Launching a VPC and Cluster (If We Went with Option 3)
Launching a Fargate Service
Retrieve the Container IP
Finished
Epilogue
References
Index
About the Author
Thomas Smart
has been actively involved with digital
projects since 2002. His experience
crosses many industries and types and
sizes of organizations, giving him a
wealth of experience and knowledge to
draw upon as part of his consulting
services. Since 2020 he has worked as a
senior consultant for Sourced Singapore,
helping large, regulated enterprises
evolve their cloud strategy to
productively deliver Serverless
applications. This experience has
provided many new insights for large
enterprises and their unique challenges when adopting modern cloud
strategies.
His passion for Serverless comes from a focus on innovation, rapid
prototyping, and designing solutions that are as cost-effective as
possible. Serverless is a good match for these goals, as will become
apparent in this book.
© The Author(s), under exclusive license to APress Media, LLC, part of Springer
Nature 2023
T. Smart, Serverless Beyond the Buzzword
https://doi.org/10.1007/978-1-4842-8761-3_1

1. Serverless Basics
Thomas Smart1

(1) Singapore, Singapore

The Web as I envisaged it, we have not seen it yet. The future is
still so much bigger than the past.

—Tim Berners-Lee, Inventor of the World Wide Web

What Is Serverless Architecture?


Serverless is a means to create software that will run on a server fully
managed by a cloud provider instead of a server managed by our
organization, and we should only be paying for actual utilization, not
idle time or availability.
What it really means is that application teams can focus on service
configuration, which is not to be underestimated, and application code
– in short, the work that should result in a return on investment (ROI)
for the application, as opposed to the necessary plumbing.
The word “Serverless” is a bit of a misnomer as there actually are
servers involved in storing and running the code. It is called Serverless
because the developers no longer need to manage, update, or maintain
the underlying servers, operating systems, or software.
Redundancy, load balancing, networking, and, to some extent,
security are also largely managed, guaranteed, and monitored by the
cloud provider and their dedicated 24/7 operations team.
For a service to be considered Serverless, the following should apply:
1. A significant portion of the service is managed by the cloud
provider – including the operating system, most software, and any
common dependencies. We also expect redundancy, scalability, and,
to some degree, security to be managed and automated.

2. We pay only for actual usage, for example, the number of requests,
the amount of storage, or the duration for which a service is
actually used. If we have to pay for idle time, it would not be
considered Serverless. Some cloud services use the term
“Serverless” in their name or description but do not satisfy this
requirement. If we configure a service but add no data to it and
there are no users, then the bill should be zero if it is Serverless.

3. Some services bill for idle time; however, due to their nature or our
use case, they can be turned off automatically when not needed and
turned back on again automatically when required. This approach
helps minimize being billed for idle time and so creates a Serverless
experience. However, if this approach compromises the security of
the solution in any way or makes it unstable, then it should not be
considered Serverless.

There are some related terms that I want to clarify to make sure we
are all on the same page.
Cloud-native refers to solutions that have been created for the
cloud – they are not necessarily Serverless. A cloud-native solution
could be running on servers but using cloud capabilities such as
autoscaling. As the cloud continues to evolve, the term is becoming
more associated with Serverless, but it is not quite interchangeable yet.
I use the more specific term Serverless in this book to avoid any
confusion.
Fully managed is another common term you may have heard. This
term can be especially confusing as it can be used to describe a service
or a feature of a service. Context and sentence structure is important,
and it helps gain a deeper understanding of the various cloud services
and their billing models. For example, the Aurora database is a fully
managed service. In this case, the cloud provider manages the service,
but it is still billed based on usage, so we will be paying for idle time. On
the other hand, Lambda is a Serverless service, and one of the features
of that is that it is fully managed.

Pay for What You Use


Cloud providers like to talk about “only paying for what you use.” This is
a common phrase in marketing materials and basic training, including
when the topic is cloud servers. This can lead to some confusion when
I point out that a benefit of Serverless is that we only pay for actual
utilization.
There is a difference. With servers, we pay for availability. When
cloud providers talk about the benefits of cloud servers, they are
typically comparing them against self-managed data center
infrastructure. With the latter, organizations need to purchase and
maintain hardware, often when it’s not needed right away. It is standard
practice to have backup hardware for maintenance and predicted future
projects.
With cloud servers, organizations can provision the server as and
when they need it and discard it when done, only paying for the time it
was active. In this context, “what you use” means when a server is
running and available to use. Server-based applications expect a server
to be running for the application to be available, regardless of whether
or not anyone is using the application.
With Serverless, the cloud services powering it are expected to be
always available, made so by the cloud provider, and at no cost to us.
When we have a user that wants to interact with a Serverless
application, the cloud service will respond accordingly and execute the
request. We are only billed for the time that the request is executing.
This request, which may only take a few milliseconds, is what we
consider the actual utilization - it is driven by actual use and not just
availability.
In summary
With self-managed data center infrastructure, we pay for everything,
even when it’s not really needed.
With cloud servers, we pay for availability, even if it’s not utilized.
With Serverless, we only pay when we really use a service.

Server vs. Fully Managed vs. Serverless


Returning to the options we have in the cloud, there are three ways to
host an application:

Servers
The organization manages the operating system and software,
including all maintenance. The application teams need to configure
redundancy and scaling, and we pay a fixed amount every month based
on server size and quantity, but regardless of actual utilization.
This is not Serverless because we are paying for idle availability. In a
given month, we would pay the same if we had zero visitors or
thousands. Due to the nature of servers and, especially, the time needed
to start a server, it is not realistic to automatically disable and enable
servers in response to visitors.

Fully managed service


The application team is responsible for the code and service
configuration, but the cloud provider manages everything else. We still
pay a monthly amount regardless of utilization. Some container
services and managed databases operate this way in the cloud.
Depending on the service and use case, it may be possible to use
configuration and custom code to make a fully managed service behave
like a Serverless one. For example, we can launch a container on
demand for a particular task and then terminate it once the task
completes. This way, we are only billing for the actual utilization of the
fully managed service.

Serverless
And lastly, we have Serverless, which is similar to fully managed, but we
only pay for actual utilization. One way to think of this is the service
automatically turns off our component between requests and
automatically turns it on again with no noticeable delay when a user
arrives. Because of this, we only pay for each individual request and the
time it is running each request.
So far, it’s been about understanding the terminology. Let’s look at
the financial impact that actual utilization has on an application. In
Figure 1-1, we have a simple registration form. This form is used 20
times a day, and processing a submission takes 1 second.

Figure 1-1 Server and fully managed vs. Serverless utilization

With a server-based or fully managed approach, we are billed for


the full 24 hours of runtime. This means we will have paid for 23 hours,
59 minutes, and 40 seconds of available time and 20 seconds of actual
utilization. With Serverless, we will only pay for those 20 seconds of
utilization. In dollars, that would be over one dollar for an on-demand
server-based option for 1 day and less than one-hundredth of a cent for
the Serverless option.
This example is purposefully kept simple; 20 requests a day is not a
high number compared with most applications. We will look at how
Serverless pricing scales and compares with servers for a solution with
more users in Chapter 3.

What Serverless Is Not


It is equally important to know what Serverless architecture is not.
It will not replace all other ways to build software in the cloud, nor
is it suitable for all projects or organizations. As with any tool, we need
to pick the right one for the job. Generally speaking, Serverless is
usually not suitable for
Computer-intensive applications that need heavy CPU processing
power, lots of memory, or Graphic Processing Units (GPUs).
Migration of existing applications without significant updates or
sometimes even a complete rewrite of the application.
Complex low-latency applications, depending on the specific
requirements.
Organizations with a multi-cloud policy: They might be better
matched with a container or Kubernetes strategy.
Some organizations may need to restructure their teams and evolve
their cloud strategy significantly before they can productively deliver
Serverless projects.

Microservices

Microservices frequently come up when Serverless is discussed, and


most Serverless solutions will include them. Microservices are like
mini-applications that each handle a specific feature or set of closely
related features. Microservices are able to work together to meet an
application’s full set of requirements.
In a Serverless application, microservices are where we can write
our custom code. They make up the compute or intelligence of a
solution, effectively replacing the need for servers or containers.
Microservices can do calculations, apply algorithms and machine
learning models, convert data between different formats, and much
more. Microservices are also commonly used as the “glue” between
cloud services in a workflow – for example, extracting audio from video
in one service (transcode), converting it to text in a second service
(transcribe), and then having the text analyzed in a third service
(comprehend).
Microservices are what we call loosely coupled, meaning that they
can function independently of each other. If one microservice fails, the
other microservices can still perform their respective tasks.
Let’s explain that in more detail. To keep it less technical, I will use a
self-service ice cream machine analogy to explain it in Figure 1-2.
Traditionally, software architecture was monolithic, meaning that
the application was written as a single collection of code that contained
all its functions. In our example, a single ice cream machine will handle
the entire request. While well-written monolithic applications are often
layered to provide some separation between data, function, and design,
the different layers, and the functions within a given layer, are still
heavily dependent on each other.
The downside is that if any part of the monolithic machine breaks,
the entire machine is essentially unusable. Even worse, any new
request for ice cream will simply be met with silence, and any existing
request will be lost – including the request’s data. We will only find out
that something is wrong when a user complains that the machine isn’t
working or by using external monitoring tools.
Microservices can be thought of as independent mini-applications,
each one providing a specific feature. In Figure 1-2, they are
represented as four small machines on the right, each one performing a
particular part of the request. Below those machines, we have a
conveyor belt, representing a workflow-managing service that ensures
all our machines are working nicely together to get that final result.
Figure 1-2 The “ice cream” analogy for microservices
While microservices can work together in workflows, a well-
designed microservice can fulfil its specific purpose without
depending on other microservices or relying on any shared code.
If one of the mini machines breaks, the request can still be fulfilled
up to that point, and because the process is being tracked through each
step, we are able to retry a failed step automatically. High-volume
applications can run into throttling errors on some services, which
happen when too many requests per second arrive. Routinely retrying
such a request after a small pause can often resolve matters. If the auto-
retry doesn’t work, it can notify the application team to take manual
action and provide them with the details and context to help quickly
resolve the matter.
When it’s fixed, the request can then continue where it left off
without the request, any of its data, or any progress so far being lost.
Importantly, this can happen before the user has complained or, ideally,
even noticed that something is wrong.
An additional advantage of this architecture is that each
microservice, or each machine in this example, can be updated and
scaled separately from the rest. So, if we have a lot more customers
wanting strawberry ice cream, the strawberry machine can be scaled
without touching other machines. Similarly, a machine not required for
a particular request can be skipped. This increases the efficiency of
each request as the response is specific to its needs and unnecessary
steps can be avoided.
Consider the following comparisons between monolithic and
microservice architectures.

Independence
In a microservice architecture, each microservice is independent.
According to best practice, there should be no shared code, to ensure
that changing one microservice does not break another. When looking
at workflows – multiple microservices working together, each
microservice has a specific and narrow scope, and the expected input
and output are clearly defined. Even if changes within a microservice
are made, the changes will not impact any other step in the workflow if
the input and output do not change.
Other documents randomly have
different content
‘Thank you,’ she now said, and sat down. ‘The surprise is that you
are going into the country for your holidays.’
There was a silence, only broken by Charles, and he only said:
‘We needn’t have bothered about decorating the room.’
‘Oh, is this decoration?’ Miss Sandal asked, as though she thought
pink scarves might get on to picture-frames and leopard-skins on to
floors, or marigolds on to mantelpieces, just by accident or
untidiness.
‘I may say that I have known for some time that this was likely to
happen—but the letter which has just come makes everything
settled. You are to go the day after to-morrow.’
‘But where?’ Caroline asked. And Miss Sandal then uttered the
memorable and unusual words, ‘Did you ever hear of your Great-
Uncle Charles?’
‘The one that was quarrelled with?’ said Charles.
‘I did not know you knew of that. Yes. The quarrel is now at an
end, and he has invited you to spend your holidays at the Manor
House.’
There was a deep silence, due to the children’s wanting to shout
‘Hooray!’ and feeling that it would not be manners.
‘I thought you’d be pleased,’ said Miss Sandal. ‘It is considered a
very beautiful house, and stands in a park.’
‘Are you going, Aunt Emmeline?’ Caroline asked.
‘No, dear. Only you children are invited. You will be quiet and
gentle, won’t you, and try to remember that your Great-Uncle
Charles is a quiet student, and not used to children. You will have a
great deal of liberty, and I hope you will use it well. You have never
been on a visit before without—without some one to remind you of—
to tell you——’
‘Oh, that’s all right, Aunt Emmie,’ said Charlotte. ‘But who’ll sew
on our buttons and mend our stockings?’
‘There is a housekeeper, of course,’ said Miss Sandal. ‘I shall pack
your things to-morrow; and if you will decide what toys you would
like to take with you, I will pack them too.’
‘Yes,’ said Caroline, still feeling it polite not to look pleased. ‘Thank
you, Aunt Emmeline.’
‘I hope he’ll like us,’ said Charles. ‘He ought to when we’re all
named after him. I say, couldn’t we all pretend to be called
something else? It’s bad enough now; but it’ll be awful when there’s
an Uncle Charles in the house as well as all us. I say, Aunt Emmie,
are we to call him “Great”?’
‘He means Great-Uncle Charles,’ Caroline explained. ‘I expect we’d
better call him plain “Uncle,” hadn’t we?’
‘He wouldn’t like being called “plain,”’ said Charles.
‘Don’t be silly,’ said Caroline, still a prey to politeness. ‘He won’t
mind what little boys call him.’
‘I bet he would if I called him the sort of things you call me. Silly
yourself!’
‘Children! children!’ said Miss Sandal. ‘I thought you’d be so
pleased.’
‘We are,’ said Caroline. ‘Only won’t you be rather dull without us?
That’s why we don’t seem so glad as you seem to think we ought to
seem.’
Miss Sandal smiled, which made her long, whitey-brown-paper-
coloured face look much prettier.
‘Thank you, Caroline. Your Uncle Percival and I are also about to
take a holiday. We are going to Switzerland, the Italian Lakes, and to
Venice. You may be as happy as you like without worrying about us.’
And it was then that the three children felt that politeness and
sincerity might meet in a heartfelt shout of ‘Hooray!’
‘I shall take the leopard-skin and all my other presents,’ said
Caroline.
‘And I shall take the draughts and the spilikins,’ said Charlotte.
‘Mother said there were draughts made of ebony and ivory with
lions’ heads and mother-of-pearl spilikins in the drawing-room when
she was a little girl,’ Caroline reminded her.
‘I shall take every single thing I’ve got, and my cricket set as well,’
said Charles.
CHAPTER II
THE MANOR HOUSE

You can imagine the packing, the running up and down stairs, the
difficulty of choosing what to leave behind—for that is, after all,
what it comes to when you are going away, much more than the
difficulty of choosing what you will take with you. Miss Sandal,
surrounded by heaps of toys and books—far too large to have been
got into the trunks, even if all the clothes had been left out—at last
settled the question by promising to send on, by post or by carrier,
any little thing which had been left behind and which the children
should all agree was necessary to their happiness. ‘And the leopard-
skin takes so much room,’ she said, ‘and I believe there are wild-
beast-skins as well as stuffed animals at your uncle’s house.’ So they
left the leopard-skin behind too. There was a good deal of whispered
talk and mystery and consulting of books that morning, and Aunt
Emmeline most likely wondered what it was all about. But perhaps
she didn’t. She was very calm. Anyway, she must have known when,
as the cab drew up in front of the door, the three children presented
themselves before her with bouquets in their hands.
‘They are for you,’ said all three at once.
Then Charlotte presented Aunt Emmeline with a bunch of balm
from the garden.
‘It means sympathy,’ she said; ‘because, of course, it’s nice of you
to say so, but we know that those geography places you’re going to
can’t be really as nice as Uncle Charles’s.’
Charles’s bouquet was of convolvulus. ‘It means dead hope,’ he
explained; ‘but it’s very pretty, too. And here’s this.’ He suddenly
presented a tiny cactus in a red pot. ‘I bought it for you,’ he said; ‘it
means, “Thou leavest not.”’
‘How charming of you!’ said Aunt Emmeline, and turned to
Caroline, who was almost hidden behind a huge bunch of ivy and
marigolds.
‘The ivy means friendship,’ said Caroline, ‘and the marigolds don’t
count. I only put them because they are so goldy-bright. But if they
must count, then they mean cruelty—Fate’s, you know, because
you’re not coming. And there’s a purple pansy in among it
somewhere, because that means, “I think of you.”’
‘Thank you very, very much,’ said Aunt Emmeline. ‘I can’t tell you
how pleased I am. It is very sweet of you all.’
This floral presentation gave a glow and glory to their departure.
At the very last moment Caroline leaned out of the window to say:
‘Oh, Aunt Emmeline, when Miss Peckitt comes to finish those
muslin frocks that you’re going to send us, would you try to manage
to give her a Canterbury bell from me? She’ll know what it means.
But in case she doesn’t, it’s gratitude—in the book. And we’ll put
flowers in our letters expressing our feelings. Good-bye.’
Uncle Percival took them to the station and——
But why should I describe a railway journey? You know exactly
what it is like. I will only say that it was very dusty, and so sunny
that the children wanted the blinds down, only a very tailor-made
lady with a cross little grey dog said ‘No.’ And you know how black
your hands get in the train, and how gritty the cushions are, and
how your faces get black too, though you are quite certain you
haven’t touched them with your hands. The one who got the little bit
of the engine in its eye was Charles that time. But some one always
gets it, because some one always puts its head out of the carriage
window, no matter what the printed notices may say. You know all
this. What you don’t know is what happened at the junction where,
carefully attended by
the guard, they
changed trains. They
had to wait for some
time, and when they
had looked at the
bookstall—which was
small and dull, and
almost entirely
newspapers—they
looked at the other
people who had to wait
too. Most of them were
of dull appearance; but
there was one tall
gentleman who looked,
they all agreed, exactly
like Mr. Murdstone in
David Copperfield.
‘And he’s got David
with him, too,’ said
Charlotte. ‘Look!’
The Murdstone
gentleman, having
bought the Athenæum,
There was a good deal of whispered talk
and mystery. the Spectator, and a
seven-penny reprint of
the works of Marcus
Aurelius, had gone to a bench on which sat a sulky-looking boy. He
spoke to the boy, and the boy answered. And the gentleman walked
off.
‘He’s gone to have a bun all by himself,’ said Charles. ‘Selfish pig!’
‘I say, let’s sit down on the bench. You sit next him, Charles.
Perhaps he’d talk to us.’ This was Caroline’s idea.
They did; and ‘he,’ who was, of course, the sulky boy, did speak
to them. But not till they’d spoken to him. It was Charles who did it.
‘Are you going on in
this next train?’ he
said, ‘because, if you
are, we can get into
your carriage. We shall
be company for you.’
‘What’s the good?’
said the boy,
unexpectedly; ‘it’ll only
make it worse
afterwards.’
‘What worse?’
‘The being alone.’
‘Well, anyhow,’ said
Caroline, coming round
to sit on the other side
of him, ‘you’re not
alone now. What’s up?
Who is he?’
‘He’s a
schoolmaster. I should
have thought you
could have seen that.’
‘You sit next him, Charles.’
‘We thought he was
like Mr. Murdstone.’
‘He is,’ said the strange boy; ‘exactly.’
‘Oh,’ said Charlotte joyously, ‘then you’ve read David. I say!’
They were all delighted. There is no bond like the bond of having
read and liked the same books. A tide of friendliness swept over the
party, and when they found that he had also read Alice in
Wonderland, Wild Animals I Have Known, and Hereward the Wake,
as well as E. Nesbit’s stories for children in the Strand Magazine,
they all felt that they had been friends for years.
‘But tell us all about it, quick, before he comes back,’ urged
Charles. ‘Perhaps we could help you—bring you jam tarts and apples
with a rope ladder or something. We are yours to the death—you
won’t forget that, will you? And what’s your name? And where do
you live? And where are you going? Tell us all about it, quick!’ he
urged.
Then out it all came. The strange boy’s name was Rupert Wix,
and he was at a school—not half bad the school was—and old Filon
—he was the classical chap—was going to take Rupert and two other
chaps to Wales for the holidays—and now the other chaps had got
measles, and so had old Filon. And old Mug’s brother—his name
wasn’t really Mug, of course, but Macpherson, and the brother was
the Rev. William Macpherson—yes, that was him, the Murdstone
chap—he was going to take Rupert to his beastly school in the
country.
‘And there won’t be any other chaps,’ said Rupert, ‘because, of
course, it’s vac—just old Mug’s beastly brother and me, for days and
weeks and years—until the rest of the school comes back. I wish I
was dead!’
‘Oh, don’t!’ said Caroline; ‘how dreadful! They’ve got scarlet fever
at our school, that’s why our holidays have begun so early. Do cheer
up! Have some nut-chocolate.’ A brief struggle with her pocket
ended in the appearance of a packet—rather worn at the edges—the
parting gift of Aunt Emmeline.
‘Is old Mug’s brother as great a pig as he looks?’ Charles asked,
through Rupert’s ‘Thank-yous.’
‘Much greater,’ said Rupert cordially.
‘Then I know what I’d do,’ said Charlotte. ‘I’d run away from
school, like a hero in a book, and have some adventures, and then
go home to my people.’
‘That’s just it,’ said Rupert. ‘I haven’t got anywhere to run to. My
people are in India. That’s why I have to have my hols at a beastly
school. I’d rather be a dog in a kennel—much.’
‘Oh, so would I,’ said Charlotte. ‘But then I’d almost rather be a
dog than anything. They’re such dears. I do hope there’ll be dogs
where we’re going to.’
‘Where’s that?’ Rupert asked, more out of politeness than because
he wanted to know.
‘I’ll write it down for you,’ said Caroline, and did, on a page of the
new grey leather pocket-book Uncle Percival had given her. ‘Here,
put it in your pocket, and you write and tell us what happens.
Perhaps it won’t be so bad. Here he comes—quick!’
She stuffed the paper into Rupert’s jacket pocket as the tall
Murdstone-like figure advanced towards them. The three children
left Rupert and walked up the platform.
‘I’m glad we gave him the chock,’ said Charles, and the word was
hardly out of his mouth before a cold, hard hand touched his
shoulder (and his cheek as he turned quickly) and a cold, hard voice
said:
‘Little boy, I do not allow those under my charge to accept
sweetmeats from strange children, especially dirty ones.’
And with that the Murdstone gentleman pushed the chocolate
into Charles’s hand and went back to his prey.
‘Beast! Brute! Beast!’ said Charles.
After this it was mere forlorn-hopishness and die-on-the-barricade
courage, as Charlotte said later, that made the children get into the
same carriage with Rupert and his captor. They might as well have
saved themselves the trouble. The Murdstone gentleman put Rupert
in a corner and sat in front of him with a newspaper very widely
opened. And at the next station he changed carriages, taking Rupert
by the hand as though he had been, as Charles put it, ‘any old baby-
girl.’
But as Rupert went out Caroline whispered to him:
‘You get some borage and eat it,’ and Rupert looked ‘Why?’
‘Borage gives courage, you know,’ she said, too late, for he was
whisked away before he could hear her, and they saw him no more.
They talked about him, though, till the train stopped at East
Farleigh, which was their station.
There was a waggonette to meet them and a cart for their
luggage, and the coachman said he would have known Caroline
anywhere, because she was so like her mother, whom he
remembered when he was only gardener’s boy; and this made every
one feel pleasantly as though they were going home.
It was a jolly drive, across the beautiful bridge and up the hill and
through the village and along a mile or more of road, where the
green hedges were powdered with dust, and tufts of hay hung,
caught by the brambles from the tops of passing waggons. These
bits of hay made one feel that one really was in the country—not
just the bare field-country of the suburb where Aunt Emmeline and
Uncle Percival lived, where one could never get away from the sight
of red and yellow brick villas.
And then the boy who was driving the luggage cart got down and
opened a gate; and they drove through and along a woodland road
where ferns and blossoming brambles grew under trees very green
and not dusty at all.
From the wood they came to a smooth, green, grassy park dotted
with trees, and in the middle of it, standing in a half-circle of
chestnuts and sycamores, was the house.
It was a white, bow-windowed house, with a balcony at one end,
and a porch, with white pillars and two broad steps; and the grass
grew right up to the very doorsteps, which is unusual and very
pretty. There was not a flower to be seen—only grass. The
waggonette, of course, kept to the drive, which ran round to a side
door—half glass.
And here Mrs. Wilmington the housekeeper received them. She
was a pale, thin person—quite kind, but not at all friendly.
‘I don’t think she has time to think of anything but being ladylike,’
said Charlotte. ‘She ought to wear mittens.’
This was while they were washing their hands for tea.
‘I suppose if you’re a housekeeper you have to be careful people
don’t think you’re a servant,’ said Caroline. ‘What drivel it is! I say,
isn’t this something like?’
She was looking out of the bow window of the big room spread
with a blue rose-patterned carpet, at the green glory of the park,
lying in the sun like another and much more beautiful carpet with a
pattern of trees on it.
Then they went down to tea. Such a house—full of beautiful
things! But the children hadn’t time to look at them then, and I
haven’t time to tell you about them now.
I will only say that the dining-room was perfect in its Turkey-
carpet-and-mahogany comfort, and that it had red curtains.
‘Will you please pour the tea, Miss Caroline?’ said Mrs.
Wilmington, and went away.
‘I’m glad we haven’t got to have tea with her, anyway,’ said
Charles.
And then Uncle Charles came in. He was not at all what they
expected. He could not have been what anybody expected. He was
more shadowy than you would think anybody could be. He was
more like a lightly printed photograph from an insufficiently exposed
and imperfectly developed negative than anything else I can think
of. He was as thin and pale as Mrs. Wilmington, but there was
nothing hard or bony about him. He was soft as a shadow—his
voice, his hand, his eyes.
‘And what are your names?’ he said, when he had shaken hands
all round.
Caroline told him, and Charles added:
‘How funny of you not to know, uncle, when we’re all named after
you!’
‘Caroline, Charles, Charlotte,’ he repeated. ‘Yes, I suppose you
are. I like my tea very weak, please, with plenty of milk and no
sugar.’
Caroline nervously clattered among the silver and china. She was
not used to pouring out real tea for long-estranged uncles.
‘I hope you will enjoy yourselves here,’ said Uncle Charles, taking
his cup; ‘and excuse me if I do not always join you at meals. I am
engaged on a work—I mean I am writing a book,’ he told them.
‘What fun!’ said every one but Caroline, who had just burnt
herself with the urn; and Charles added:
‘What’s it about?’
‘Magic,’ said the Uncle, ‘or, rather, a branch of magic. I thought of
calling it “A Brief Consideration of the Psychological and Physiological
Part played by Suggestion in So-called Magic.”’
‘It sounds interesting; at least I know it would if I knew anything
about it,’ said Caroline, trying to be both truthful and polite.
‘It’s very long,’ said Charles. ‘How would you get all that printed
on the book’s back?’
‘And don’t say “so-called,”’ said Charlotte. ‘It looks as if you didn’t
believe in magic.’
‘If people thought I believed in magic they wouldn’t read my
books,’ said Uncle Charles. ‘They’d think I was mad, you know.’
‘But why?’ Charlotte asked. ‘We aren’t mad, and we believe in it.
Do you know any spells, uncle? We want awfully to try a spell. It’s
the dream of our life. It is, really.’
The ghost of a smile moved the oyster-shell-coloured face of
Uncle Charles.
‘So you take an interest in magic?’ he said. ‘We shall have at least
that in common.’
‘Of course we do. Every one does, only they’re afraid to say so.
Even servants do. They tell fortunes and dreams. Did you ever read
about the Amulet, or the Phœnix, or the Words of Power? Bread and
butter, please,’ said Charles.
‘You have evidently got up the subject,’ said Uncle Charles. ‘Who
told you about Words of Power?’
‘It’s in The Amulet,’ said Charlotte. ‘I say, uncle, do tell us some
spells.’
‘Ah!’ Uncle Charles sighed. ‘I am afraid the day of spells has gone
by—except, perhaps, for people of your age. She could have told
you spells enough—if all the stories of her are true.’
He pointed to a picture over the mantelpiece—a fair-haired, dark-
eyed lady in a ruff.
‘She was an ancestress of ours,’ he said; ‘she was wonderfully
learned.’
‘What became of her?’ Charlotte asked.
‘They burned her for a witch. It is sometimes a mistake to know
too much,’ said the Uncle.
This contrasted agreeably with remembered remarks of Uncle
Percival and Aunt Emmeline, such as ‘Knowledge is power’ and
‘There is no darkness but ignorance.’
The children looked at the lady in the white ruff and black velvet
dress, and they liked her face.
‘What a shame!’ they said.
‘Yes,’ said the Uncle. ‘You see she’s resting her hand on two
books. There’s a tradition that those books contain her magic secret.
I used to look for the books when I was young, but I never found
them—I never found them.’ He sighed again.
‘We’ll look, uncle,’ said Charlotte eagerly. ‘We may look, mayn’t
we? Young heads are better than old shoulders, aren’t they? At
least, that sounds rude, but you know I mean two heads are better
than yours—— No, that’s not it. Too many cooks spoil the—— No,
that’s not it either. We wouldn’t spoil anything. Too many hands
make light work. That’s what I meant.’
‘Your meaning was plain from the first,’ said the Uncle, finishing
his tea and setting down his cup—a beautiful red and blue and gold
one—very different from Aunt Emmeline’s white crockery. ‘Certainly
you may look. But you’ll respect the field of your search.’
‘Uncle,’ said Caroline, from behind the silver tea-tray, ‘your house
is the most lovely, splendid, glorious, beautiful house we’ve ever
seen, and——’
‘We wouldn’t hurt a
hair of its head,’ said
Charles.
Again the Uncle
smiled. ‘Well, well,’ he
said, and faded away
like a shadow.
‘We’ll find those
books or perish,’ said
Charlotte firmly.
‘Ra-ther,’ said
Charles.
‘We’ll look for them,
anyway,’ said Caroline.
‘Now let’s go and pick
an ivy leaf and put it in
a letter for poor dear
Aunt Emmeline. I’ll tell
you something.’
‘Well?’ said the
others.
‘They burned her for a witch.’
‘This is the sort of
house I’ve always
dreamed of when it said luxury—in books, you know.’
‘Me too,’ said Charlotte.
‘And me,’ said Charles.
CHAPTER III
THE WONDERFUL GARDEN

It was very glorious to wake up the next morning in enormous soft


beds—four-posted, with many-folded silk hangings, and shiny
furniture that reflected the sunlight as dark mirrors might do. And
breakfast was nice, with different sorts of things to eat, in silver
dishes with spirit-lamps under them,—bacon and sausages and
scrambled eggs, and as much toast and marmalade as you wanted;
not just porridge and apples, as at Aunt Emmeline’s. There were tea
and coffee and hot milk. They all chose hot milk.
‘I feel,’ said Caroline, pouring it out of a big silver jug with little
bits of ivory between the handle and the jug to keep the handle
from getting too hot, ‘I feel that we’re going to enjoy every second
of the time we’re here.’
‘Rather,’ said Charles, through sausage. ‘Isn’t Uncle Charles a
dear,’ he added more distinctly. ‘I dreamed about him last night—that
he painted his face out of the paint-box I gave Caro, and then we
blew him out with the bellows to make him fatter.’
‘And did it?’ Caroline asked.
‘He burst,’ said Charles briefly, ‘and turned into showers of dead
leaves.’
There was an interval of contented silence. Then—
‘What shall we do first?’ said Charles. And his sisters with one
voice answered, ‘Explore, of course.’
And they finished their breakfast to dreams of exploring every
hole and corner of the wonderful house.
But when they rang to have breakfast taken away it was Mrs.
Wilmington who appeared.
‘Your uncle desired me to say that he thinks it’s healthy for you to
spend some hours in the hopen—open air,’ she said, speaking in a
small distinct voice. ‘He himself takes the air of an afternoon. So will
you please all go out at once,’ she ended in a burst of naturalness,
‘and not come ’ome, home, till one o’clock.’
‘Where are we to go?’ asked Charlotte, not pleased.
‘Not beyond the park and grounds,’ said the housekeeper. ‘And,’
she added reluctantly, ‘Mr. Charles said if there was any pudding you
liked to mention——’
A brief consultation ended in, ‘Treacle hat, please’; and when Mrs.
Wilmington had minced off, they turned to each other and said:
‘The brick!’
‘The old duck!’ and
‘Something like an uncle.’
Then they went out, as they had been told to do. And they took
off their shoes and stockings, which they had not been told to do—
but, on the other hand, had not been told not to—and walked
barefooted in the grass still cool and dewy under the trees. And they
put on their boots again and explored the park, and explored the
stable-yard, where a groom was rubbing bright the silver buckles of
the harness and whistling as he rubbed. They explored the stables
and the harness-room and the straw-loft and the hay-loft. And then
they went back to the park and climbed trees—a little way, because
though they had always known that they would climb trees if ever
they had half a chance, they had not, till now, had any chance at all.
And all the while they were doing all this they were looking—at
the back of their minds, even when they weren’t doing it with the
part you think with—for the garden.
And there wasn’t any garden!
That was the plain fact that they had to face after two hours of
sunshine and green out-of-doors.
‘And I’m certain mother said there was a garden,’ Caroline said,
sitting down suddenly on the grass; ‘a beautiful garden and a
terrace.’
‘Perhaps the Uncle didn’t like it, and he’s had it made not garden
again—“Going back to Nature” that would be, like Aunt Emmeline
talks about,’ Charles suggested.
‘And it’s dreadful if there’s no garden,’ said Caroline, ‘because of
the flowers we were going to send in letters. Wild flowers don’t have
such deep meanings, I’m certain.’
‘And besides we haven’t seen any wild flowers,’ said Caroline. ‘Oh,
bother!’
‘Never mind,’ Charles said, ‘think of exploring the house—and
finding the book, perhaps. We’ll ask the Elegant One, when we go
in, why there isn’t a garden.’
‘We won’t wait till then,’ said Charlotte; ‘let’s go and ask that jolly
man who’s polishing the harness. He looked as if he wouldn’t mind
us talking to him.’
‘It was him drove us yesterday,’ Charles pointed out.
So they went as to an old friend. And when they asked William
why there wasn’t a garden he answered surprisingly and rather
indignantly:
‘Ain’t they shown you, Miss? Not a garden? There ain’t a garden
to beat it hereabouts. Come on, I’ll show you.’
And, still more surprisingly, he led the way to the back door.
‘We aren’t to go indoors till dinner-time,’ said Caroline; ‘and
besides, we should like to see the garden—if there really is one.’
‘Of course there is one, Miss,’ said William. ‘She’ll never see you if
you’re quick. She’ll be in her room by now—at her accounts and
things. And the Master’s never about in these back parts in the
morning.’
‘I suppose it’s a lock-up garden and he’s going to get the key,’
said Charles in a whisper. But William wasn’t.
He led them into a whitewashed passage that had cupboards and
larders opening out of it and ended in a green baize door. He opened
this, and there they were in the hall.
‘Quick,’ he said, and crossed it, unlatched another door and held it
open. ‘Come in quiet,’ he said, and closed the door again. And there
they all were in a little square room with a stone staircase going
down the very middle of it, like a well. There was a wooden railing
round three sides of the stairway, and nothing else in the room at
all, except William and the children.
‘A secret staircase,’ said Charlotte. ‘Oh, it can’t be, really. How
lovely!’
‘I daresay it was a secret once,’ said William, striking a match and
lighting a candle that stood at the top of the stairs in a brass
candlestick. ‘You see there wasn’t always these banisters, and you
can see that ridge along the wall. My grandfather says it used to be
boarded over and that’s where the joists went. They’d have a trap-
door or something over the stairway, I shouldn’t be surprised.’
‘But what’s the stair for?—Where does it go? Are we going down?’
the children asked.
‘Yes, and sharp too. Nobody’s supposed to go this way except the
Master. But you’ll not tell on me. I’ll go first. Mind the steps, Miss.
They’re a bit wore at the edges, like.’
They minded the steps, going carefully down, following the
blinking, winking, blue and yellow gleam of the candle.
There were not many steps.
‘Straight ahead now,’ said William, holding the candle up to show
the groined roof of a long straight passage, built of stone, and with
stone flags for the floor of it.
‘How perfectly ripping!’ said Charlotte breathlessly. ‘It is brickish
of you to bring us here. Where does it go to?’
‘You wait a bit,’ said William, and went on. The passage ended in
another flight of steps—up this time,—and the steps ended in a door,
and when William had opened this every one blinked and shut their
eyes, for the doorway framed green leaves with blue sky showing
through them, and——
‘’Ere’s the garden,’ said William; and here, indeed, it was.
‘There’s another door the other end what the gardeners go in and
out of,’ said William. ‘I’ll get you a key sometime.’
The door had opened into a sort of arch—an arbour, for its
entrance was almost veiled by thick-growing shrubs.
‘Oh, thank you,’ said Caroline; ‘but when did they make this
passage, and what for?’
‘They made that passage when the folks in the house was too
grand to go through the stable-yard and too lazy to go round,’ said
William. ‘There’s no stable-yard way now,’ he added. ‘So long! I must
be getting back, Miss. Don’t you let on as I brought you through.’
‘Of course not,’ every one said. Charles added, ‘But I didn’t know
the house was as old as secret passages in history times.’
‘It’s any age you please,’ said William; ‘the back parts is.’
He went back through the door, and the children went out
through the leafy screen in front, into the most beautiful garden that
could be, with a wall. I like unwalled gardens myself, with views
from the terraces. From this garden you could see nothing but tall
trees and—the garden itself.
The lower half was a vegetable garden arranged in squares with
dwarf fruit-trees and flower-borders round them, like the borders
round old-fashioned pocket-handkerchiefs. Then about half-way up
the garden came steps—stone balustrades, a terrace, and beyond
that a flower garden with smooth green turf paths, box-edged, a
sundial in the middle, and in the flower-beds flowers—more flowers
than I could give names to.
‘How perfectly perfect!’ Charlotte said.
‘I do wish I’d brought out my Language Of!’ said Caroline.
‘How awfully tidy everything is!’ said Charles in awe-struck tones.
It was.
There was nowhere an imperfect leaf, a deformed bud, or a
misshapen flower. Every plant grew straight and strong, and with an
extraordinary evenness.
‘They look like pictures of plants more than like real ones,’ said
Caroline quite truly.
An old gardener was sweeping the terrace steps, and gave the
children ‘Good morning.’
They gave it back, and stayed to watch him. It seemed polite to
say something before turning away. So Caroline said:
‘How beautifully everything grows here.’
‘Ay,’ said the old man, ‘it do. Say perfect and you won’t be far out.’
‘It’s very clever of you,’ said Charlotte. ‘Ill weeds don’t grow in a
single place in your garden.’
‘I don’t say as I don’t do something,’ said the old man, ‘but seems
as if there was a blessing on the place—everything thrives and
grows just-so. It’s the soil or the aspick, p’raps. I dunno. An’ I’ve
noticed things.’
‘What things?’ was the natural question.
‘Oh, just things,’ the gardener answered shortly, and swept away
to the end of the long steps.
‘I say’—Caroline went after him to do it—‘I say, may we pick the
flowers?’
‘In moderation,’ said the gardener, and went away.
‘I wonder what he’d call moderation,’ said Charles; and they
discussed this question so earnestly that the dinner-bell rang before
they had picked any flowers at all.
The gate at the end of the garden was open, and they went out
that way. Over the gate was a stone with words and a date. They
stopped to spell out the carved letters:
HERE BE DREAMES

1589

RESPICE FINEM.

Caroline copied the last two words in the grey-covered pocket-book;


and when Mrs. Wilmington came in to carve the mutton, Caroline
asked what the words meant.
‘I never inquired,’ said the housekeeper. ‘It must be quite out of
date now, whatever it meant once. But you must have been in the
garden to see that. How did you get in?’
An awkward
question. There was
nothing for it but to
say:
‘By the secret
passage.’ And Charles
said it.
‘No one uses that but
your uncle,’ said Mrs.
Wilmington, ‘and you
were requested to keep
out of doors till dinner-
time.’
She shut her mouth
with a snap and went
on carving.
‘Sorry,’ said Caroline.
‘Granted,’ said Mrs.
Wilmington, but not
cordially; and having
placed two slices of
mutton on each plate
went away.
‘How beautifully everything grows here.’
‘It is jolly having
meals by ourselves,’
said Charlotte; ‘only I wish she wasn’t cross.’
‘We ought to be extra manner-y, I expect, when we’re by
ourselves,’ said Caroline. ‘May I pass you the salt, Charles?’
‘No, you mayn’t,’ said Charles. ‘Thank you, I mean; but there’s
one at each corner. That’s one each for us, and one over for——’
‘For her.’ Charlotte pointed to the picture of the dark-eyed, fair-
haired lady.
‘Let’s put a chair for her,’ said Charlotte, ‘and pretend she’s come
to dinner. Then we shall have to behave like grown-up people.’
‘I never can remember about behaving,’ said Charles wearily;
‘such a lot of things—and none of them seem to matter. Why
shouldn’t you drink with your mouth full? It’s your own mouth.’
‘And eating peas with your knife. I think it would be as good as
conjuring, doing it without cutting yourself’—Charlotte tried to lift
the peas from her plate with her knife—‘let alone the balancing,’ she
added, as they rolled off among the mutton.
‘Don’t,’ said Caroline. ‘She’s looking at you. Charles, you’re the
only gentleman, worse luck—I wish I was a boy—put a chair for her.’
And a large green-seated chair, whose mahogany back was inlaid
with a brass scroll pattern, was wheeled to the empty space on the
fourth side of the table.
‘Now we must none of us look at her—in the picture, I mean. And
then we can’t be sure that she isn’t sitting in that chair,’ said
Caroline.
After dinner Caroline looked up ‘Remorse’s regret’ in The
Language of Flowers. It was agreed that Mrs. Wilmington had better
have a bouquet.
‘Brambles,’ Caroline said, her finger in the book, ‘they’re Remorse
—but they wouldn’t make a very comfortable nosegay. And Regret’s
verbena, and I don’t even know what it is.’
‘Put pansies with the brambles,’ said Charlotte; ‘that’ll be thoughts
of remorse.’
So the housekeeper, coming down very neat in her afternoon
dress of shiny black alpaca, was met by a bunch of pansies.
‘To show we think we’re remorsish about the secret stairs,’ said
Charlotte; ‘and look out, because the brambles are the remorse and
they prick like Billy-o!’
Mrs. Wilmington smiled, and looked quite nice-looking.
‘Thank you,’ she said. ‘I am sure you will remember not to repeat
the fault.’
Which wasn’t the nicest way of receiving a remorse bouquet; but,
then as Charlotte said, perhaps she couldn’t help not knowing the
nice ways. And anyhow, she seemed pleased, and that was the great
thing, as Charlotte pointed out.
Then, having done something to please Mrs. Wilmington, they
longed to do something to please some one else, and the Uncle was
the only person they could think of doing anything to please.
‘Suppose we arranged all the books in the dining-room bookcase,
in colours,—all the reds together and all the greens, and the ugly
ones all on a shelf by themselves,’ Charlotte suggested. And the
others agreed. So that the afternoon flew by like any old bird, as
Caroline put it; and when tea came, and the floor and sofa and
chairs were covered with books, and one shelf was gay with red
books and half a shelf demure in green—
‘Your uncle isn’t coming in to-day,’ said Mrs. Wilmington, ‘and I’m
sure it’s just as well. What a mess! Here, let me put them back, and
go and wash your hands.’
‘We’ll put them back,’ the children said, but in vain. They had to
go to wash their hands, and Mrs. Wilmington continued to put the
books back all the time they were having tea. Patiently and carefully
she did it, not regarding the colours at all, and her care and her
patience seemed to say, more loudly than any words she could have
spoken, ‘Yes; there you sit, having your nice tea, and I cannot have
my tea, because I have to clear up after you. But I do not complain.
No.’
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookmasss.com

You might also like