100% found this document useful (3 votes)
31 views

Serverless Web Applications with AWS Amplify: Build Full-Stack Serverless Applications Using Amazon Web Services Akshat Paul 2024 scribd download

Web

Uploaded by

baggasolin2y
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
31 views

Serverless Web Applications with AWS Amplify: Build Full-Stack Serverless Applications Using Amazon Web Services Akshat Paul 2024 scribd download

Web

Uploaded by

baggasolin2y
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

Download the Full Version of ebook for Fast Typing at ebookmass.

com

Serverless Web Applications with AWS Amplify:


Build Full-Stack Serverless Applications Using
Amazon Web Services Akshat Paul

https://ebookmass.com/product/serverless-web-applications-
with-aws-amplify-build-full-stack-serverless-applications-
using-amazon-web-services-akshat-paul/

OR CLICK BUTTON

DOWNLOAD NOW

Download More ebook Instantly Today - Get Yours Now at ebookmass.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Practical Rust Projects: Build Serverless, AI, Machine


Learning, Embedded, Game, and Web Applications (2nd ed.)
2nd Edition Shing Lyu
https://ebookmass.com/product/practical-rust-projects-build-
serverless-ai-machine-learning-embedded-game-and-web-applications-2nd-
ed-2nd-edition-shing-lyu/
ebookmass.com

Beginner's Guide to Streamlit with Python: Build Web-Based


Data and Machine Learning Applications 1st Edition Sujay
Raghavendra
https://ebookmass.com/product/beginners-guide-to-streamlit-with-
python-build-web-based-data-and-machine-learning-applications-1st-
edition-sujay-raghavendra/
ebookmass.com

Pro ASP.NET Core 3: Develop Cloud-Ready Web Applications


Using MVC, Blazor, and Razor Pages

https://ebookmass.com/product/pro-asp-net-core-3-develop-cloud-ready-
web-applications-using-mvc-blazor-and-razor-pages/

ebookmass.com

Deploy Container Applications Using Kubernetes:


Implementations with microk8s and AWS EKS Shiva
Subramanian
https://ebookmass.com/product/deploy-container-applications-using-
kubernetes-implementations-with-microk8s-and-aws-eks-shiva-
subramanian/
ebookmass.com
Building Real-Time Marvels with Laravel: Create Dynamic
and Interactive Web Applications Sivaraj Selvaraj

https://ebookmass.com/product/building-real-time-marvels-with-laravel-
create-dynamic-and-interactive-web-applications-sivaraj-selvaraj/

ebookmass.com

Pro .NET on Amazon Web Services: Guidance and Best


Practices for Building and Deployment 1st Edition William
Penberthy
https://ebookmass.com/product/pro-net-on-amazon-web-services-guidance-
and-best-practices-for-building-and-deployment-1st-edition-william-
penberthy-2/
ebookmass.com

Pro .NET on Amazon Web Services: Guidance and Best


Practices for Building and Deployment 1st Edition William
Penberthy
https://ebookmass.com/product/pro-net-on-amazon-web-services-guidance-
and-best-practices-for-building-and-deployment-1st-edition-william-
penberthy/
ebookmass.com

A Complete Guide to DevOps with AWS: Deploy, Build, and


Scale Services with AWS Tools and Techniques Osama Mustafa

https://ebookmass.com/product/a-complete-guide-to-devops-with-aws-
deploy-build-and-scale-services-with-aws-tools-and-techniques-osama-
mustafa/
ebookmass.com

Introducing ReScript: Functional Programming for Web


Applications 1st Edition Danny Yang

https://ebookmass.com/product/introducing-rescript-functional-
programming-for-web-applications-1st-edition-danny-yang/

ebookmass.com
Serverless Web
Applications with
AWS Amplify
Build Full-Stack Serverless
Applications Using Amazon
Web Services

Akshat Paul
Mahesh Haldar
Serverless Web Applications with AWS Amplify: Build Full-Stack Serverless
Applications Using Amazon Web Services
Akshat Paul Mahesh Haldar
Gurgaon, Haryana, India Bahraich, Uttar Pradesh, India

ISBN-13 (pbk): 978-1-4842-8706-4 ISBN-13 (electronic): 978-1-4842-8707-1


https://doi.org/10.1007/978-1-4842-8707-1

Copyright © 2023 by Akshat Paul, Mahesh Haldar


This work is subject to copyright. All rights are reserved 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.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: James Robinson-Prior
Development Editor: James Markham
Coordinating Editor: Jessica Vakili
Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street,
6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-­
sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member
(owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a
Delaware corporation.
For information on translations, please e-mail [email protected]; for reprint, paperback,
or audio rights, please e-mail [email protected].
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at http://www.apress.com/bulk-sales.
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/haldarmahesh/amplify-book. For more detailed
information, please visit http://www.apress.com/source-code.
Printed on acid-free paper
Table of Contents
About the Authors���������������������������������������������������������������������������������������������������� ix

Acknowledgments��������������������������������������������������������������������������������������������������� xi
Introduction����������������������������������������������������������������������������������������������������������� xiii

Chapter 1: Introduction to Serverless���������������������������������������������������������������������� 1


A Little Background����������������������������������������������������������������������������������������������������������������������� 1
Rise of Cloud Computing��������������������������������������������������������������������������������������������������������������� 3
Key Advantages of Cloud Environments���������������������������������������������������������������������������������� 4
The Emergence of Serverless Computing: A Game-­Changer for Cloud Development������������������ 5
Backend As a Service (BaaS)�������������������������������������������������������������������������������������������������� 6
Function As a Service/Serverless Computing�������������������������������������������������������������������������� 8
Benefits and Weaknesses of a Serverless Architecture�������������������������������������������������������� 10
Benefits of Serverless Architecture��������������������������������������������������������������������������������������� 10
Weaknesses of Serverless���������������������������������������������������������������������������������������������������� 12
AWS Amplify Introduction������������������������������������������������������������������������������������������������������������ 13
Local Setup��������������������������������������������������������������������������������������������������������������������������������� 14
Setting Up AWS Amplify CLI��������������������������������������������������������������������������������������������������� 15
Summary������������������������������������������������������������������������������������������������������������������������������������ 22

Chapter 2: UI Component and Authentication��������������������������������������������������������� 23


Authentication Basics����������������������������������������������������������������������������������������������������������������� 23
What Is Authentication?��������������������������������������������������������������������������������������������������������� 24
How Can Users Prove Credibility?����������������������������������������������������������������������������������������� 24
What Is Authorization?���������������������������������������������������������������������������������������������������������������� 25
Broken Authentication����������������������������������������������������������������������������������������������������������� 27
Types of Authentication��������������������������������������������������������������������������������������������������������� 28
Why MFA Is Important����������������������������������������������������������������������������������������������������������� 30

iii
Table of Contents

Types of MFA������������������������������������������������������������������������������������������������������������������������� 31
JSON Web Tokens������������������������������������������������������������������������������������������������������������������ 32
JWT Authentication Flow������������������������������������������������������������������������������������������������������� 33
JWT Structure������������������������������������������������������������������������������������������������������������������������ 34
Setting Up Authentication Using AWS Amplify���������������������������������������������������������������������������� 35
Creating Our React App��������������������������������������������������������������������������������������������������������� 36
Configuring the Backend for Our React Application�������������������������������������������������������������� 37
Setting Up Authentication����������������������������������������������������������������������������������������������������������� 41
Creating an Auth Service������������������������������������������������������������������������������������������������������� 42
Amplify UI React Components����������������������������������������������������������������������������������������������� 43
Integrating Auth with React App�������������������������������������������������������������������������������������������� 45
Logging In and Logging Out��������������������������������������������������������������������������������������������������� 51
OAuth Social Login���������������������������������������������������������������������������������������������������������������������� 57
What Is OAuth?���������������������������������������������������������������������������������������������������������������������� 58
Setting Up React App������������������������������������������������������������������������������������������������������������� 71
Summary������������������������������������������������������������������������������������������������������������������������������������ 72

Chapter 3: CRUD and REST APIs – Pillars of Efficient Data Exchange�������������������� 75


API Overview������������������������������������������������������������������������������������������������������������������������������� 75
Why Do We Need an API?������������������������������������������������������������������������������������������������������ 77
API Design����������������������������������������������������������������������������������������������������������������������������� 78
Types of APIs������������������������������������������������������������������������������������������������������������������������� 79
API Specifications and Protocols������������������������������������������������������������������������������������������� 79
Introduction to Lambda��������������������������������������������������������������������������������������������������������������� 80
Lambda Functions – The Serverless Functions��������������������������������������������������������������������� 80
Lambda Functions����������������������������������������������������������������������������������������������������������������� 81
Use Cases of Lambda Functions������������������������������������������������������������������������������������������� 82
Cons of Using Lambda Functions������������������������������������������������������������������������������������������ 82
How Lambda Function Works������������������������������������������������������������������������������������������������ 82
What Is the Lambda Layer?��������������������������������������������������������������������������������������������������� 83

iv
Table of Contents

Working with REST APIs�������������������������������������������������������������������������������������������������������������� 85


Saving the File����������������������������������������������������������������������������������������������������������������������� 92
PUT API to Update Items�������������������������������������������������������������������������������������������������������� 97
Using the Delete API to Delete an Item by ID������������������������������������������������������������������������� 99
Summary���������������������������������������������������������������������������������������������������������������������������������� 100

Chapter 4: Integrating REST APIs with a Frontend React App������������������������������ 101


Creating a Basic React ToDo App���������������������������������������������������������������������������������������������� 101
Adding a New Item�������������������������������������������������������������������������������������������������������������� 105
Enhancing the User Experience������������������������������������������������������������������������������������������������ 108
Enhancement 1�������������������������������������������������������������������������������������������������������������������� 108
Enhancement 2�������������������������������������������������������������������������������������������������������������������� 109
Do It Yourself (DIY): Deleting and Updating������������������������������������������������������������������������������� 111
GraphQL API������������������������������������������������������������������������������������������������������������������������� 111
Custom Resolver����������������������������������������������������������������������������������������������������������������� 118
Modifying the Lambda Handler������������������������������������������������������������������������������������������� 119
Testing the API��������������������������������������������������������������������������������������������������������������������� 121
Creating New Item – Mutation Query���������������������������������������������������������������������������������� 122
Testing the Mutation������������������������������������������������������������������������������������������������������������ 124
Updating the Item by ID – Mutation Query�������������������������������������������������������������������������� 125
Integrating GraphQL API in React���������������������������������������������������������������������������������������������� 130
Integrating GraphQL Mutation API��������������������������������������������������������������������������������������� 133
Do It Yourself (DIY): Modifying the React App���������������������������������������������������������������������������� 134
Subscription API������������������������������������������������������������������������������������������������������������������ 134
Integrating Subscription API with React����������������������������������������������������������������������������������� 139
Why APIs Throw 401 Error��������������������������������������������������������������������������������������������������������� 142
Summary���������������������������������������������������������������������������������������������������������������������������������� 144

v
Table of Contents

Chapter 5: Offline-First App���������������������������������������������������������������������������������� 145


Benefits of the Client-Server Model������������������������������������������������������������������������������������������ 145
Use Cases of Offline Apps��������������������������������������������������������������������������������������������������������� 146
The Offline App – Design Overview������������������������������������������������������������������������������������������� 148
Goal������������������������������������������������������������������������������������������������������������������������������������� 148
Add Offline Features in React.js������������������������������������������������������������������������������������������������ 150
Assumption�������������������������������������������������������������������������������������������������������������������������� 150
The Page Render Function�������������������������������������������������������������������������������������������������� 151
Real-Time Online HTTP Client���������������������������������������������������������������������������������������������� 153
Offline HTTP Client��������������������������������������������������������������������������������������������������������������� 153
Rendering the Offline and Online Items in the List������������������������������������������������������������������� 156
Testing Offline Feature�������������������������������������������������������������������������������������������������������������� 157
Testing the Online Syncing Feature������������������������������������������������������������������������������������������ 162
Things to Consider While Creating Offline Apps������������������������������������������������������������������������ 162
Summary���������������������������������������������������������������������������������������������������������������������������������� 164

Chapter 6: Data Storage��������������������������������������������������������������������������������������� 165


Introduction������������������������������������������������������������������������������������������������������������������������������� 165
Types of Data to Store��������������������������������������������������������������������������������������������������������������� 166
Cloud Storage As a Service������������������������������������������������������������������������������������������������������� 167
Database Provision and Integration������������������������������������������������������������������������������������������ 167
Provisioning Database��������������������������������������������������������������������������������������������������������� 168
Integrating the Database with APIs������������������������������������������������������������������������������������� 169
Assigning IDs to New Items������������������������������������������������������������������������������������������������� 172
Modifying the Create Todo Item Function���������������������������������������������������������������������������� 172
Modifying the Get All Items API�������������������������������������������������������������������������������������������� 174
Do It Yourself (DIY)��������������������������������������������������������������������������������������������������������������� 175
File Storage – S3 Bucket���������������������������������������������������������������������������������������������������������� 176
Goal������������������������������������������������������������������������������������������������������������������������������������� 176
Approach����������������������������������������������������������������������������������������������������������������������������� 176
Provision S3 Bucket������������������������������������������������������������������������������������������������������������� 177

vi
Table of Contents

Verifying the Resources on Amazon Console���������������������������������������������������������������������� 179


The Lambda Function���������������������������������������������������������������������������������������������������������� 184
Testing the Thumbnail Creation by Lambda Trigger������������������������������������������������������������ 187
Checking the Lambda Function Logs���������������������������������������������������������������������������������� 190
Summary���������������������������������������������������������������������������������������������������������������������������������� 193

Chapter 7: Analytics��������������������������������������������������������������������������������������������� 195


A High-Level View of Analytics�������������������������������������������������������������������������������������������������� 195
Analytics Fundamentals������������������������������������������������������������������������������������������������������������ 198
Terminologies���������������������������������������������������������������������������������������������������������������������������� 199
Setting Up Amplify Analytics Backend�������������������������������������������������������������������������������������� 200
Recording Events and Actions�������������������������������������������������������������������������������������������������� 201
Recording Events from our React App��������������������������������������������������������������������������������� 202
Recording Button Clicks on the Sign-In Page���������������������������������������������������������������������� 204
Why Is There a Delay in API Calls After We Click the Button to Record?������������������������������ 206
Tracking Page Views������������������������������������������������������������������������������������������������������������ 207
Automatic Tracking�������������������������������������������������������������������������������������������������������������� 209
Events Dashboard on AWS Console������������������������������������������������������������������������������������� 210
Limitations of AWS Pinpoint Service������������������������������������������������������������������������������������ 213
Introduction to Kinesis�������������������������������������������������������������������������������������������������������������� 214
Streaming Analytics Data���������������������������������������������������������������������������������������������������� 215
Setting Up Kinesis Backend������������������������������������������������������������������������������������������������������ 215
Delivery Stream������������������������������������������������������������������������������������������������������������������� 220
Writing the Data into the File����������������������������������������������������������������������������������������������� 222
Streaming the Analytics Data from React App��������������������������������������������������������������������� 225
Summary���������������������������������������������������������������������������������������������������������������������������������� 232

vii
Table of Contents

Chapter 8: Continuous Integration and Continuous Delivery/Continuous


Deployment����������������������������������������������������������������������������������������������������������� 233
The Goal of This Chapter����������������������������������������������������������������������������������������������������������� 233
Defining CI/CD��������������������������������������������������������������������������������������������������������������������������� 233
Difference Between CI and CD�������������������������������������������������������������������������������������������������� 234
Continuous Integration�������������������������������������������������������������������������������������������������������� 234
Continuous Delivery������������������������������������������������������������������������������������������������������������� 235
Continuous Deployment������������������������������������������������������������������������������������������������������ 235
The Objective of the CI/CD Pipeline������������������������������������������������������������������������������������������� 236
Pipeline As Code����������������������������������������������������������������������������������������������������������������������� 236
Benefits of Pipeline As Code������������������������������������������������������������������������������������������������ 237
Repository and Environments���������������������������������������������������������������������������������������������� 237
Hosting the Application for Development Environment������������������������������������������������������������� 238
Creating a New Environment and Hosting It������������������������������������������������������������������������ 248
Password Protecting the Nonproduction Environment�������������������������������������������������������� 254
Summary���������������������������������������������������������������������������������������������������������������������������������� 256

Chapter 9: Amplify Supplements�������������������������������������������������������������������������� 257


Building Interactive Bots with AWS Lex Service����������������������������������������������������������������������� 257
Important Terminologies������������������������������������������������������������������������������������������������������ 260
Test the Chatbot������������������������������������������������������������������������������������������������������������������ 262
Boost Your Application with AI/ML Capability���������������������������������������������������������������������������� 264
What Is Artificial Intelligence?��������������������������������������������������������������������������������������������� 264
What Is Machine Learning?������������������������������������������������������������������������������������������������� 265
Amplify Beyond React Web Apps���������������������������������������������������������������������������������������������� 268
AWS Amplify Studio������������������������������������������������������������������������������������������������������������� 270
Summary���������������������������������������������������������������������������������������������������������������������������������� 272

Index��������������������������������������������������������������������������������������������������������������������� 273

viii
About the Authors
Akshat Paul is the Founder and CTO of Company360, a technology leader, author of four
books on React Native, Ruby, and RubyMotion, and a former consultant at McKinsey &
Company. With his extensive experience in mobile and web development, coupled with
his strategic insights gained at McKinsey, he has delivered numerous enterprise and
consumer applications over the years. As an influential voice in the tech industry, Akshat
frequently speaks at conferences and meetups on various technologies. He has given
talks at React Native EU, Cross-Platform Mobile Summit, Devops@scale Amsterdam, the
DevTheory Conference India, RubyConfIndia, and #inspect-RubyMotion Conference
Brussels and was a keynote speaker at technology leadership events in Bangkok and
Kuala Lumpur. Besides technology Akshat spends time with his family, is an avid reader,
and is obsessive about healthy eating.

Mahesh Haldar is a passionate software engineer and expert in building scalable


systems. With extensive experience in designing robust architectures, Mahesh empowers
the team to fully harness the potential of cloud-based solutions. As a sought-after
speaker, Mahesh has presented at technical meetups and conferences in Bangalore,
Johannesburg, and Singapore. His outstanding contributions have earned recognition,
including features in Yourstory magazine and being listed among India’s top 20 apps.
Currently serving as a Principal Software Engineer at Carrefour, Mahesh leads a team
of talented developers, delivering exceptional eCommerce experiences. His expertise
has been pivotal in designing and implementing high-impact functionalities, effectively
serving millions of daily customer requests. With a proven track record in developing
complex large-scale systems for start-ups and renowned enterprises like Jago Bank and
Mckinsey & Company, Mahesh brings a wealth of practical knowledge and expertise to
the table.

ix
Acknowledgments
As the saying goes, “If I have seen further, it is by standing on the shoulders of giants.” In
the context of this book, those giants are the individuals who offered their unwavering
support and invaluable guidance throughout my journey.
Firstly, I want to express my profound gratitude to my parents, Shakuntala Paul
and Anup Paul. Your unwavering belief in my abilities and steadfast encouragement
have always propelled me forward. The spirit of continuous learning that you fostered
in me has not only been instrumental in my personal growth, but it has also profoundly
influenced my professional trajectory as a technology leader, and your tireless
cheerleading during my biggest victories has always been my motivation to keep moving
forward.
I am eternally thankful for my wife, Anu Sharma. She has been my rock and my
sanctuary throughout the process of writing this book. Her understanding, patience, and
unconditional love were invaluable during those late-night writing sessions and bouts of
writer’s block. Her ability to uplift my spirits during challenging moments and celebrate
with me during my triumphs has been a constant source of inspiration. This book is as
much her accomplishment as it is mine.
I would also like to extend my heartfelt thanks to the Apress team: Jessica Vakili,
James Robinson-Prior, and James Markham. Your collective expertise, support, and
collaboration have played a vital role in the successful completion of this book. Your
dedication to maintaining the quality and integrity of this work has not gone unnoticed,
and I am deeply grateful for your tireless efforts. A special acknowledgment to Louise
Corrigan, who was instrumental in the initial conceptualization of this book.
To each and every one of you, I express my sincerest appreciation. This book would
not have been possible without your enduring support, faith, and encouragement.
Thank you for being a part of my journey.
—Akshat Paul

xi
Acknowledgments

I would like to express my heartfelt gratitude to the following individuals who have been
instrumental in the creation and completion of this book.
My dearest friend and mentor, Akshat Paul, whose guidance, expertise, and
unwavering support have been invaluable throughout this journey. Your wisdom and
insights have shaped not only this book but also my growth as a technologist and as a
writer. Thank you for believing in me.
To my late father, Ram Ratan Haldar, who always taught me to work hard and
instilled in me the love for knowledge and learning. Though you are no longer with us,
your presence and influence continue to inspire me every day.
To my mother, Champa Rani Haldar, whose unwavering love, encouragement,
and sacrifices have been a constant source of strength and motivation. Your belief
in my abilities and your unwavering support have been the driving force behind this
accomplishment.
And finally, to my loving wife, Prachita, who sacrificed many late nights and
weekends without me while I was working on this book. Thank you for your unwavering
support, encouragement, and patience.
I must also extend my earnest appreciation to the team at Apress: Jessica Vakili,
James Robinson-Prior, and James Markham. Your combined knowledge, unwavering
support, and collaborative efforts were pivotal to the book’s successful completion.
I am deeply grateful to each and every person who has played a role, big or small, in
the creation of this book. Your contributions, encouragement, and belief in my abilities
have made this book possible.
—Mahesh Haldar

xii
Introduction
As we progress further into the digital age, serverless architectures and web applications
are continuously reshaping the technological landscape. As technology leaders, we often
faced challenges when searching for thorough, hands-on resources on this topic. This
motivated us to compose Serverless Web Applications with AWS Amplify, a book that
represents the guide we wished existed when we first ventured into the field of serverless
architecture.
Serverless Web Applications with AWS Amplify is intended for a broad audience – from
newbies taking their first steps in cloud development to advanced developers aiming
to broaden their understanding of modern web application technologies. While prior
knowledge of cloud computing might be helpful, it is not a prerequisite. The aim is to
assist all readers in scaling their web applications, reducing costs, enhancing scalability, or
simply exploring the expansive domain of serverless web development with AWS Amplify.
The structure of this book is carefully designed, beginning with the fundamentals
of cloud computing and serverless architectures, followed by an introduction to AWS
Amplify. Subsequent chapters dive into topics such as authentication, authorization,
REST APIs, GraphQL, and offline-­first applications. As we progress, we delve into data
and storage, analytics, continuous integration/continuous delivery (CI/CD), with AWS
Amplify, and, eventually, the integration of AI and ML capabilities into your applications,
by building interactive chatbots and building application to convert text to speech.
In addition to detailed explanations, this book includes practical examples, code
snippets, and hands-on exercises to solidify your understanding of the concepts. To
further support your learning journey, additional online resources are available.
Reflecting on our journey, we recall the intriguing challenge that programming
initially posed for us. It was the transformative power of code, the ability to turn ideas
into reality, that fueled our fascination. AWS Amplify, in particular, revolutionized our
approach to web application development. This book is the culmination of our journey,
experiences, and accumulated knowledge, which we are eager to share with all readers.
As the famous quote by Albert Einstein goes, “The measure of intelligence is the
ability to change.” By the end of Serverless Web Applications with AWS Amplify, our
hope is to provide you with the knowledge and skills to adapt to the fast-paced world of
serverless web applications, fostering your growth in this dynamic field.
xiii
CHAPTER 1

Introduction to Serverless
In the world of cloud, scale is the game changer.
—Akshat Paul

Cloud computing has transformed the way we store, process, and manage data. In
this chapter, we will cover the basics of cloud computing, including its evolution from
traditional IT, its key advantages, and the next generation of cloud technologies. We will
explore serverless architectures, BaaS (Backend as a Service) and FaaS (Function as a
Service), discussing their benefits and weaknesses. We will also introduce AWS Amplify,
a platform for building web and mobile applications with AWS services, and guide you
through setting it up locally and configuring the Amplify CLI with AWS.
Whether you’re new to cloud computing or an experienced developer looking to
learn about next-generation cloud technologies, this chapter will provide you with a
solid foundation to build upon. So, let’s dive into the world of cloud computing and
explore the latest and greatest technologies that it has to offer.

A Little Background
In 2017 at AWS re:Invent, I became intrigued by a new architecture for application
development called serverless architecture. Initially, I had reservations about serverless
applications, as it seemed like someone else would be running a server for me, which
meant giving up control. As a developer, I was reluctant to relinquish control over my
application. However, I soon discovered that serverless architecture offers much more.
In this book, we will explore how this game-changing architecture can save developers
a significant amount of time on repetitive tasks, allowing them to focus on tasks that
have the maximum impact. But before we dive into that, let’s take a brief look at the
background and history of how we arrived at this point.

1
© Akshat Paul, Mahesh Haldar 2023
A. Paul and M. Haldar, Serverless Web Applications with AWS Amplify,
https://doi.org/10.1007/978-1-4842-8707-1_1
Chapter 1 Introduction to Serverless

If we time travel back to almost 20 years and see how traditional IT used to work, life
was not easy. There used to be a dedicated team to handle all the operations tasks of the
server setup and maintenance, and once the servers were ready, the developers would
be writing business logic and deploy the application on those servers.
The server operations team was responsible for setting up firewalls and compute
servers, installing the operating system, and configuring database servers. Additionally,
they were tasked with monitoring the temperature of the server rooms to prevent server
failures caused by excessive heat. They also had to plan for potential damage caused by
natural calamities such as heavy rainfall or other extreme weather events.
In the past, hosting an application required a significant amount of time and effort.
Before writing the first line of business logic, one had to perform a series of operational
tasks. This was akin to having to build a car from scratch before embarking on a family
trip. It was an extremely painful and time-consuming process.
However, a revolutionizing change came in the form of cloud computing. Services
such as AWS transformed the hosting model. Rather than building a car from scratch,
users could now simply rent one and focus on itinerary planning and enjoying the trip.
With AWS, hosting applications in the cloud has become incredibly easy. There is
no need to invest in physical space or worry about maintaining data centers. Compute,
storage, and databases can be quickly provisioned on demand, without having to worry
about setting up and maintaining hardware.
This approach saves companies from up-front investments in procuring hardware,
paying rent for a data center, and paying the bills for electricity. In addition, it enables
businesses to scale their infrastructure as per their requirements, without having to
worry about infrastructure management. As a result, cloud computing has become an
essential component of modern software architecture, and AWS is a leading provider of
cloud computing services.
EC2 (Elastic Computing Cloud) from AWS (Amazon Web Services) was one of the
early Infrastructure as a Service (IaaS) products. IaaS allows users and companies to
buy computing capacity on rent rather than setting up and buying all those physical
machines on their own. It allowed them to provision infrastructure just in time when
required, which means the commissioning of machines to availability will happen in
minutes, if not in seconds. This was revolutionary at that time to even think.
IaaS is a type of cloud service that offers required resources like compute engine,
database, storage, artificial intelligence services, and networking configurations on
demand; these are basically on the model of pay as you go. Over the years, companies

2
Discovering Diverse Content Through
Random Scribd Documents
‘We must be the same,’ she said, with all the deep liquid softness
in her voice, that was missing from her gaze. ‘Oh! I knew this would
come one day, I knew it would. And I did nothing to prevent it. The
fault is all mine.’
‘The fault?’
‘I am the wretchedest woman that ever lived,’ sobbed Victoria,
suddenly sinking to the ground in a passion of tears, and beating it,
in the wild despairing way of her sister-savages, when the boat took
their sweethearts away—statue no longer, but very flesh and blood
in every quivering nerve.
I did not try to raise her, I did not stir. In a few moments, when
the paroxysm had passed, she raised herself, and then came, in the
tenderest way, and took my hand, and looked straight into my eyes,
this time, through the blessed dews that dimmed her own.
‘You must know it. Some one else loves me. The word has been
spoken. I am promised. Come with me—but never tell a living soul!
Then, I should die.’
She led me swiftly to a small grove of wild trees, nestling in a dip
of the rock, and thin and poor, for they saw neither the eastern nor
the western sun. And, plunging into it, her hand still holding mine,
then climbing again, after the sharp descent, she stopped before a
dwarf-tree, where the Ancient would never have thought of looking
for any infraction of his forest laws. A rude monogram was carved
on the tree, with a date and two crosses.
‘We cut them together on our last day,’ said the girl, laying her
finger on one of the crosses, ‘and this was mine. This was cut from
his coat the same day,’ and she drew the wretched old navy-button
from its nest in her pure bosom. ‘Now you know all. I am promised;
and if I forget it, how can I ever say my prayers again?’
The monogram was V.A., and the A., I suppose, was the baptismal
initial of the mysterious Curly, who won the great battle with the
slave-dhow, and whose laugh and smile divided the honours of
admiration with mankind. Victoria’s poor secret was hardly worth the
telling, for, of course, I had guessed it long before. But what I had
not guessed was this fidelity of daily, hourly remembrance to the
vanished hero of a vanished ship—now, perhaps, firing her guns of
joyous salutation in some haven on the other side of the world.
Did I hint this to the beautiful devotee? Not I! One moment of
temptation came, but it passed; and I was spared the meanness of
tormenting her with a doubt. Since Curly was her religion, let him be
her religion still. Here was his shrine. It was hung all about with
strange little memorials of him that looked like aids to worship,
votive offerings of bits of ribbon on the branches of his sacred tree.
A necklace of shells, fastened in its place with pins, formed a border
in alto-relievo for the monogram and the date. In due course, no
doubt, there would be an altar for the navy-button and a temple for
the altar—so such things grow. I remembered what the girl had told
me of the old strain of idolatry in her blood. Yet truth and love are so
entrancing to the gaze that, in regarding them, the real amateur
soon loses all thought of self. The picture in this virgin’s soul was a
master-piece, not to be marred by a touch—Curly in his orisons, ever
praying with his face towards the Isle; seas and continents between
them, yet the electric thread of sympathy only the longer on that
account.
All this I fancied forth, and, as usual, in that kind of snap-shooting
at truth, I could not be quite sure of my mark. With all her hope and
trust in Curly, Victoria seemed full of a strange disquiet about him,
not easy to explain.
‘Five ships here since he left,’ she said, ‘and no word or token from
him—not so much as one of these,’ and she returned the button to
her breast. ‘The black people have killed him, perhaps. Every night
and every morning this last month I have come here to ask for a
sign of him, living or dead. You remember that night I saw the shape
on the Ridge: I half fancied—that was why I was so afraid; just
because I was with you. Have I done anything wrong? Have I done
wrong? Nobody helps me. I seem to stand all alone.’
‘Victoria, if you talk like that, I must tell you that I am by your
side.’
‘Dear, good friend, yes, I seem to be forgetting you. Why is it so
hard to do right? Why is our choice always between pain and pain?’
‘You shall not choose, princess; I will choose for you. Be my
comrade, and only that. I will ask for no more. As for me, let me be
to you what I like, what is best for me. All wisdom is in loving you,
and I want to be wise. If I must not speak to you, let me spend
precious hours by your side, looking, learning, for your eyes light for
me the dark places of the world.’
‘Comrades then,’ she said, smiling; and she gave me her hand.
CHAPTER XVII.
A MEDITATION.

So now, I think, I begin to see why I have been sent here—not to


give lessons, but to take them. My education has been neglected,
and I am coaching for a pass in the higher learning of life. I am
reading with Victoria—reading in the deep eyes, without book. It is a
course of social economy by a new method. The method is to look
on this image of the Divine, as intently as may be without being
caught in the act. I must not be caught; half of the gusty anger of
the gods with adoring mortals comes of their dislike of being stared
at. And, besides looking, there must be listening—listening with the
heart. The ear will not do; the true message of this exquisite piece
of being is only for a finer organ. Put a microphone in a cave, and it
will register the beat of the earth’s breathing: with a still more
delicate instrument, perhaps, this girl’s elemental nature, at its
stillest, will be heard to speak. As soon as my heart was stirred, then
truly she began to be audible to me—blessed day!
And to give me delight, as well as profit, she has not the faintest
idea of her function. Often I get the benefit of a whole morning’s
lecture, requiring copious notes, while, for all she knows of it, I have
but watched her as she manœuvred a battalion of fowls.
A grand provision of leisure for the true work of life seems to be
her chief instinctive aim. She has the genius of indifference to trivial
things; she is never busy with aught that does not truly count. The
idleness of hurry is unknown to her; she is always free for essentials
—a true word, a noble action, a great thought.
But this is lover’s talk. I cannot help that; lover’s talk let it be, so
only she cannot overhear.
I am a true lover in this, that the things she says to me are as
nothing to the things she seems to say. I do not want her to say
much. I can say for her all I most want to hear. She idealises the
world for me. She is a sublime suggestion. She only starts the game;
I play. Worship is in the worshipper. She brings out my highest,
truest, best. A something is within me; she is its mystical
correspondence in warm life. She seems to speak things to me, she
seems to be things to me. Are these things true of her? What care I:
they are true of me!
So, then, for me, she is a great artist in being. She lives to beauty,
the sole end. She does naught only for the thing done; there is also
the way of doing it. I note her placid disdain of a certain hen, that
has an absurd habit of hatching by quantity, and addles half the
brood. The other half, for want of due maternal care, are a species
of bush-fowl that have lost their way in civilisation, and Victoria
spends days over their bags of bone and feathers, to bring them into
harmony with her great law. I am sure she thinks, though she might
never know how to say it, that every problem of being is, in the
profoundest sense, a problem of manner. How do you love, hate,
suffer, and rejoice; nay, how do you eat and drink? There are higher
proprieties, even in this art, than the management of peas with the
fork. Is it after the manner of the farm-yard, or after the other? I
remember her little touch about the pasturing brutes. The brutes,
too, renounce, but not as a fine art. It is only their ‘needs must
when the devil drives.’ That was her meaning. They only do without;
man gives up, because man alone is the artist, and art is choice.
Living or dying, how slight as ends in themselves! but how you live,
how you die! Is the piece well acted, or have you but got through
your part? Who wants it, merely as a part got through? Not that
greater than Theseus, for certain, before whom this dream-play is
played.
That picture of the old life troubled me so, that grand composition
of the Exchange steps. It would not come right. Here is one whose
mere presence brings everything into its place. Let her but stand
beside the easel, and I get the key at once. Now I see where it was
wrong; now could I go among the rushing, blurred figures of my
sitters, and ask them, for the love of God, and, still more, for the
love of man, to keep still. I could say to them, as at her bidding,
‘Piano! piano! you are perishing of over strain. You, the higher up,
why this frantic scraping for useless currency? What can it do for
you? How much of peace comes out of it, how much of fineness of
life? What are you when all is done—when you have sat at meat
with my Lord, and added the Hall in the country to the mansion in
town? Have you yet found out the faintest inner meaning of one of
the pictures on your wall, of one of the books on your shelf? You
think Walter Map is for monkish Latin, and that other’s vision of “all
the wealth of this world, and the woe, both” merely for a scholar’s
treat. Malheureux! rushing away to your daily drive for more
canvases, more bindings, more horses of swiftness, more furniture,
in a word, and more dinners of the stalled ox. The greed makes the
hurry, and the wasteful idle hurry spoils the life. Oh, the grim set of
your jaws, the thinly veiled hardness of your eye, even at the sacred
hour of rest and relaxation! What are you but a huge river-pike in
black and white! More leisure, friend, less lust of gear. Cut away the
hindrances to living, and begin to live. Take nothing in but what you
can digest to true use, which is beauty of life. What a scandal, if you
were caught and opened in an unguarded hour, and half your
stomach were found lined with vanities as profitless as the bits of
shoe leather and old corks so often found in the maw of your
prototype—vanities of things bolted to the end of bolting, titles of
park and meadow where you can never find a flower, visiting-lists
where you can never find a friend, cards for music where you may
never hear a note that breathes one of the secrets of Heaven. Your
bolting for waste takes so much out of the common stock for use.
Your grab for superfluity baulks so much honest craving for need!’
You work for it! Will no one deliver us from the tyranny of that
cry? Work for what?—to have and to hold, to leave less and less for
the weaker, till finally, in the lowest hell of it, the huge crowd of the
uncanny have to learn to call their base scramble for your leavings
the battle of life? More leisure for these, from the obsession of the
one degrading thought—how to get the dry crust and the cold
potato for the day’s meal. For, true living begins only when such
things are done with, when the belly is timbered with victual, and
the back clothed, and when the spirit, that is the all-in-all, is left free
for its shaping work. More leisure for love and friendship, and kindly
deeds, and joy—the true business, which, if we were not blinded,
would have their banks and their depôts, and their pushing agents in
every street. The real ‘Theory of Exchanges,’ what is it but the
philosophy of the diffusion of the humane self? Oh, the hard world
of the self-helpers, with their Smiling apostle! oh, the hard world!—
the hard world of all the workers, high and low, leisureless for
profitable toil, the real task hardly so much as begun—too hard even
for the very martyrs, robbed of their right to smile in the death-hour,
by the horrid fear that all eternity will never set the muddle straight!
Jesus, what a sight! the sight of the factories, right through, from
the tiniest monkey-faced minder, up to the gaudy boss-bird in his
mahogany cage. This organised labour? fie! oh fie! Organised? for
what? for the sake of the labour, or for the sake of the labourer—the
only product that really counts—for the sake of the cottons, or for
the sake of the garment-stuff for the souls of men? Is labour man’s
end, or his means? his master, or his ministrant? Surely the first true
end of making cottons well is to make the maker better. And, if one
must be spoiled in the process, for Heaven’s sake let it be the
cottons, though, of that, no need. Every thread of their fineness
must come out of some inner fineness in him. How pathetically
absurd to have them smooth, and white, and close-textured, and
firm in the pull, and him coarse, foul, loose-minded, tearing in the
Devil’s hand under any strain of lust or rage! But why insist on a
commonplace when all the wisest feel that truth, and speak it now?
The work exists for the worker; let us never cease to proclaim it, and
have done with the old lie—the worker for the work. How sad the
sight when you pass from one to the other! The expectation born
naturally of the fine thing is always of some finer animate thing
behind. Hence the craving for sight and knowledge of heroes. But
see the slop-made piece of human handiwork that skulks as maker,
behind the screen of drawing-room intrigue, or behind my lady’s fan
—shabby, shambling, beer-bedewed, only so much of him washed as
might soil the satins and brocades he shapes for others’ uses! Go
into the dismal slums that manufacture for Mayfair, and follow the
dainty casket for jewels from one end to the other of the line—from
the rickety workshop, airless, and only not lightless, too, because the
light is wanted for the labour, to the still daintier casket for men and
women, in which it finds its cushioned rest. If this beautiful
correspondence, why that grotesque incongruity? If these who touch
it as owners are as fine as itself, why not, also, they who touch it as
makers, at least with the inner fineness, and a certain amplitude of
material life? But no: a dozen have died to all the true ends of being
to make that pretty toy, have been reared in the belief that all the
fineness they have is to go into that direct, and not, in the first
place, into their own lives.
For nothing sanctifies a wrong, not even a headache in doing it;
and ‘honest industry,’ which makes of patience and thrift but the
foothold for its spring upon the back of stupidity or improvidence, is
the sinfullest sin of all. Be not so sanctified of air, O new hot-
gospeller of work! Your sole right over knaves and fools is but the
right to help them to better wisdom out of your heart and hand.
Your virtue was not given to you for investment at forty per cent.
The knaves and fools are diseased—that is all; and you, when you
stoop to personal profit out of their infirmity, are worse diseased
than they. A terrible malady, yours, of hard work to self-regarding
ends; infectious to the last degree; a sort of dry rot of life.
Believe this—individualism, self-help, to any other end than the
help of all, is the great untruth. Believe it, in spite of the Smiling
apostle, who has done more harm with the nostrum of his title than
Abernethy with his invention of blue-pill. Go on being self-helpful, if
you must, for thirty, forty centuries more; only not for ever! Take a
lease of five times nine hundred and ninety-nine years, yet fix some
term! Give us a little hope, and name the happy day when the
freehold of light and life and jouissance shall revert to all.
Try the other thing as a regimen, once in a way, as a new diet for
your soul’s health—as a new quack medicine, then, powerfully
recommended by a sufferer: will that appeal? One poor little pill—it
cannot hurt overmuch. Cut off some of the work that ministers but
to your ease and luxury, and that, with interest piled on interest of
infamous wrong, makes the ever-growing load of sorrow for the
mass. Cease to be competitive and self-helping, at least in precious
moments when you feel your heart sick. Go back to it, if you will, if
you can, when you feel a man again, as convalescents resume their
mulligatawny and hot lobster when the plainer roast and boiled have
set them right. Treat your mind like a stomach, and give it a touch of
nature once in a while. Then, if you have a taste that way, still
return for your gorge at the banquet of work. Only, try to include in
it some concern for the most truly helpless, the stupid and the base,
and to find the relish in the end rather than the means. For the end
is not to make riches of mind, body, or estate for yourself, but to lift
up life for one and for all.
This is how I interpret Victoria. This is what I think she means. Let
me put it to the proof.
CHAPTER XVIII.
A LORD OF INDIA.

I have to tell her one day of the Empire, the power, the stretch of it,
the count in millions of miles, in millions of souls; the largest
empires, living or dead, mostly but parishes beside hers and mine.
In mere size, Russia, even, beaten by an eighth, the Grand Republic
beaten all but three times over, the late Darius the Great beaten five
times clear—more than forty Germanys, more than fifty Spains! Our
own Mother Island but a dot in a waste beside it, Victoria’s Island
but a dot on the dot, the parasite of a midge. With this, the figures
for commerce, the figures for sails on all the seas that wash the ball,
the figures for wealth—a round nine thousand millions sterling, if we
were sold up to-morrow, and, for all the bad years since ‘seventy-
five, a steady hundred and eighty millions added year by year to the
hoard—our swelling liver almost putrid with the gorge of gold.
Victoria is delighted; wants to measure Pitcairn with her sash—is
stopped; becomes light of heart, effusive; carolleth; offers to take
me to the Cave on the ledge, for a treat—the Cave of the Great
Scrape, I have always called it—pays me a sort of reverence, as one
who has come from the sun of this colossal system—is stopped
again. Then, after purring foolishly over the totals, like a great happy
kitten that has got all the thread in the world for a ball, asks to have
them unravelled in measured inventory. Is told something about
Australia, about Canada, about the Indies. Seems to see it all with
ever-dilating pupils, as a child before a pageant of pantomime. Sees
it in procession of countless tribes, armies, emblemed industries,
brother peoples, subject kings; warriors coated in mail, in crimson,
or only in the black of their own skins; priests bearing every symbol,
from the notched stick to the cross; mechanics, from them that
smooth with the flint hatchet to them that smooth with the
Whitworth plane; Nature’s experiments with the type, from the
bushman to the man from Mayfair. At this, and long before the
procession closes, shows signs of worshipping me again, as a sort of
deputy lord of India and the other dependencies in Europe, Asia,
Africa, and America. But I turn away.
For modesty forbids, not to speak of the fear of detection. All the
lords of India are not so plump; and I sometimes wonder what the
lordship means. I am a lord of India, it is true, but so is Snip there,
in his sweating-shop, and Swart carrying the sandwich-board, ‘lords
of human kind,’ as it was once put; but let us keep within bounds. I
think of the lordship whenever I meet Swart, whenever I take stock
of all the figures that make the huge stain of shabbiness upon our
moving crowds. A lord of India, too, the man in threadbare who
turns out every morning from Kentish Town or Somers, or other of
the circumjacent wastes, to look for a job in the City, plodding
steadily forward for the hundredth time, with fifteen shillings a week
as the goal of hope. Clean shaven this lord, got up for ‘respectable
appearance,’ down to his last ha’penny, in shining boots, inked for
the cracks and patches, and shining coat; everything shining about
him, but the hard and hopeless face. He is certainly of the Imperial
breed—no one can deny him that—a lord of India, an heir to the
ages of struggle and victory on battle plains dotting our fifth of the
globe.
But Swart is the best example, and Victoria is easily stimulated to
the entreaty that I will tell of him all I know. It is worth telling, in
good faith.
‘I first met Swart in Regent Street, a little while before I came out
here. He was sandwiched between two boards of “India in London,”
and there was something so spiritually picturesque in the ruin of
him, from his baggy hat to his mere suggestion of a boot, that it
drew me to his side. I was drawn by curiosity rather than by pity, as
a naturalist who might want to see how the wood-louse lives.’
‘Where is Regent Street? and what is a sandwich-man?’ said
Victoria as I began the tale.
‘We must reserve all that for the footnotes. If I am to keep on
moving, you must let me get under way.’
‘Well, we struck up acquaintance, Swart and I. Did I say that he
was tallish, thin, bent, and grizzled, and foul? I want to get all that
over as soon as may be. Sixty, or thereabouts, I should say, as to
age; a not unkindly face, and not unhandsome, but for its furrows
and puckers of mean cares—a good face spoiled.’
‘I wish I knew what a sandwich-man is,’ she murmured; ‘but it
does not signify. Please go on.’
‘We struck up acquaintance, and I used to walk with him up and
down his beat—he in the gutter, I on the kerb. He had been a
soldier, and had helped to win India back for England at the
storming of Lucknow. He was quite proud of the whole achievement,
and of his share in it. “They was nigh slipping clean away, sir,” he
would say of his Indian fellow-subjects. “You cannot think how nigh
they was; but we just cotched ’em by the tail.” It was pleasant to
see Swart proud of anything; it did so much to improve his air. At
such moments, he seemed almost a man. They were but sun-rifts in
a black sky, of course. Sometimes the policeman would threaten to
run him in, for trespassing on the kerb with the edge of his board.
This would tend to drive him wide of the gutter; then, his foreman
would come by, and growl an oath at him for not walking straight in
his furrow, and threaten him with the sack.’
‘“The sack!”’ said Victoria softly; ‘“run him in!” I am not
interrupting, you know, I am only saving up.’
‘I asked Swart to let me go and see him, but he said “Not yet.” He
was living in a common lodging-house, and he was not allowed to
receive visitors. “If I was allowed,” he said frankly, “I shouldn’t like
you to come. They really ain’t fit company for a gentleman, or, for
that matter, for a common man. We had three took out of their beds
last night for robberies from the person, and one for burglary and
murder. What with the police coming in and out of the room, and
flashing their lights on your faces, there was no getting a wink.
There was sixty sleepin’ in our room, and the row woke most of us
up. You may fancy what it was after that. Besides, I’m gettin’ too old
to fight for my place by the kitchen fire, and I’m cold half the time.
Then, if you ain’t got your fourpence every night, out you go; and I
can’t tackle the Embankment no more. I want a place of my own.”’
‘You might tell me about the Embankment now,’ she said, ‘but, of
course, we’ll make a note of it, if you are going to get cross.’
‘It is an open thoroughfare, the finest in London, bordered, on one
side, by gardens and public palaces, on the other, by the river. The
people who cannot afford to sleep as Swart sleeps are allowed to
sleep there, as a favour, for it is against the law.’
‘But do you mean to say——?’
‘Yes, indeed, I do; that is just what I do mean.’
‘But how can the others go to bed, then?’
‘Well, how can you, for that matter, now you know it? You get
used to such things.’
‘I would never go to bed if I lived there. Never, at least, till——?’
‘A week or two later Swart told me that his place was ready, and
that I might call. He had been saving slowly for his furnishing, for, as
he observed, what can you do on 1s. 3d. a day? He merely “had his
eye” on a table. I let him keep his eye on it. The experiment was too
interesting to be spoiled by help from me.
‘His place was in White Horse Yard. White Horse Yard, you must
know, Victoria, is a London slum, one of hundreds as clearly marked
on the map, and as well known, as Buckingham Palace or Grosvenor
Square. The description would interest you, as a semi-savage, but to
us worn children of civilisation it is too trite for pleasure or profit.
Every social reformer begins by describing White Horse Yard: it is
the sign of the “’prentice hand.” Swart’s place was reached by a
narrow causeway, reeking with every kind of abomination, and by a
staircase, dark and rotten, and swarming with vermin, as I had
afterwards good reason to know. Here, at the summit, was his back
garret, with his bed of shavings, and his table, made of a packing-
case turned upside down. His neighbours worked at many trades,
including that most ancient one of private plunder. The front garret
was the home, as distinct from the place of business, of “one of
them gals.” Swart could never be induced to be more explicit. On the
floor below, they made lawn-tennis aprons at threepence a dozen,
and army coats. They did something with rabbit-skins in the back
drawing-room, for, one day, when Swart opened his window for air,
we were nearly choked with a furry adulteration of the precious fluid
that came in with the fog. A housebreaker who had been out of
work for six months or more, owing to an injury received in a scuffle
with a policeman, occupied the front kitchen, and, by general
consent, he was the quietest man in the house. The back kitchen—
but no, nothing of these premises below the ground level, if you
please; nothing, even in distant allusion, in veiled hint; nothing
about the back yard either, or about the water-butt therein! If you
are going to be foolish, Victoria, I shall just leave off.’
‘I am not foolish.’
‘What are you crying about?’
‘If we let people live so, we should be afraid of God; I think we
should be afraid of every thunderstorm.’
‘The lightning is very tender with us—a chimney-stack now and
then; seldom the steeple of a church.’
‘It is not true. You are just saying things to me. There are missions
in all the cities to look after the poor people. I have read books.’
‘Of course. There were four missions in this very circumscription of
Swart’s, and one Inspector of Public Health.
‘The chief thing the missionaries preached was the sanctity of
submission, or that sanctity of property which had made this dismal
hole what it was. They preached it in a pair of parlours, only less
dismal than Swart’s garret. Their object was to effect a change of
heart as a condition precedent to the change of linen—the cart
before the horse. Of the night of material ugliness around that was,
on one side, the parent of all this spiritual ugliness, they seemed to
have no idea. On Sunday, some of the poor people in the yard went
to the preaching, dubiously, yet still hoping there might be
something in it, their dim intuitions of logic being hardly strong
enough to expose the mockery of its gospel of love. Others went to
the drink-shops, and they were the wiser, for they found a little
brightness there. There was one drink-shop to every two hundred
inhabitants; and the missionaries, who were quite as dull as their
hearers, never understood the reason why.
‘Swart read his paper meanwhile, and joined the crowd in the
“pub,” when he had a penny to spare. He never missed his paper,
being quite a hopeful kind of fool, and inclined to believe that the
better luck was just going to begin. He had revelled in that
anticipation, from Sunday to Sunday, for at least five-and-thirty
years. The foreign intelligence, especially, used to cheer his soul. We
were always taking something to round our Empire off; soon it
would be quite trim, and then! “You may reckon we’ve got Burmah,
sir,” he said to me one day, when news came of the execution of a
fresh batch of dacoits. “It’s as good as ours. There’ll be fine times,
I’m thinking, soon. Such a rumpus, indeed, when it’s all for their
good!” He was really angry with the Burmese. He regarded their war,
and all the other little wars, as only so many accidents of human
perversity that tended to defer the grand opening of a vast
humanitarian entertainment known as “Better times all round.” He
had hoped the curtain was going to rise, when India was quieted
down, in the pit. Then came the stupid interruptions from the
Abyssinian and Ashantee sections of the gallery. Then the Afghan
and Zulu fights at the doors. Next, “them there fellers in the
Soudan.” Now, “the Burmah lot.” Swart had been waiting through all
this for a curtain that never stirred.’
‘The curtain is to hide the stage when they are changing the
scenery,’ she said, wandering from the subject for a moment, like the
big child she was. ‘It is let down five times in most of Mr.
Shakespeare’s plays. I know.’
‘Yes, you know, Vickey, and so did Swart. Swart was just the man
for that kind of stage-play, being one of those profounder fools who
take everything as it is offered to them, and who will very
contentedly accept two deal boards and a sheet of canvas for a
blossoming tree. They had told him that he, too, was a lord of India,
and he believed it; and he was quite touched, as with the sense of
an accession of personal dignity, when his Sovereign was made
Empress as well as Queen. As he would often observe, all the people
in his court were lords of India, if they only knew it, heirs to the
Great Mogul—for he had a smattering of history—conquerors at
Plassey, Mooltan, Moodkee, Sobraon, and the rest. All Clare Market
and Collier’s Rents, and all the Minories had their share in that great
heritage, yet they never gave it a thought.
‘They could not be got to see it in that way, there was the
difficulty. Swart had endless arguments with them on the calm
Sabbath afternoons, while they waited at the street corners, ankle
deep in slush, for the opening of the houses. He would hurl his
figures at their heads; totals for imports and exports, the growth in
shipping, the growth in trade. There was sometimes an inert
obstructive force in their stupidity against which he could not prevail.
The brighter witted mocked him openly, and always led the
argument back from the pageant of Empire to his own rags. The
duller merely spat, but there was dissent in their expectoration; and
sometimes he was obliged to fancy they spat at him. He would ask
me for help in his strait, and I lent him some of the popular
literature of Federation, where the right arguments are all set down.’
‘We have begun praying for Federation, every Sunday—just after
the Collect. The schoolmaster is writing a Federation hymn.’
‘Try to interrupt me as little as you can, my dear. It checks the
flow. Make notes, and we’ll settle it up afterwards.’ (She took off her
girdle and tied a knot for ‘Federation.’)
‘But I felt less interest in Swart’s dealings with others than in his
dealings with himself. That was the ever-present wonder. I found, on
probing his wound of penury, that he had been waiting for relief, not
for five-and-thirty years merely, but, in a sense, for five hundred. He
was of a most ancient stock, as indeed are most of us, if you will but
think of it; and for all the years it had flourished on this earth, in so
far as the straining vision could trace it through the night of time,
that stock had never escaped from its parent dunghill. And Swart’s
gaze carried back very far. For a man of his class, he had a quite
exceptional knowledge of family history, partly oral, partly recorded
on the fly-leaf of a family Bible, which, for the purpose of our
researches, I lent him the money to get out of pawn.’ (She tied
another knot at ‘pawn.’)
‘The Swarts knew themselves as far back as Anne; nay, with
allowances and conjectural emendations, as far back as the second
Charles. Here, then, was my opportunity, unique, as far as I know,
to get at a real pedigree of a Poor Stupid; how infinitely more
interesting than any pedigree of the baronage, if only by reason of
its rarity. I encouraged him, therefore, by every means in my power,
to leave the current affairs of the Empire for a season, and to talk
about the past of his own race. He was nothing loath, and, after
weeks of labour, we had a family tree drawn out for him that, for
hoary age, might not have been unworthy of a seventh Earl. We had
sometimes to make a perilous leap from bough to bough, as in the
best performances of this description, but we kept that secret to
ourselves.’
CHAPTER XIX.
PEDIGREE OF A POOR STUPID.

‘Swart then, to cast it in proper form, was of the Swarts of Norfolk,


and his family had been settled in that part of the country from an
extremely early time. They had subsequently removed to London,
and had planted offshoots in many of the great towns, but their
earliest family seat was a swineherd’s hovel on the bank of one of
the Broads. Swart’s father, Jeremiah Swart, more commonly known
as “Jerry,” had assisted at the rise of our great cotton industry, not
exactly as one of the cotton lords, but as one of the others. Swart
had often heard his history from his own lips. He was born in 1800,
and in 1816 he took another infant to wife, without the formality of a
visit to the parson. Babes of every age, from five and six upwards,
were common enough in the factories at that time, and they worked
from twelve to fourteen and fifteen hours a day. Puberty began
early, for the temperature of the factories was the temperature of
Bombay, yet, even with this chance in their favour, half the children
never reached a marriageable age. They perished like flies, and the
few that were left, like flies of a certain sort, had just time to
arrange for the propagation of their species, and then to die. Boys
and girls, men and women, worked together, lived together.
Inspection was unknown; control of any sort, on the part of law,
equally so; their common lodging-houses, not to put too fine a point
on it, were common stews. They toiled for just as much as would
keep their bodies together; and the rate of pay was calculated on
the sound economical assumption that they had no souls.
‘Swart’s father seems to have taken the same interest in public
affairs as his more famous son. He would often tell the boy of his
patriotic satisfaction in the Act of 1816, which regulated the
detention of Napoleon at St. Helena. He felt, as he used to say, that
they had got Boney safe at last, and he could now breathe as freely
as his fluffy cough would allow. Swart’s infant mother was indifferent
to that great event, for she was bearing Swart in her bosom, at the
factory, within three days of her delivery of him into this joyous
world. Having performed this function, she went to join her
ancestors, whose pedigree, I regret to say, it is impossible to trace.
Swart’s father used to remark that he had been less fortunate than
Prince Leopold, who, on taking the Princess Charlotte to wife, at
about this time, secured 50,000l. a year with her, dead or alive. He
meant to say, of course, that the grant was to be continued to the
Prince in the event of the lady’s demise. It was a generous gift, for
the nation had been left in extreme poverty and misery by the great
war. The Marquis Camden subsequently surrendered his sinecure,
“towards the relief of the public burdens,” in the handsomest way in
the world, and the Prince Regent found he could spare 50,000l. a
year from his own ample revenues, for the same purpose. Swart’s
father was particularly touched by this last act of self-denial, and he
expressed a hope that his Prince might never want a meal. The wish
must have been heard in Heaven. The people at large were not so
fortunate: they became like wild beasts with hunger; they rioted at
Ely, they rioted at Spa-Fields. The country blazed with incendiary
fires, as though for a second celebration of the Peace. The hero who
had conquered the Peace was not forgotten; and Strathfieldsaye was
purchased for the Duke of Wellington.
‘Swart’s father had once enjoyed the felicity of seeing his Grace,
and had taken so careful a note of him that he knew the number of
buttons on his blue frock-coat. It was not his only souvenir of
greatness:—“Father once met the Marquis of Waterford, when his
lordship was out on one of his larks. The Marquis gave father a black
eye, and half a crown.”’
Victoria knotted something again: I fancy it was ‘black eye.’
‘Darkness covers the Swarts for a brief space, but in the middle of
the eighteenth century they flash into view again with “Father’s
great grandfather,” sold into the Plantations for indigence, in the
flower of his age. Some of the workers had their fixed term of
servitude, just like the burglars now; their masters were at liberty to
whip them, and to impose additional years of servitude, if they ran
away. “He got nabbed in a rumpus,” says Swart, “when they was
taking old Commodore Anson’s treasure to the Tower. You look in the
books, sir; you’ll find that right. This here Commodore had sailed
round the world, and had made many rich prizes; and a million and
a quarter in treasure was taken down to the Tower to be stowed
away. There was thirty-two waggon loads of it, the old man counted
’em, and somehow our family’s never forgot the number. All our sort
turned out, as you may fancy, to see the waggons go by. Father’s
grandfather was a bit pushed at the time, and used to sleep on a
brick kiln, with a few other chaps out of luck. There was no sleep
that night; they couldn’t have closed their eyes, he said, if it had
been a bed of down. It was such a great day for England! They all
sat up singin’ songs out in the fields, till it was time to start and see
the procession. The old man allus said he wasn’t a bit drunk, for he
hadn’t tasted bite or sup that day. It was the sight of the waggons,
somehow, seemed to make him turn faint. Anyhow, I suppose he
behaved foolish, for they collared him, and as I told you, he was sold
off. He couldn’t give no account of hisself—they’ve allus been very
hard on you for that. Father’s grandfather’s wife went out after him,
all the way to this ’ere Plantation, wherever it was. It took her three
months to go, but she lost his address, and so she had to come
back. They never met again. She once did some washing for Mr. Pitt,
him that was made a nobleman: you’ll find that right. She died at
the washtub, that was the end of her. She was a game ’un, she was;
no mistake about that!”’
Poor Vickey! I see the great drops gathering, and I know they are
just going to roll over: so I push on.
‘“Some of our women didn’t turn out so well. I don’t want to foul
my own nest, sir, you understand, but it’s sometimes a great
struggle in a poor man’s family to get enough to eat for growing
gals. They always aimed above ’em though, our women did: I will
say that. One of ’em took up with a master bootmaker in Bond
Street by the name of Simmons—made for the Royal Family. That
was my grandmother, as she might be called. I’ve heard that I might
give myself the name of Fitz-Simmons, if I chose, but Swart’ll do for
me. I only mention it to show that she had not demeaned herself so
much as some might think.
‘“Father’s grandfather was the man in the corner of one of Mr.
Hogarth’s pictures—the one ’avin’ his ’ed battered with the pewter.
Ah, they was ’igh old times!”
‘I could but regard this reference to a family portrait as another
note of antiquity of race. There was even some trace of a family
library in a street ballad sung by a progenitor of Swart at the
Coronation of George IV., and still in excellent preservation between
the fly leaves of the book of Truth. In rugged, but heartfelt and
effusive verse, it called on the whole earth to rejoice. A family
museum of curios, often another note of lineage, was wanting,
except in so far as it might be found in a red waistcoat that had
belonged to Mr. Townsend, the famous Bow Street runner, who had
“once locked grandfather up.” Swart had heard that it was worth
money, but he could never get more than sixpence on it at the tally
shop, and he had offered it in vain to Madame Tussaud.
‘Here the Bible record, and Swart’s memory of the direct oral
tradition ended, but I could not have his story stop. I, therefore,
went down to the Heralds’ College, and to the Record Office, and by
liberal fees to certain yellow men called searchers, found out a good
deal more. They proved to me beyond question, as I had long
expected, that the Swarts had been always with us as actors in the
great drama of history, only the managers had not thought it worth
while to give them a line in the bills. As soon as I made it worth
while to search beyond the bills, Swarts seemed to become as
plentiful as blackberries. We found that nothing had been done
without them. Dig down into the foundation of any fair structure of
Imperial greatness, and you were pretty sure to come upon a Swart,
if only as rubbish for the filling-in. One of them was certainly among
the two-and-seventy thousand vagrants hanged, or otherwise
despatched, in the reign of Bluff King Hal. They were enclosing a
good deal at that time, and the Bluff one had broken up the
monasteries, where the Swarts had often found a meal. These
operations filled the country with vagrants, and the vagrants had to
be removed. They were flogged, and fined in one of their ears, for a
first offence, and hung up like flitches, for a second, and thus
effectually cured. A Swort or Swyrt, of Norfolk, which, as before
stated, was their country seat, had been branded as an able bodied
loiterer as far back as 1547.
‘To form an idea of their situation, one must watch a fly trying to
crawl out of a pot of jam. You leave him there in the morning: you
find him there at night. Never, never, in the summer’s day, nor in
dateless eternity, shall that fly get clear!’
‘You talk cruel on purpose: somebody just helps him out.’
‘Victoria, give me a chance! Suppose nobody helps him. When, by
heroic labour, he has cleared his forelegs, his wings are still coated
with the sugary mire; and, as he plants the forelegs down, to attend
to the rest of him, the forelegs are besmeared again. Let him resolve
to leave them behind, in his desperation, and he will but lose his
balance, and foul the wings once more. Poor fly! Poor Swart! Poor,
Poor Stupids! whose history through the ages is my humble theme.
The only difference is that the Swarts are sunk in slime instead of
jam, and that they have the power of breeding there, and leaving
their heritage of fruitless struggle to countless generations. Always
the slime is peopled with this race, and never shall they get out, till
God send a brother to scrape them. The tragi-comedy of the
situation is found when one, by miracle of discovery of a brother’s
body for foothold, wriggles himself free, and then stands on the
brink, to comfort the others with Penny Readings from the author of
“Self Help.”
For full seven centuries, as I could trace it now, had the Swarts
been waiting for the deliverer with a potsherd. Their history was a
history of illusions in the belief that he had come at last. Once,
clearly, they thought it was Kett, for there was a Swart in his
rebellion in 1549. I hear him at their foolish Litany of human rights:
“Look at them and look at us! have we not all the same form, are we
not all born in the same way?” Eternal protest! Nature’s everlasting
whisper to the innermost heart of man—never sufficiently answered
by a knock on his head from the outside! The Earl of Warwick and
his mercenaries were prompt enough with this response, yet the
Swarts were still unconvinced. There was a Swyrte—I can but think
it was the same family, and I am confirmed in that opinion by one of
our kings-at-arms—in Wat Tyler’s affair, in the fourteenth century.
The conjecture is that he was one of the “landless men,” whom the
lawyers of the time were trying to bring back into serfage, after their
extremely informal manumission by the Black Death. Nearly sixty
thousand persons, it may be remembered, perished of that pest in
Norwich alone, and this had probably convinced the Swyrtes that it
was time to be stirring. A sort of insane joy in the ravage wrought by
the disorder, as in a clearance for right and freedom, by the Devil as
redeemer, is apparent in some of the sayings of the time; and the
surviving Swyrte in the train of Tyler may have felt, in his extremity,
that he was open to a fair offer from that other side. The sentiment
is perhaps hereditary, for I remember to have noticed a strange
elation in the Swart of the Victorian era, when the late visitation of
Asiatic cholera was threatened, or as, I fear, he took it, promised, to
our shores. His manner exhibited the tremulousness of a great
uncertain hope, and his reading of the telegrams from Marseilles and
Paris in his Sunday paper took a rhythmic cadence, as though they
were portions of a saga. The circumstance is perhaps, incidentally,
suggestive of his Norse descent, but we must not go too far. Local
Kentish records tend to show that the earlier Swyrte just mentioned
had risen to a certain eminence in the movement, the highest
perhaps the family ever attained, for a man of that name
undoubtedly acted on one occasion, as deputy tub-bearer to the
“mad priest of Kent,” John Ball. Ball, as we know, was preaching,
five centuries ago, just what they are preaching at Clerkenwell Green
to-day. “Good people, things will never go well in England so long as
goods be not in common, and so long as there be villains and
gentlemen. But what right are they whom we call lords greater folk
than we? Why do they hold us in serfage? If we all came of the
same father and mother, of Adam and Eve, how can they say or
prove that they are better than we, if it be not that they make us
gain for them by our toil what they spend in their pride? They are
clothed in velvet, and warm in their furs and their ermines, while we
are covered with rags. They have wine and spices and fair bread;
and we eat oat cake and straw, and water to drink. They have
leisure and fine houses; we have pain and labour, the rain and the
wind in the fields. And yet it is of us, and of our toil, that these men
hold their state.” We may easily imagine the effect of such words on
one of this stupid race.
‘When Ball was thrown into prison, his deputy tub-bearer seems to
have joined Tyler as a man of action, for the name turns up in a
rude muster-roll of the gathering at Blackheath. He was possibly one
of the band that forced their way into the Tower, and pulled the
beards of the scandalised knights, promising to be their equals and
good comrades in the time to come. He never came within touch of
chivalry again, unless he happened to be among that village
remnant of revolt that fell under its maces in the wood at Billericay,
after a two days’ fight, for “the same liberties as their lords.” But this
is only matter of supposition, and it is more likely that the Swyrte of
Blackheath simply sneaked into town on the death of his leader, to
root his offshoot of this great family in the London slime.
‘I cannot find any trace of a Swart at Cressy or at Poitiers, though
many of that sort unquestionably left their bones in France. They
were not without a monument, however, but it was in their works.
Circumspice. It was in the wasted fields of Aquitaine, the stretches
of utter solitude, the patches of direst poverty, league upon league
of burnt homesteads, and of famine-struck hordes going mad with
misery and rage. For the French lords being captive, the French serfs
had naturally to raise the money for their ransom, and the agony of
the operation at such a season of ravage drove them into sheer
revolt. The captive lords, after the manner of their order, exhibited
an admirable self-control; and, with much dignity, took their meals
with the family in the English castles, while they awaited the
remittances that were to set them free. So blood will always tell! The
Swarts of England, to their ruin, had wrought this ruin to the Swarts
of France—as it was in the beginning, and, probably, ever shall be,
world without end. Victoria, there is a final word!’
But she only smiled faintly, and shook her head.
‘Here, I confess, I quite lose the scent of this interesting race,
strong as it must naturally be. That some of them were doing
something at the time of the Conqueror, the heralds, and even the
physiologists, assure me is beyond a doubt. I have looked for them
in the Bayeux Tapestry; and in one prostrate figure that is being
used as a foot warmer, while his betters are presumably enjoying a
view of the English landscape, I fancy I recognise the family nose.
For my own part, I am tolerably certain that some of them were
alive at Troy time, and that somebody was sitting on them then.
‘A wonderful old family, the Swarts, the Percys of the record but a
set of parvenus beside them, a family that, in all ages, has helped to
make the dark background for the picture of the beauty and the
pride of life; for the frolic group of Chaucer, for Cressy’s firework
blaze of triumph, for the Armada, for Blenheim, and for Waterloo;
for the grandiose spectacle of pomp and vanity in every field. Hey!
for the idle literature that all this while could sing its blasphemous
song of perfumed bowers, while the wynd reeked; for the idle art
that could find nothing more serious than a scheme of colour in the
contrast between these Royal purples and these beggar’s browns!
And hey! for the old, old Swarts, the true Ancients of Days! Surely
they are as venerable as the Vedas, and, beside them, the best of
merely historic stocks is but a mushroom growth. What a struggle
among the tuft-hunters to get the Swarts to dinner, could they but
see this! Such a family only want a blazon, to commend them to the
world. I would suggest a Jackass, gules, between a stick (uplifted)
and a bundle of wet hay. Motto (the same as that of the old King of
Bohemia—blind, like the whole race that bear it in good faith): “I
serve.” Crest: a Fool’s cap. Ever has that cap of the Swarts gone up
for the victory, while the caps of the Swarts’ leaders have been held
out for the reward. How have the Swarts shouted, honest folk, as
province after province rolled into the mass of Empire, till it
stretched beyond the purview of the sun!
‘Whatever he had lost through the ages, Swart’s joint-stock
lordship of India remained, and he was proud of it, as I have tried to
show. A Lascar was associated with him, as a boardman, in the
Indian exhibition: they were the best of friends, but Swart made a
point of walking first. It was a question of mere precedence, and it
was not unkindly done; they always took their pipe together, at the
midday halt in the mews. The Lascar was really Swart’s hierarchical
superior, in a business point of view. He received threepence a day
more than the others, because his complexion was suited to the
character of the show. With this natural advantage, and with a
turban manufactured with rare self-denial from the tail of his own
shirt, he was altogether a specialist of publicity for such things as
Indian Bitters, and the Turkish Bath. He was more of a philosopher
than Swart. He had accepted caste as a law of Nature and of God,
while the other, in the muddled English way, only took it as it came.
He could give chapter and verse for it from his holy books. “For the
sake of preserving the Universe, the Being supremely glorious
allotted separate duties to those who sprang respectively from his
mouth, his arm, his thigh, and his foot”—Read the Dharma Sāstra;
and be still!
But the difference, as he was wont to observe, did not end here,
for the foot is a thing of five toes, and there are toes, and toes.
Chancing one day to meet in the gutter another Lascar, whom he
suspected of a descent from the little toe, he spat on the ground,
and exhibited every sign of repulsion, though his countryman, who
was advertising an Arabian gum-drop, was in the same business as
himself, and, to all appearance, was as good a man. There were
really three toes between them, as he explained to Swart.
There had been an attempt to bring him into the fold of
Christianity, but it broke down. He had been led to the gate by a
member of a special mission who, without his knowing it, had given
his colleague of the little toe a rendezvous at the same place. He
endured the hateful presence as best he might, until the rite of
Communion required him to touch the cup that had just been
pressed by the other’s lips. Then he set down the untasted pledge of
love and brotherhood, and turned away.
‘He had brought his lady over with him, and she lived in the
seclusion of a Whitechapel zenana, in continual fear of the effect of
our foggy climate on her lord’s remaining lung. She was far from her
own people, and if she became a widow, how could she hope to be
treated with the requisite indignity during the funeral rite? Burning
was, of course, out of the question, but who would tear out her
nose-ring, and the cartilage with it, in the regular respectable way,
or buffet her, and load her with reproaches, for daring to survive
him? She knew her Manu and her Sāstras as many of our own
estimable poor know their own Holy Books, and they had taught her
that great lesson of humility to man which, in the end, all such
books are made to teach. “A woman is not to be relied on”—she had
the text by heart—“a husband must be revered as a god by a
virtuous wife.” Poor slaves of the slave! beautiful and tender
creatures, ever the most apt in the learning of subjection! when will
your turn come? Victoria, my tale is done.’
Victoria toyed with her scarf awhile as though to remember all the
points, then untied it knot by knot, in sheer weariness of soul.
‘And is that England, is that the Empire?’ she said, fixing me with
her eyes in a way I did not exactly like.
‘Oh no, not altogether. Don’t let me be unfair. There are hundreds
of square miles of beauty, refinement, luxury; exquisitely ordered
homes, fine-natured men, courteous, suave, poised, high-bred from
the bone; white women, oh, so white! some of them able to read
Greek—Learning robed and perfumed. And for parties, picture
galleries, libraries, when they give their minds to such things, they
are not to be matched. We are particularly proud of one square mile
bounded by Oxford Street, Piccadilly, Regent Street, and Park Lane;
and are wont to repeat the boast at public dinners that, for
intelligence, culture, wit, and the high qualities of civilisation, it has
not its territorial equivalent on the face of the earth.’
‘The greater shame for them; why do they leave the other square
miles as they are?’
‘There are charities, you know.’
‘Charities!—ointment for a cancer. What makes the disease? There
must be something going on that none of you find out. I know there
must be. How can all those fine people live a day, an hour, till they
do find it out? What do they talk about while they are having their
dinners? I know they could find it out, if they tried. Let us try and
find it out, before we go home: we have still half an hour left. I have
been thinking, all the time you talked: it must be selfishness.
Everybody gets what he can, instead of what he ought, and of
course the clever people get most. Then they give a little of it back
to the Poor Stupids in what you call charity, and go on making the
money and the misery all the same. That is the way it strikes me.
How do the rich people get rich? Don’t you know you can’t be rich
without doing wrong, whether you know you are doing wrong, or
not. Can you now? At the best, even, if you are not a robber, you are
using your cleverness to take some one else’s share. And to think of
all those people looking so nice, and smelling like flowers, and
talking like expensive books, and trying to get richer than other
people all the time; oh! the sly things! How do you grow rich? I
wonder how it is done.’
‘Always, at the beginning, of course, by getting as much as you
can for yourself, and giving as little as you can to others; buying in
the cheapest, and selling in the dearest is the accepted phrase.
Sometimes, this has happened so long ago that the possessors are
able to forget it ever happened. They are usually put up to do the
talking about unselfishness.’
‘Just what I thought; so the dealer that buys the match boxes
made in Mr. Swart’s house buys them, not for what he ought, but for
what he can.’
‘Can is the only ought in practical life.’
‘I see; and that makes the poor people hungry and cold.’
‘I suppose so.’
‘And when they are very hungry, and very cold, the dealer, and his
well-to-do friends give them a little soup and a blanket.’
‘That’s about it.’
‘Oh, how funny! how funny! how funny!’
‘What would you have him do?’
‘What would you?’
‘I don’t know.’
‘You do know. Is there anything but one thing—take less himself,
and give them more?’
‘Then he would not be so rich as the other match box makers.’
‘Well?’
‘And he would have to live in a smaller house.’
‘Well?’
‘And give up his carriage.’
‘Well?’
‘Then he’ll be damned if he’ll do it, Vickey, so there!’
‘That may be; I am only talking of what he ought to do. But I
think you are wrong. He would, if he knew, only he does not know.
Perhaps the clergyman sometimes forgets to tell him. Never mind
that; let us go on; it is so amusing. Tell me some other ways of
making money.’
‘Well, you invest in Companies, and take the profits as they come.’
‘Without asking how the profits are made, how the people live that
make the profits?’
‘Usually so. Now and then the question is asked, but the
questioner is called an eccentric. There was one shareholder that
made a great fuss about the tramway people, who are worked
almost into brutishness for the sake of the dividend. It was only a
woman, you know; and her out-of-the-way proceeding made her
quite notorious at once. The truth is, everybody feels that the poor
people would grind each other just as hard, if they could.’
‘Ah, the poor people would like to be just as wicked as their
betters! Is that what you mean?’
‘I think it is, Miss Socrates.’
‘But how do the betters spend the money? What can be the use of
it after all?’
‘The use of it? Did you never hear of yachting, hunting, pretty
pictures, pretty women, good wine? Poor little savage, you have
never had so much as a taste of life! Why you may spend twenty or
thirty thousand pounds in getting a good breed of race-horses, if
that is your hobby. You get a hobby, that’s the way it’s done—
horses, hounds, women, pictures, or china, anything will do—and
keep on sinking your money till you have the rarest and the best.’
‘Is there any taste in that way as to improving the breed of men?
Does a rich man ever buy a slum, and keep on playing with it till he
has turned it into a paradise?’
‘No; breeding is chiefly done for the shows.’
‘Are all the people in Europe as funny as that?’ said Victoria, ‘or is
it only the English? But see, the sun has struck the big banyan: it is
dinner time! What a lot you have told me, but you have only told me
half. There are Rich Stupids, I see, as well as Poor Stupids, and I
think the rich ones are the worse off.’
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookmass.com

You might also like