100% found this document useful (4 votes)
22 views66 pages

Practical Spring Cloud Function: Developing Cloud-Native Functions For Multi-Cloud and Hybrid-Cloud Environments 1st Edition Banu Parasuraman

Practical

Uploaded by

riccosoikan
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 (4 votes)
22 views66 pages

Practical Spring Cloud Function: Developing Cloud-Native Functions For Multi-Cloud and Hybrid-Cloud Environments 1st Edition Banu Parasuraman

Practical

Uploaded by

riccosoikan
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/ 66

Download Full Version ebookmass - Visit ebookmass.

com

Practical Spring Cloud Function: Developing Cloud-


Native Functions for Multi-Cloud and Hybrid-Cloud
Environments 1st Edition Banu Parasuraman

https://ebookmass.com/product/practical-spring-cloud-
function-developing-cloud-native-functions-for-multi-cloud-
and-hybrid-cloud-environments-1st-edition-banu-parasuraman/

OR CLICK HERE

DOWLOAD NOW

Discover More Ebook - Explore Now at ebookmass.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Practical Spring Cloud Function: Developing Cloud-Native


Functions for Multi-Cloud and Hybrid-Cloud Environments
1st Edition Banu Parasuraman
https://ebookmass.com/product/practical-spring-cloud-function-
developing-cloud-native-functions-for-multi-cloud-and-hybrid-cloud-
environments-1st-edition-banu-parasuraman/
ebookmass.com

Cloud-native Computing Pethuru Raj

https://ebookmass.com/product/cloud-native-computing-pethuru-raj/

ebookmass.com

CompTIA Cloud+ Guide to Cloud Computing West

https://ebookmass.com/product/comptia-cloud-guide-to-cloud-computing-
west/

ebookmass.com

Intercultural Experience and Identity 1st ed. Edition Lily


Lei Ye

https://ebookmass.com/product/intercultural-experience-and-
identity-1st-ed-edition-lily-lei-ye/

ebookmass.com
Holding (The Sports Quintet Series Book 1) M.E. Clayton

https://ebookmass.com/product/holding-the-sports-quintet-series-
book-1-m-e-clayton/

ebookmass.com

Royalism, War and Popular Politics in the Age of


Revolutions, 1780s-1870s: In the Name of the King Andoni
Artola
https://ebookmass.com/product/royalism-war-and-popular-politics-in-
the-age-of-revolutions-1780s-1870s-in-the-name-of-the-king-andoni-
artola/
ebookmass.com

After the Shadows Amanda Cabot

https://ebookmass.com/product/after-the-shadows-amanda-cabot/

ebookmass.com

Tratado de Ginecologia 1st Edition Febrasgo

https://ebookmass.com/product/tratado-de-ginecologia-1st-edition-
febrasgo/

ebookmass.com

MECANICA DE MATERIALES 7th Edition David F. Mazurek

https://ebookmass.com/product/mecanica-de-materiales-7th-edition-
david-f-mazurek/

ebookmass.com
Principles of Economics 8th Edition N Gregory Mankiw

https://ebookmass.com/product/principles-of-economics-8th-edition-n-
gregory-mankiw/

ebookmass.com
Practical Spring
Cloud Function
Developing Cloud-Native Functions
for Multi-Cloud and Hybrid-Cloud
Environments

Banu Parasuraman
Practical Spring
Cloud Function
Developing Cloud-Native
Functions for Multi-Cloud
and Hybrid-Cloud
Environments

Banu Parasuraman
Practical Spring Cloud Function: Developing Cloud-Native Functions for
Multi-Cloud and Hybrid-Cloud Environments
Banu Parasuraman
Frisco, TX, USA

ISBN-13 (pbk): 978-1-4842-8912-9 ISBN-13 (electronic): 978-1-4842-8913-6


https://doi.org/10.1007/978-1-4842-8913-6

Copyright © 2023 by Banu Parasuraman


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: Steve Anglin
Development Editor: Laura Berendson
Coordinating Editor: Gryffin Winkler
Copy Editor: Kezia Endsley
Cover designed by eStudioCalamar
Cover image by Aamyr on Unsplash (www.unsplash.com)
Distributed to the book trade worldwide by Apress Media, LLC, 1 New York Plaza, New York, NY
10004, U.S.A. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected],
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 GitHub (https://github.com/Apress). For more detailed information,
please visit http://www.apress.com/source-code.
Printed on acid-free paper
I would like to dedicate this book to my wife Vijaya and
my wonderful children Pooja and Deepika,
who stuck with me through the trials and
tribulations during the writing of this book.
I also dedicate this to my mom,
Kalpana Parasuraman.
Table of Contents
About the Author���������������������������������������������������������������������������������xi

About the Technical Reviewer�����������������������������������������������������������xiii

Acknowledgments������������������������������������������������������������������������������xv

Introduction��������������������������������������������������������������������������������������xvii

Chapter 1: Why Use Spring Cloud Function������������������������������������������1


1.1. Functions as a Service (FaaS)������������������������������������������������������������������������1
1.1.1. Implementation of an Enterprise Application����������������������������������������2
1.1.2. Migration ROI for a Portfolio of Application�������������������������������������������3
1.1.3. The Serverless Functions Concept��������������������������������������������������������4
1.1.4. Applying the Serverless Functions Concept to an Enterprise
Application���������������������������������������������������������������������������������������������4
1.2. Code Portability Issues�����������������������������������������������������������������������������������8
1.2.1. Serverless Container Portability Issue�������������������������������������������������10
1.3. Spring Cloud Function: Writing Once and Deploying to Any Cloud���������������11
1.4. Project Knative and Portable Serverless Containers������������������������������������13
1.4.1. Containers, Serverless Platforms, and Knative�����������������������������������15
1.4.2. What Is Knative?����������������������������������������������������������������������������������16
1.5. Sample Use Case: Payroll Application����������������������������������������������������������17
1.6. Spring Cloud Function Support��������������������������������������������������������������������19
1.6.1. Spring Cloud Function on AWS Lambda on AWS���������������������������������20
1.6.2. Spring Cloud Function on Knative and EKS on AWS����������������������������22
1.6.3. Spring Cloud Function on Cloud Functions on GCP�����������������������������23

v
Table of Contents

1.6.4. Spring Cloud Function on Knative and GKE on GCP�����������������������������24


1.6.5. Spring Cloud Function on Azure Functions on Azure���������������������������26
1.6.6. Spring Cloud Function on Knative and AKS on Azure��������������������������27
1.6.7. Spring Cloud Function on VMware Tanzu (TKG, PKS)���������������������������28
1.6.8. Spring Cloud Function on Red Hat OpenShift (OCP)����������������������������31
1.7. Summary�����������������������������������������������������������������������������������������������������32

Chapter 2: Getting Started with Spring Cloud Function����������������������33


2.1. Setting Up the Spring Boot and Spring Cloud Function Locally�������������������34
2.1.1. Step 1: Create the Spring Boot Scaffolding�����������������������������������������35
2.1.2. Step 2: Create the Employee Model����������������������������������������������������40
2.1.3. Step 3: Write the Consumer�����������������������������������������������������������������43
2.1.4. Step 4: Write the Supplier��������������������������������������������������������������������44
2.1.5. Step 5: Write the Function�������������������������������������������������������������������45
2.1.6. Step 6: Deploy and Run the Code Locally��������������������������������������������46
2.1.7. Step 7: Test the Function���������������������������������������������������������������������47
2.2. Setting Up Spring Cloud Function and AWS Lambda�����������������������������������49
2.3. Setting Up Spring Cloud Function and Google Cloud Functions�������������������59
2.4. Setting Up Spring Cloud Function Azure Functions��������������������������������������67
2.5. Setting Up Locally with Kubernetes and Knative and Spring Cloud
Function�������������������������������������������������������������������������������������������������������72
2.6. Setting Up AWS with EKS and Knative with Spring Cloud Function�������������82
2.7. Setting Up GCP with Cloud Run/GKE and Knative with Spring Cloud
Function�������������������������������������������������������������������������������������������������������89
2.8. Setting Up Azure with AKS and Knative with Spring Cloud Function�����������98
2.9. Setting Up VMware Tanzu TKG and Knative�����������������������������������������������102
2.10. Summary�������������������������������������������������������������������������������������������������106

vi
Table of Contents

Chapter 3: CI/CD with Spring Cloud Function�����������������������������������107


3.1. GitHub Actions��������������������������������������������������������������������������������������������108
3.2. ArgoCD�������������������������������������������������������������������������������������������������������111
3.3. Building a Simple Example with Spring Cloud Function����������������������������120
3.4. Setting Up a CI/CD Pipeline to Deploy to a Target Platform������������������������122
3.5. Deploying to the Target Platform����������������������������������������������������������������124
3.5.1. Deploying to AWS Lambda�����������������������������������������������������������������124
3.6. Deploying to GCP Cloud Functions�������������������������������������������������������������129
3.7. Deploying to Azure Functions���������������������������������������������������������������������133
3.8. Deploying to Knative on Kubernetes����������������������������������������������������������138
3.9. Summary���������������������������������������������������������������������������������������������������147

Chapter 4: Building Event-Driven Data Pipelines with


Spring Cloud Function����������������������������������������������������������������������149
4.1. Data Event Pipelines����������������������������������������������������������������������������������149
4.1.1. Acquire Data��������������������������������������������������������������������������������������152
4.1.2. Store/Ingest Data�������������������������������������������������������������������������������152
4.1.3. Transform Data����������������������������������������������������������������������������������153
4.1.4. Load Data������������������������������������������������������������������������������������������153
4.1.5. Analyze Data��������������������������������������������������������������������������������������153
4.2. Spring Cloud Function and Spring Cloud Data Flow and
Spring Cloud Streams��������������������������������������������������������������������������������154
4.2.1. Spring Cloud Function and SCDF�������������������������������������������������������155
4.3. Spring Cloud Function and AWS Glue��������������������������������������������������������172
4.3.1. Step 1: Set Up Kinesis�����������������������������������������������������������������������173
4.3.2. Step 2: Set Up AWS Glue��������������������������������������������������������������������174
4.3.3. Step 3: Create a Function to Load Data into Kinesis��������������������������175
4.4. Spring Cloud Function and Google Cloud Dataflow������������������������������������185
4.5. Summary���������������������������������������������������������������������������������������������������197

vii
Table of Contents

Chapter 5: AI/ML Trained Serverless Endpoints with Spring


Cloud Function����������������������������������������������������������������������������������199
5.1. AI/ML in a Nutshell�������������������������������������������������������������������������������������199
5.1.1. Deciding Between Java and Python or Other Languages
for AI/ML��������������������������������������������������������������������������������������������206
5.2. Spring Framework and AI/ML��������������������������������������������������������������������209
5.3. Model Serving with Spring Cloud Function with DJL���������������������������������210
5.3.1. What Is DJL?��������������������������������������������������������������������������������������210
5.3.2. Spring Cloud Function with DJL��������������������������������������������������������218
5.4. Model Serving with Spring Cloud Function with Google Cloud
Functions and TensorFlow�������������������������������������������������������������������������225
5.4.1. TensorFlow����������������������������������������������������������������������������������������225
5.4.2. Example Model Training and Serving������������������������������������������������228
5.5. Model Serving with Spring Cloud Function with AWS Lambda and
TensorFlow�������������������������������������������������������������������������������������������������241
5.6. Spring Cloud Function with AWS SageMaker or AI/ML������������������������������243
5.7. Summary���������������������������������������������������������������������������������������������������251

Chapter 6: Spring Cloud Function and IoT����������������������������������������253


6.1. The State of IoT������������������������������������������������������������������������������������������253
6.1.1. Example Spring Implementation�������������������������������������������������������255
6.1.2. An Argument for Serverless Functions On-Premises������������������������256
6.2. Spring Cloud Function on the Cloud with AWS IoT�������������������������������������257
6.3. Spring Cloud Function on the Cloud with Azure IoT�����������������������������������270
6.3.1. Azure IoT Edge Device�����������������������������������������������������������������������271
6.3.2. Azure IoT Hub������������������������������������������������������������������������������������271
6.4. Spring Cloud Function on Azure IoT Edge��������������������������������������������������272
6.5. Spring Cloud Function On-Premises with IoT Gateway on a
SaaS Provider (SmartSense)����������������������������������������������������������������������280
6.6. Summary���������������������������������������������������������������������������������������������������283

viii
Table of Contents

Chapter 7: Industry-Specific Examples with


Spring Cloud Function����������������������������������������������������������������������285
7.1. Oil/Natural Gas Pipeline Tracking with Spring Cloud Function and IOT������285
7.1.1. Sensors����������������������������������������������������������������������������������������������287
7.1.2. IoT Gateway���������������������������������������������������������������������������������������287
7.1.3. IBM Cloud Functions��������������������������������������������������������������������������288
7.1.4. IBM Watson IoT Platform�������������������������������������������������������������������288
7.1.5. IBM Watson IoT Platform: Message Gateway������������������������������������288
7.1.6. IBM Event Streams����������������������������������������������������������������������������289
7.1.7. IBM Cloudant DB��������������������������������������������������������������������������������289
7.2. Enabling Healthcare with Spring Cloud Function and Big
Data Pipelines��������������������������������������������������������������������������������������������308
7.3. Conversational AI in Retail Using Spring Cloud Function���������������������������311
7.3.1. Components of Conversational AI Solutions��������������������������������������314
7.3.2. Watson Assistant Webhooks and Spring Cloud Function�������������������315
7.3.3. Implementing the Watson Assistant with Spring Cloud Function������316
7.4. Summary���������������������������������������������������������������������������������������������������333

Index�������������������������������������������������������������������������������������������������335

ix
About the Author
Banu Parasuraman is a cloud native
technologist and a Customer Success Manager
(CSM) at IBM, with over 30 years of experience
in the IT industry. He provides expert advice
to clients who are looking to move to the cloud
or implement cloud-native platforms such
as Kubernetes, Cloud Foundry, and the like.
He has engaged over 25 select companies
spread across different sectors (including
retail, healthcare, logistics, banking, manufacturing, automotive, oil
and gas, pharmaceuticals, and media and entertainment) in the United
States, Europe, and Asia. He is experienced in most of the popular cloud
platforms, including VMware VCF, Pivotal PCF, IBM OCP, Google GCP,
Amazon AWS, and Microsoft Azure. Banu has taken part in external
speaking engagements targeted at CXOs and engineers, including at
VMworld, SpringOne, Spring Days, and Spring Developer Forum Meetups.
His internal speaking engagements include developer workshops on
cloud-native architecture and development, customer workshops on
Pivotal Cloud Foundry, and enabling cloud-native sales plays and
strategies for sales and teams. Lastly, Banu has numerous blogs on
platforms such as Medium and LinkedIn, where he promotes the adoption
of cloud-native architecture.

xi
About the Technical Reviewer
Manuel Jordan Elera is an autodidactic
developer and researcher who enjoys learning
new technologies for his own experiments and
creating new integrations. Manuel won the
Springy Award 2013 Community Champion
and Spring Champion. In his little free time,
he reads the Bible and composes music on his
guitar. Manuel is known as dr_pompeii. He
has tech-reviewed numerous books, including
Pro Spring MVC with Webflux (Apress, 2020),
Pro Spring Boot 2 (Apress, 2019), Rapid Java Persistence and Microservices
(Apress, 2019), Java Language Features (Apress, 2018), Spring Boot 2
Recipes (Apress, 2018), and Java APIs, Extensions, and Libraries (Apress,
2018). You can read his detailed tutorials on Spring technologies and
contact him through his blog at www.manueljordanelera.blogspot.com.
You can follow Manuel on his Twitter account, @dr_pompeii.

xiii
Acknowledgments
It has been a great privilege to write this book and help you understand
real-world implementations of Spring Cloud Function. Thank you for
reading it.
After my presentation at SpringOne 2020, I received a message on
LinkedIn from Steve Anglin at Apress. Steve asked me if I would be willing
to write a book about Spring Cloud Function. I was a bit hesitant at first,
given that I was occupied with many client engagements, which were
taking up most of my work hours. I was worried that I would not do the
subject justice, due to my preoccupation with my clients. But after a long
contemplation and a heartfelt discussion with my family, I decided to
take it on.
I want to thank Steve Anglin, Associate Editorial Director, for reaching
out to me and providing me this opportunity to write a book on Spring
Cloud Function.
Mark Powers, the Editorial Operations Manager, was instrumental
in helping me bring this book to close. With his incessant prodding and
nudging, he helped me reached the finish line. Thanks, Mark.
Manuel Jordan, the technical reviewer, was immensely helpful. His
comments kept me honest and prevented me from cutting corners. He
helped improve the quality of the solutions that I present in this book.
Thanks, Manuel.
I also want to thank Nirmal Selvaraj and others at Apress, who worked
to bring this book to fruition.
This book would not be possible without the help of my wife Vijaya and
daughters Pooja and Deepika, who provided the much-needed emotional
support through this journey.

xv
Introduction
I entered the field of Information Technology (IT) 25 years ago, after
spending time in sales and marketing. I was an average programmer and
was never into hardcore programming. During my early life in IT, I worked
as part of a team that built a baseball simulator for the Detroit Tigers. I
helped build a video capture driver for that simulator using C++. Even
though this was a great project with a lot of visibility, it was never my real
passion to be a hard-core programmer.
I soon gravitated toward solution architecture. This seemed to
perfectly tie my marketing skills to my technology skills. I began looking
at solutions from a marketing lens. This approach formed the basis for
writing this book. Because, what good is a technology if we do not know
how to apply it in real life?
Functional programming was an emerging technology. Cloud
providers such as AWS, Google, and Azure created serverless
environments, with innovations such as Firecracker virtualization
techniques, that allowed infrastructure to scale down to zero. This allowed
customers to derive huge cost savings by not paying for resources that were
not in use and subscribing to a pay-per-use model.
Initially, development of these functions that run on serverless
environments were built on either NodeJS or Python. These functions
were also vendor-specific. Spring.io developed the Spring Cloud Function
framework, which allowed the functions to run in a cloud-agnostic
environment. The focus was on the “write once, deploy anywhere”
concept. This was a game changer in the cloud functions world.

xvii
Introduction

Prior to writing this book, I was a staunch evangelist of Pivotal Cloud


Foundry and Kubernetes. I promoted writing code that was portable.
When Knative came into being in 2018 as a joint effort between IBM and
Google, I was excited. Knative was designed as a serverless infrastructure
on top of Kubernetes and made the serverless infrastructure portable.
Combining the power and portability of Spring Cloud Function and
Knative, you have a true portable system with zero scale-down capabilities.
This was something that I wanted to write and evangelize about. But I
felt that writing about the technology and how it worked would not be that
exciting. I wanted to write about how people could use this technology in
the real world.
In this book, you will see how to program and deploy real-life
examples using Spring Cloud Function. It starts with examples of writing
code and deploying to AWS Lambda, Google Cloud Function, and
Azure Function serverless environments. It then introduces you to the
Knative on Kubernetes environment. Writing code and deploying is not
enough. Automating the deployment is key in large-scale, distributed
environments. You also see how to automate the CI/CD pipeline through
examples.
This books also takes you into the world of data pipelines, AI/ML,
and IoT. This book finishes up with real-world examples in oil and gas
(IoT), manufacturing (IoT), and conversational AI (retail). This book
touches on AWS, the Google Cloud Platform (GCP), Azure, IBM Cloud, and
VMware Tanzu.
The code for these projects is provided on GitHub at https://
github.com/banup-kubeforce. It is also available at github.com/apress/
practical-spring-cloud-function. This allows you to get up to speed on
the technologies. So, after completing this book, you will have hands-on
experience with AI/ML, IoT, data pipelines, CI/CD, and of course Spring
Cloud Function.
I hope you enjoy reading and coding this book.

xviii
CHAPTER 1

Why Use Spring


Cloud Function
This chapter explores Spring Cloud Function using a sample use case—an
HRM (Human Resources Management) system. The focus is on systems
that reside in an enterprise. The chapter touches on the FaaS (Functions
as a Service) concept and explains how it is gaining momentum in the
enterprise. The chapter also digs deeper into its implementations in the
cloud. You will learn about some of the portability issues present at the
code and container level and read about concepts such as Knative on
Kubernetes, which includes container portability. You will also learn about
some high-level implementations of Spring Cloud Function on AWS, GCP,
Azure, VMware Tanzu, and Red Hat OpenShift.

1.1. Functions as a Service (FaaS)


FaaS is a revolutionary technology. It is a great boon for developers and
businesses. FaaS allows businesses to adapt to rapidly changing business
needs by enabling their development teams to develop products and
features at a “high” velocity, thereby improving their Mean Time To Market
(MTTM). Developers can develop functions without worrying about
setting up, configuring, or maintaining the underlying infrastructure. FaaS
models are also designed to use just the right quantity of infrastructure and

© Banu Parasuraman 2023 1


B. Parasuraman, Practical Spring Cloud Function,
https://doi.org/10.1007/978-1-4842-8913-6_1
Chapter 1 Why Use Spring Cloud Function

compute time. They also can be scaled to fit exact demand, by focusing on
billing for the number of invocations as compared to billing for uptime.
FaaS has two parts, as shown in Figure 1-1.

• The function code encapsulates the business logic


in any language, such as Java, C#, Python, Node,
and so on.

• The underlying container hosts an application server


and an operating system.

Figure 1-1. FaaS component architecture

1.1.1. Implementation
of an Enterprise Application
Imagine all the infrastructure needed to run a single payroll application
on the cloud. This application may consume only 16GB of RAM and eight
vCPUs, but you are charged continuously for the entire duration that the
application is active. Using a simple AWS pricing formula, this works out
to around $1,000 per year. This cost is for the whole time the application

2
Chapter 1 Why Use Spring Cloud Function

is hosted and active, regardless of use. Of course, you can cost-justify


it through a TCO (Total Cost of Ownership) calculation, which helps
you determine how your application can bring in revenue or value that
compensates for the expense. This revenue-generation model is more
suitable to applications that generate revenue for the company, such as
an ecommerce site. It is more difficult to prove the value that a supporting
application, running in the backend of an enterprise, brings to a company.

1.1.2. Migration ROI for a Portfolio of Application


The value equation gets more complex if you plan to migrate an extensive
portfolio of apps in your enterprise.
Let’s for a moment assume, as a CTO or CIO of a company, you have a
portfolio of about one thousand applications that you plan on migrating to
the cloud. The key factors to consider, among the many, include:

• What is the current infrastructure supporting the apps?

• What is the utilization of these apps?

The utilization of apps is an essential factor in determining the value of


the application. Consider this—after analyzing the utilization of apps, you
find that this portfolio includes the following distribution:
• 10% with 80% utilization

• 40% with 50% utilization

• 50% with 20% utilization

If you calculate the billing cost using an AWS cost calculator, you see
that you will spend $1 million per year. This spend is for applications
that are critical and highly utilized, as well as for applications that are
minimally utilized. This cost is due to the fact that the cloud providers
charge for the entire duration the application is active and consuming
the infrastructure. The key here is that the infrastructure is fully allocated

3
Chapter 1 Why Use Spring Cloud Function

for the application’s life. Imagine how much you could save if the
infrastructure was allocated only for the duration that the application
was active and serving. This would be a great cost and resource saving
approach. Cloud providers have thought through this because they also
faced the pressure of finite infrastructure and considered the time needed
to provision additional infrastructure.

1.1.3. The Serverless Functions Concept


To work around the problem of finite infrastructure utilization, AWS
created Lambda serverless functions. This was a genius invention.
Subscribers to this service pay only for the time the application is invoked.
The infrastructure is unallocated when it is not invoked. This way, AWS can
save on infrastructure by repurposing the infrastructure for other needy
applications while transferring the cost savings to the customer. This is a
win-win. It’s worth considering whether you can apply this same approach
to all the enterprise applications in your company today. You would be
able to save a lot of money. Also, if you were to bring this technology to the
datacenter, you would be able to reap the benefits that AWS realized. Isn’t
this wonderful?

1.1.4. Applying the Serverless Functions


Concept to an Enterprise Application
Let’s dig deeper into the concept of functions and how AWS realizes the
magic of infrastructure savings. Functions are tiny code pieces with a
single input and a single output, and a processing layer (a predicate) acting
as the glue. Compare this to enterprise apps, which are designed to do
many things. Take a simple payroll system, for example. A payroll system
has multiple input interfaces and multiple output interfaces. Here are
some of those interfaces:

4
Chapter 1 Why Use Spring Cloud Function

• Timecard system to get the hours employees worked


in a month

• Performance evaluation system

• Peer feedback system

• Inflation adjustment calculator system

• The outgoing interface to the IRS

• The outgoing interface to the medical insurance


provider

• An outgoing interface to the internal web portal where


employees can download their paystubs

Running this payroll application is not trivial. I have seen such a


payroll system use the following:

• Fourteen dedicated middleware application servers

• Two RDBMS database stores

• Two integration tools such as message queues and FTP

• Four dedicated bare-metal servers, with each server


configured with 128GB RAM, 32 CPUs, 4TB of HDD,
10TB of vSAN, and the like

The key factor in determining whether this application can be hosted


on a serverless functions infrastructure like Lambda is the time it takes for
the application to boot up (the startup time or cold start) and the time it
takes for the application to shut down (the shutdown time). The faster the
startup and shutdown times, the larger the cost savings.
It is also important that these times be quick so that they don’t cause
disruptions. If you were to research the startup times for large enterprise
applications like the payroll application, you would find that it is not
pretty. An average startup time is around 15 minutes for all components to

5
Chapter 1 Why Use Spring Cloud Function

come up and another 15 minutes for the application to come down. This
would not fly. Imagine if you deployed this application to an AWS Lambda
serverless function. Thirty minutes of downtime for each invocation?
This will not work. Your users would abandon the application entirely. As
you can see, large applications cannot benefit from resource release and
resource reassignment because they take a long time to start up and shut
down, which would impact the general operation of the application.
Can you make this large payroll application behave in an expected way
for serverless functions? The answer is yes. A lot of refactoring is required,
but it can be done.

Serverless Function in the Cloud


All cloud providers have now incorporated the serverless functions into
their infrastructure offerings. AWS has Lambda Functions, Google has
Cloud Functions, and Azure has Azure Functions. These providers, in
the quest for making their customers captive, made sure to introduce
proprietary elements into their environments. The two components that
are essential to run the functions are:

• Serverless function code that serves the functions

• Serverless infrastructure (containers) that supports


the code

 hy Is It Important for Serverless Functions


W
to be Non-­Proprietary?
Enterprises are gravitating toward a multi-cloud, hybrid-cloud approach
to their cloud strategy. As you can see in Figure 1-2, the survey of 3,000
global respondents indicated that 76 percent already work in a multi-cloud
environment. This means they are not bound to one single cloud provider.
The adoption of a multi-cloud strategy alleviates the risk of vendor lock-in.

6
Chapter 1 Why Use Spring Cloud Function

Figure 1-2. Multi-cloud adoption report


Source: https://info.flexera.com/CM-REPORT-State-of-the-
Cloud?lead_source=Website%20Visitor&id=Blog

In a multi-cloud world, it is essential that enterprises subscribe to


services that can be easily ported between clouds. This is especially
important for commodity services.
FaaS, or serverless functions, have of late become a commodity with all
the providers having some services around FaaS. It is therefore imperative
that FaaS containers not have proprietary code.
Serverless functions become portable when they do not use
proprietary code. Portable serverless functions allow for workload mobility
across clouds. If, for instance, AWS Lambda functions are costly and Azure
Functions are cheap, enterprises can avail the cost savings and move that
Lambda workload to Azure Functions with very little effort.
The subsequent sections discuss in detail these portability issues and
explain how you can solve them.

7
Chapter 1 Why Use Spring Cloud Function

1.2. Code Portability Issues


Listing 1-1 shows the sample AWS Lambda code written in Java. This
code was generated using the AWS SAM (Serverless Application Model)
template. When observing the code, you can see that the AWS-specific
library references and method calls bind the code to AWS. It is not much,
but it is potent. In an enterprise, you typically have hundreds if not
thousands of pieces of code that you must refactor if you want to move this
type of code to another cloud provider. This is a costly affair.

8
Chapter 1 Why Use Spring Cloud Function

Listing 1-1. Sample Code Using the AWS SAM Framework

The following section explores the portability of the underlying


serverless container, which impacts how multi-cloud migrations are
conducted.

9
Chapter 1 Why Use Spring Cloud Function

1.2.1. Serverless Container Portability Issue


What about Lambda’s underlying serverless framework? Is it portable?
If you deep dive into AWS Lambda, the virtualization technology used
is Firecracker. Firecracker uses KVM (a kernel-based virtual machine)
to create and manage microVMs. You can find more information on
Firecracker at https://aws.amazon.com/blogs/aws/firecracker-
lightweight-virtualization-for-serverless-computing/.
The minimalist design principle that Firecracker is built on allows
for fast startup and shutdown times. Google Cloud Functions, on the
other hand, use gVisor and are not compatible with Firecracker. gVisor is
an application kernel for containers. More information can be found at
https://github.com/google/gvisor.
Azure Functions take a totally different approach of using the
PaaS offering app service as their base. So, you can see that the major
cloud providers use their own frameworks for the managing functions’
containers. This makes it difficult for functions to move between clouds
in a multi-cloud environment. This portability issue becomes more
pronounced due to the lack of portability at the container level.

Figure 1-3. Serverless architecture comparison

You can see that the code and containers both differ from the provider
and are not easily portable.

10
Chapter 1 Why Use Spring Cloud Function

In the discussions so far, you have seen the following issues related
to FaaS:

• Portability of code

• Portability of the serverless container

• Cold start of the serverless environment

How do you solve these issues?


Enter Spring Cloud Function and Knative. Spring Cloud Function
addresses function code portability, and Knative addresses container
portability.
Information on Spring Cloud Function is available at https://spring.
io/projects/spring-cloud-function, and information about Knative is
available at https://knative.dev/docs/.
The following sections deep dive into each of these topics.

1.3. Spring Cloud Function: Writing Once


and Deploying to Any Cloud
As you learned from the earlier discussion, writing functions for AWS
Lambda, Google Cloud Functions, or Azure Functions is a proprietary
activity. You have to write code specific to a hyperscaler. Hyperscalers
refer to large-scale cloud providers like AWS, Google, or Azure, who have a
complete mix of hardware and facilities that can scale to 1000s of servers.
This is not bad if your strategy is to have a strong single hyperscaler
relationship, but over time, when your strategy changes to a hybrid cloud
or multi-cloud, you may have to rethink your approach.
A hybrid cloud comprises a private cloud and a public cloud
and is managed as one entity. Multi-cloud includes more than
one public cloud and does not have a private cloud component.

11
Chapter 1 Why Use Spring Cloud Function

This is where the Spring Cloud Function comes in. The Spring.io team
started the Spring Cloud Function project with the following goals:

• Promote the implementation of business logic via


functions.

• Decouple the development lifecycle of business logic


from any specific runtime target so that the same code
can run as a web endpoint, a stream processor, or a task.

• Support a uniform programming model across


serverless providers, as well as the ability to run
standalone (locally or in a PaaS).

• Enable Spring Boot features (auto-configuration,


dependency injection, metrics) on serverless providers.

Source: https://spring.io/projects/spring-cloud-function
The key goals are decoupling from a specific runtime and supporting a
uniform programming model across serverless providers.
Here’s how these goals are achieved:

• Using Spring Boot

• Wrapper beans for Function<T, R> (Predicate),


Consumer<T>, and Supplier<T>

• Packaging functions for deployments to target


platforms such as AWS Lambda, Azure Functions,
Google Cloud Functions, and Knative using adapters

• Another exciting aspect of Spring Cloud Function is that


it enables functions to be executed locally. This allows
developers to unit test without deploying to the cloud

Figures 1-4 and 1-5 show how you can deploy Spring Cloud Function.
When Spring Cloud Function is bundled with specific libraries, it can be
deployed to AWS Lambda, Google Cloud Functions, or Azure Functions.

12
Chapter 1 Why Use Spring Cloud Function

Figure 1-4. Deploying Spring Cloud Function directly to FaaS


environments provided by the cloud providers

Figure 1-5. Deploying Spring Cloud Function on Knative serverless


configured on Kubernetes environments provided by the cloud
providers
When Spring Cloud Function is containerized on Knative, it can
be deployed to any Kubernetes offering, whether on the cloud or on-­
premises. This is the preferred way to deploy it on hybrid and multi-cloud
environments.

1.4. Project Knative and Portable


Serverless Containers
Having a portable serverless container is also important. This minimizes
the complexity and time required to move between cloud providers.
Moving between cloud providers to take advantage of discounted pricing
goes a long way toward saving costs. One methodology used is called
cloud bursting (Figure 1-6). Cloud bursting compensates for the lack
of infrastructure on-premises by adding resources to the cloud. This is
usually a feature of a hybrid cloud.

13
Chapter 1 Why Use Spring Cloud Function

Figure 1-6. Cloud bursting

Figure 1-6 shows that, to compensate for the lack of resources in a


private cloud during a traffic spike, resources are allocated to the public
cloud where the traffic is routed. When the traffic spike goes down, the
public cloud resources are removed. This allows for targeted use of costs
and resources—that is, it uses additional resources only during the traffic
spike period. The burst of activity during an eCommerce event like Cyber
Monday is a great example of a traffic spike.
This cannot be easily achieved with just a portable code. You need
containers that are also portable. This way, containers can be moved
across cloud boundaries to accommodate traffic spikes. In Figure 1-6,
you can see that VMs from VMware are used as containers. Since the VMs
hosted in the datacenter and hosted in the cloud are similar in construct,
cloud bursting is possible.
Applying this to Functions as a Service, you need a new way to make
the underlying serverless containers portable.
One such revolutionary approach in the cloud function world is
Knative. The next section dives deep into Knative.

14
Chapter 1 Why Use Spring Cloud Function

1.4.1. Containers, Serverless Platforms,


and Knative
What was the need for containers /serverless platforms?
Over the course of the evolution of IT, there has been a need for
secure isolation of running processes. In the early 90’s, chroot jail-based
isolation allowed developers to create and host a virtualized copy of the
software system. In 2008 Linux Containers (LXC) was introduced which
gave the developers a virtualized environment. In 2011 Cloud Foundry
introduced the concept of a container, and with Warden in 2019 container
orchestration became a reality. Docker, introduced in 2013, provided
containers that can host any operating system. Kubernetes, introduced in
2014, provided the capability to orchestrate containers based on Docker.
Finally, Knative, introduced in 2018, extended Kubernetes to enable
serverless workloads to run on Kubernetes clusters.
Serverless workloads (Knative) grew out of the need to help developers
rapidly create and deploy applications without worrying about the
underlying infrastructure. The serverless computing model takes care of
provisioning, management, scheduling, and patching and allows cloud
providers to develop the “pay only for resources used” model.
With Knative, you can create portable serverless containers that run
on any Kubernetes environment. This allows for FaaS to be portable in a
multi-cloud or hybrid-cloud environment.
Besides making developers more productive, the serverless
environment offers faster deploys (see Figure 1-7). Developers can use
the “fail fast and fail often” model and spin up or spin down code and
infrastructure faster, which helps drive rapid innovation.

15
Chapter 1 Why Use Spring Cloud Function

Figure 1-7. Serverless deploys the quickest

1.4.2. What Is Knative?
Knative is an extension of Kubernetes that enables serverless workloads
to run on Kubernetes clusters. Working with Kubernetes is a pain. The
amount of tooling that is required to help developers move their code from
the IDE to Kubernetes defeats the purpose of the agility that Kubernetes
professes to bring to the environment. Knative automates the process of
build packages and deploying to Kubernetes by provider operators that are
native to Kubernetes. Hence, the names “K” and “Native”.
Knative has two main components:

• Serving: Provides components that enable rapid


deployment of serverless containers, autoscaling, and
point-in-time snapshots

• Eventing: Helps developers use event-driven


architecture by providing tools to route events from
producers to subscribers/sinks

You can read more about Knative at https://Knative.dev/docs.

16
Chapter 1 Why Use Spring Cloud Function

1.5. Sample Use Case: Payroll Application


Let’s look at how you can apply serverless functions to a real-life example.
We introduced the payroll application in the beginning of the chapter,
we’ll now build on it. Consider a payroll application with the configuration
shown in Figure 1-8.

Figure 1-8. Payroll application components

Figure 1-9 shows the configuration.

17
Chapter 1 Why Use Spring Cloud Function

Figure 1-9. Payroll application flow

Translating this flow diagram into an actual implementation that can


be deployed in a corporate datacenter results in Figure 1-10. You see that
the functions are developed as REST APIs that are executed in batch mode.
The REST APIs expose SAP ECC payroll modules. These REST APIs are
run as batch jobs every 15 days. The databases are hosted on Oracle, and
integrations are exposed using IBM API Connect (APIC). Note that this is
not an on-demand process and can consume a lot of resources when idle.
These REST APIs cannot be easily shut down and started up because a
typical time for booting up a SAP NetWeaver component can be anywhere
from 2 to 15 minutes, depending on the JVM configuration. These
application components must be running constantly to keep the payroll
application from breaking down.

18
Chapter 1 Why Use Spring Cloud Function

Figure 1-10. Current payroll architecture

Using this use case, the following sections explore how you can
leverage Spring Cloud Function to modernize and transform this
application into a highly efficient, scalable, and portable system.

1.6. Spring Cloud Function Support


The Spring Cloud Function is supported in almost all cloud offerings, as
shown in Table 1-1.

19
Chapter 1 Why Use Spring Cloud Function

Table 1-1. Spring Cloud Function Support Among Cloud Providers


AWS Azure Google IBM Cloud On-Premises

Lambda Azure Cloud IBM Functions Tanzu with Knative


Functions Functions
EKS with AKS with GKE with Tanzu with OpenShift with
Knative Knative Knative Knative Knative
Fargate with ARO with OpenShift OpenShift with Any Kubernetes
Knative Knative with Knative Knative offering with Knative
ROSA with Tanzu with Tanzu with IBM Kubernetes
Knative Knative Knative with Knative
Tanzu with
Knative

Abbreviations: ROSA: Red Hat OpenShift on AWS; ARO: Azure Red Hat OpenShift;
EKS: Elastic Kubernetes Services; AKS: Azure Kubernetes Services; GKE: Google
Kubernetes Engine

1.6.1. Spring Cloud Function on AWS


Lambda on AWS
Transforming an application deployed on-premises to leverage an
AWS Lambda environment and be portable requires function code
that abstracts away the hard dependencies of AWS Lambda from the
implementation and the serverless container. This example uses Spring
Cloud Function for the function code framework and Lambda for the
container. By writing once using Spring Cloud Function, you can use the
DevOps pipeline, discussed in subsequent chapters, to deploy to other
serverless environments. Figure 1-11 shows how AWS and its components
help realize the payroll application in the cloud.

20
Chapter 1 Why Use Spring Cloud Function

Now you need to deploy the payroll system on AWS Lambda. The
deployment sequence is important, as you need to deploy SAP ECC and
Oracle before integrating and then configure API and messaging for the
Spring Cloud Function to integrate with SAP. Spring Cloud Function can be
created and tested with dummy information, but it needs to be deployed
after integration testing with SAP ECC:

1. Deploy SAP ECC on the AWS EC2 instances.

2. Deploy Oracle DB as an RDS instance.

3. Configure the SAP to Oracle integration.

4. Deploy Spring Cloud Function to AWS.

5. Set up the Amazon API Gateway.

6. Set up Amazon SQS for messaging.

Figure 1-11. Spring Cloud Function on AWS

21
Chapter 1 Why Use Spring Cloud Function

1.6.2. Spring Cloud Function on Knative


and EKS on AWS
If you want to implement a truly portable environment in AWS, you can
leverage the AWS EKS, which is a Kubernetes platform that AWS offers.
You can install Knative in EKS and this will give you a truly portable,
serverless container that allows for faster deployment and improved cold
starts. It uses appropriate technologies, such as Spring Cloud Function
on GraalVMs. GraalVMs uses the AOT (Ahead of Time) compilation
technique, which significantly improves execution times. Subsequent
sections address GraalVMs and Spring Cloud Function. See Figure 1-12.
Follow this process to deploy the payroll system on Knative hosted
on an Azure AKS and ensure that the SAP ECC and Oracle DB are up and
integrated. You do this before developing and deploying Spring Cloud
Function on Knative:

1. Deploy SAP ECC on AWS EC2 instances.

2. Deploy Oracle DB as an RDS instance.

3. Configure the SAP to Oracle integration.

4. Set up Knative on an AWS EKS cluster.


5. Deploy Spring Cloud Function on Knative.

6. Set up the Amazon API Gateway.

7. Set up Amazon SQS for messaging.

22
Chapter 1 Why Use Spring Cloud Function

Figure 1-12. Spring Cloud Function on Knative on AWS

1.6.3. Spring Cloud Function on Cloud


Functions on GCP
GCP Cloud Functions provide a cloud alternative to AWS Lambda
Functions. The GCP offering is newer than Lambda, but with the Anthos
strategy, it is gaining a good amount of the function space. Spring.io works
closely with Google to make the Spring.io components work seamlessly
with the GCP components.
To deploy the payroll system on Cloud Functions on GCP, follow the
process outlined here (see Figure 1-13). Ensure that the SAP ECC and
Oracle DB are up and integrated before developing and deploying Spring
Cloud Function on Cloud Functions:

1. Deploy SAP ECC onto GCE.

2. Deploy Oracle DB on GCE VMs, as there is no AWS


RDS-like service on GCP.

3. Configure the SAP to Oracle integration.

23
Chapter 1 Why Use Spring Cloud Function

4. Set up a GCP Cloud Function project.

5. Deploy Spring Cloud Function onto GCP Cloud


Functions.

6. Deploy Apigee on GCP to host function APIs.

7. Set up the Google Cloud pub/sub messaging


platform.

Figure 1-13. Spring Cloud Function on GCP

1.6.4. Spring Cloud Function on Knative


and GKE on GCP
Knative, as discussed, is a way to make the functions portable. Knative,
incidentally, was created by Google. With GCP, you can set up Knative on
GKE, which is the Kubernetes engine provided by Google.
To deploy the payroll system on Knative hosted on a GCP GKE, follow
the process outlined here (Figure 1-14). Ensure that the SAP ECC and

24
Chapter 1 Why Use Spring Cloud Function

Oracle DB are up and integrated before developing and deploying Spring


Cloud Function on Knative:

1. Deploy SAP ECC as a Docker image onto the GKE


cluster.

2. Deploy Oracle DB as a Docker image onto the GKE


cluster.

3. Configure the SAP to Oracle integration.

4. Configure a GKE cluster with Knative.

5. Deploy Spring Cloud Function onto Knative.

6. Set up the Apigee API Gateway.

7. Set up RabbitMQ on GKE for messaging.

8. Set up Google cloud pub/sub.

Figure 1-14. Spring Cloud Function on Knative on GCP

25
Chapter 1 Why Use Spring Cloud Function

1.6.5. Spring Cloud Function on Azure Functions


on Azure
Spring Cloud Function deployed on Azure Functions is not portable due
to the explicit use of an Azure Function Invoker class. While Lambda and
Google Cloud Functions require a change to Pom.xml (if you are using
Maven), Azure needs an additional class. This makes it less portable. If you
have a portfolio of one thousand Spring Cloud Functions in AWS that you
need to move to Azure, you have to do a lot of development activity. This is
disruptive.
To deploy the payroll system on Azure Functions, follow the process
outlined here (see Figure 1-15). Ensure that the SAP ECC and Oracle DB
are up and integrated before developing and deploying Spring Cloud
Function on Azure Functions:

1. Deploy SAP ECC on Azure VMs.

2. Deploy Oracle DB on Azure VMs.

3. Configure the SAP to Oracle integration.

4. Configure Azure Functions.

5. Deploy Spring Cloud Function on Azure Functions.


6. Set up the Azure API Gateway on Azure.

7. Set up Azure Queue storage on Azure for messaging.

26
Random documents with unrelated
content Scribd suggests to you:
creatures, does not presently see the infinite wisdom and goodness
of their Creator: and he must be mad, who will not own those
attributes.”

26. “A man would deceive himself,” says Lalande, “in believing he


could be a philosopher, without the study of the natural sciences. To
be wise, not by weakness, but by principles, it is necessary that, to
be able to reflect and think with vigour, we be freed from those
prejudices which deceive the judgment, and which oppose
themselves to the development of reason and of genius. Pythagoras
would not have any disciples, who had not studied Mathematics:
over his door was to be read, that “no one was to enter, unless he
were a geometrician.”—Morals would be less sure, and less
attractive for us, if they were to be founded on ignorance or on error.

“Ought we,” he asks, “to consider as of no importance the


advantage of being freed from the misfortunes of ignorance? Is it
possible to observe, without a feeling of compassion and even of
shame, the stupidity of those, who formerly believed, that by making
a great vociferation, during an eclipse of the Moon, they furnished
relief to the sufferings of that (imagined) goddess; or, that these
eclipses were produced by enchantment?”

“Cum frustra resonant æra auxiliaria Lunæ.”


Met. iv. 333.

Reyas, in the dedication of his Commentaries on the Planisphere


to the Emperor Charles V. mentions a curious historical fact, in
illustration of the effects of that superstition, derived from ignorance,
which astronomy has banished from the civilized world. It is thus
related by Lalande:—“Christopher Columbus, when commanding the
army which Ferdinand, king of Spain, had sent to Jamaica, some
short time after the discovery of that island, experienced so great a
scarcity of provisions, that no hope remained of saving his army,
which he expected to be soon at the mercy of the savages. An
approaching eclipse of the moon furnished this able man with the
means of extricating himself from his embarrassment: he let the chief
of the savages know, that if they should not, in a few hours, send him
all he asked for, he would oppress them with the greatest calamities;
and that he would begin by depriving the moon of her light. At first,
they contemned his menaces; but, when they saw that the moon
began, in reality, to disappear, they were seized with terror; they
carried all they had to the general, and came themselves to implore
forgiveness.”

Comets were formerly, even in civilized nations, another great


cause of consternation among the people; and one, also, which a
knowledge of astronomy has at length divested of its terrors, by
removing the source of those superstitious errors, a grossly mistaken
notion of the nature of those phænomena. “We are sorry to find,”
says Lalande, “such strange prejudices, not only in Homer [Iliad iv.
75.] but even in the most beautiful poem of the sixteenth century;
whereby means are furnished of perpetuating our errors—

“Qual con le chiome sanguinose orrende


Splender Cometa suol per l’aria adusta,
Che i regni muta e i feri morbi adduce,
E ai purpurei tiranni infausta luce.”
Tasso’s Jerus. del.

Which Mr. Hoole has thus translated—

“As, shaking terrors from his blazing hair,


A sanguine Comet gleams through dusky air,
To ruin states, and dire diseases spread,
And baleful light on purpled tyrants shed.”

Further, the progress of genuine astronomy has almost wholly


dissipated, in our day, the gross delusions of astrology, with the
mischievous portents of its infatuated judicial interpreters; follies
engendered by ignorance, which is, ever, the prolific parent of
prejudice, of superstition, and of their numerous concomitant evils.

27. Mr. Rittenhouse observes, (in his Oration delivered before the
American Philosophical Society, in 1775,) that “Galileo not only
discovered these moons of Jupiter, but suggested their use in
determining the longitude of places on the earth; which has since
been so happily put in practice, that Fontenelle does not hesitate to
affirm, they are of more use to geography and navigation, than our
own moon.”—This great man, one of the first restorers of the true
principles of physics, was condemned by, and suffered the penalties
of the Inquisition, in 1535, for defending the system of Copernicus!
He died in 1542.

A letter from Andrew Ellicott, Esq. to Mr. Robert Patterson, dated


the 2d of April 1795, and published in the fourth volume of the
American Philosophical Society’s Transactions, contains sundry
observations of the immersions of the satellites of Jupiter, made at
Wilmington in the state of Delaware, by Messrs. Rittenhouse, J.
Page, Lukens and Andrews, respectively, on divers days from the
1st to the 23d of August (both included,) in the year 1784; together
with those observed at the Western Observatory, by Messrs. Ellicott,
Ewing, Madison, &c. on divers days from the 17th of July to the 19th
of August (both included,) in the same year: also, of the emersions of
those satellites, by the same Eastern Observers, from the 29th of
August to the 19th of September (both included,) and by the same
Western Observers, from the 27th of August, up to the 19th of
September, both included; all in the year 1784. These observations
were made,

“Le Trident de Neptune est le Sceptre du Mond.”[27a]

when those able geometricians and astronomers were employed in


ascertaining the Western Boundary of Pennsylvania, by determining
the length of five degrees of longitude, West, from a given point on
the river Delaware.

27a. “The trident of Neptune is the sceptre of the world.”—This, as Lalande


observes, is nearly what Themistocles said at Athens, Pompey at Rome, Cromwell
in England, and Richelieu and Colbert in France.

28. Mr. Derham, speaking of the utility resulting from the


observation of these phænomena, (in his Astro-Theology,) says
—“As to the eclipses, whether of sun or moon, they have their
excellent uses. The astronomer applies them to considerable
services, in his way, and the geographer makes them no less useful
in his: the chronologer is enabled, by them, to amend his accounts of
time, even of the most ancient days; and so down through all ages:
and the mariner, too, can make them serviceable to his purpose, to
discover his longitude, to correct his account at sea, and thereby
make himself more secure and safe in the untrodden paths of the
deep.”

W. B.

29. Lucius Cælius Lactantius Firmianus, a Christian writer in the


beginning of the fourth century, reasons in a conclusive manner
against the heathen mythology, in the inference he draws from the
argument, used by the heathens, to prove the heavenly bodies to be
divinities. His argument, on this head, will be found towards the
conclusion of Mr. Derham’s Astro-Theology, where it is translated
from the Latin of that early and eloquent advocate of Christianity (in
his Divin. Instit. l. 2. c. 5.) in these words:—

“That argument whereby they” (those idolaters) “conclude the


heavenly bodies to be gods, proveth the contrary: for if therefore
they think them to be gods, because they have such certain and
well-contrived rational courses, they err: for, from hence it appears
that they are not gods; because they are not able to wander out of
those paths that are prescribed them. Whereas, if they were gods,
they would go here and there, and every where, without any
restraint, like as animals upon the earth do; whose wills being free,
they wander hither and thither, as they list, and go whithersoever
their minds carry them.”

Those vast orbs of matter in the universe, which constitute the


planets of our system, if even we consider this alone, and each of
which is known to have its appropriate motion, must of necessity
have had those motions communicated to them, at first, by some
Being of infinite power; the perfect order and regularity of their
motions render it equally plain, that that Being was also infinite in
wisdom; and the uninterrupted continuance of the same regularity of
motion, in their respective orbits, demonstrates in like manner, that
He who originally imparted their motions to the several planets is,
moreover, infinite in duration.

The vis inertiæ of all material substances, a quality inseparably


interwoven with their nature, deprives them (considered merely as
such) of the power of spontaneous motion; matter is inherently inert:
consequently, those great globes of matter, the planets (including the
earth,) necessarily derive their motions from a supremely powerful
First Cause, as well as from one infinitely intelligent, and everlasting
in his Being. Hence, Lactantius well observes, in another place, that
“There is, indeed, a power in the stars, of performing their motions;
but that is the power of God, who made and governs all things; not of
the stars themselves, that are moved.”

The reasoning of Lactantius, on this subject, is more worthy of a


philosopher, than that employed by Descartes, in supporting his
chimerical notion of vortices; or than that which led Kepler to adopt
his scheme, equally unsupported by any rational principles, of a
vectorial power produced by emanations of the sun, as primary
agents of motion in the solar system. Because these schemes of
Descartes and Kepler make it necessary to recur to some ulterior, as
well as more adequate and comprehensible cause of motion, in the
planets, than either vortices or emanations from the sun: whereas
Lactantius resorted, at once, to an intelligent First Cause, capable of
producing the effect; without conjuring up inefficient agents, as first
movers; which left them still under the necessity of going back to a
Creator of their respective causes (but second causes, at best,) of
the planetary motions; consequently, the First Cause; and, also, of
admitting the existence of Intelligence, as an essential attribute in the
nature of that Being.

An edition of the works of Lactantius (who was a native of Fermo


in Italy,) was printed at Leipsick, in 1715.

30. Wisdom of Solomon, ch. 13. v. 2.

31. Ibid. ch. 13. v. 3 and 5.


32. Psalm 19. v. 1.

33. In Mr. Smart’s Poetical Essay on the Immensity of the


Supreme Being, after a glowing description of some of the admirable
works of nature, is this apt, though laconic address to the Atheist:—

“Thou ideot! that asserts, there is no God,


View, and be dumb for ever.”

34. The poet gives a whimsical account of the first formation of


man, out of this earth, which is represented as being then new; and,
having been recently separated from the high æther, is therefore
supposed as yet holding some affinity with heaven, and retaining its
seeds. He describes the son of Japetus (Prometheus) moulding a
portion of earth, mixed with river-water, into the similitude of those
heathen deities, who were said to rule over all things.

A poetic translation into our own language, of the lines above


quoted, which exhibit “the godlike image,” thus formed, after its being
animated by the stolen fire of Prometheus, is comprehended in the
italicised lines of the following passage, extracted from Mr. Dryden’s
versification of the first book of Ovid’s Metamorphoses; in which the
English poet has well preserved the beauty, the force, and the
sublimity of the thought, so finely expressed in the original:—

“A creature of a more exalted kind


Was wanting yet, and then was Man design’d
Conscious of thought, of more capacious breast,
For empire form’d, and fit to rule the rest:
Whether with particles of heav’nly fire
The God of nature did his soul inspire;
Or earth, but now divided from the sky,
And pliant still, retain’d th’ ætherial energy:
Which wise Prometheus temper’d into paste,
And, mixt with living streams, the godlike image cast:
Thus, while the mute creation downward bend
Their sight, and to their earthly mother tend,
Man looks aloft, and with erected eyes
Beholds his own hereditary skies.”

35. Man will, unquestionably, by taking an extensive range in the


contemplation of nature, proportionably enlarge his intuitive
conceptions of the attributes of her Almighty First Cause; of whose
transcendently exalted existence, the study of his own being, one of
nature’s greatest works, will have taught him the reality: and a due
knowledge of himself, alone, will also instruct him in the dependent
nature of his condition, and the duties resulting from that state of
dependence, in his humble relation to the Supreme being.

Mr. Smart, in the poem before quoted, has prettily expressed this
idea, in the following lines:—

“Vain were th’ attempt, and impious, to trace


Thro’ all his works th’ Artificer Divine—
And tho’ no shining sun, nor twinkling star,
Bedeck’d the crimson curtains of the sky;
Tho’ neither vegetable, beast, nor bird,
Were extant on the surface of this ball,
Nor lurking gem beneath; tho’ the great sea
Slept in profound stagnation, and the air
Had left no thunder to pronounce its Maker;
Yet Man at home, within himself, might find
The Deity immense; and, in that frame
So fearfully, so wonderfully made,
See and adore his Providence and Pow’r.”

36. The same sentiment is beautifully expressed by Thomson, in


the following apostrophe:

“With thee, serene Philosophy! with thee,


And thy bright garland, let me crown my song!
Effusive source of evidence, and truth!
A lustre shedding o’er th’ ennobled mind,
Stronger than summer-noon; and pure as that,
Whose mild vibrations soothe the parted soul,
New to the dawning of celestial day.
Hence through her nourish’d pow’rs, enlarged by thee,
She springs aloft, with elevated pride,
Above the tangling mass of low desires,
That bind the fluttering crowd; and angel-wing’d,
The heights of science and of virtue gains,
Where all is calm and clear; with nature round,
Or in the starry regions, or th’ abyss,
To reason’s or to fancy’s eye display’d:
The First up-tracing, from the dreary void,
The chain of causes and effects to Him,
The world producing essence, who alone
Possesses being; while the Last receives
The whole magnificence of heaven and earth,
And every beauty, delicate or bold,
Obvious or more remote, with livelier sense,
Diffusive painted on the rapid mind.”
Summer, l. 1729 and seq.

37. It delights me to soar among the lofty stars; it delights me to


leave the earth and this dull habitation, to be wafted upon a cloud,
and to stand upon the shoulders of the mighty Atlas.

Mr. Dryden has thus translated the original into English verse:—

“Pleas’d, as I am, to walk along the sphere


Of shining stars, and travel with the year;
To leave the heavy earth, and scale the height
Of Atlas, who supports the heavenly weight.”

38. Dr. Francis thus versifies this passage, in our language:—

————“What bounds old ocean’s tides;


What, through the various year, the seasons guides:
Whether the stars, by their own proper force,
Or foreign pow’r, pursue their wand’ring course:
Why shadows darken the pale Queen of Night;
Whence she renews her orb, and spreads her light.”
39. Thus rendered, in English verse, by Mr. Dryden:—

“Ye sacred Muses, with whose beauty fir’d,


My soul is ravish’d, and my brain inspir’d;
Whose priest I am, whose holy fillets wear,
Would you your poet’s first petition hear;
Give me the way of wand’ring stars to know:
The depths of heav’n above, and earth below.
Teach me the various labours of the moon,
And whence proceed th’ eclipses of the sun.
Why flowing tides prevail upon the main,
And in what dark recess they sink again.
What shakes the solid earth, what cause delays
The summer nights, and shortens winter days—
Happy the man, who, studying nature’s laws,
Through known effects can trace the secret cause.”

40. The lines here referred to were written about eight years after
Sir Isaac Newton’s death. Voltaire supposes an apotheosis of
Newton to have taken place, among the planets personified by some
of the deities of the heathen mythology. Thus ascribing intelligence
to the stars, he considers them, by a poetical fiction, as being in the
confidence of the Most High—the true God; and to those subordinate
deities, or, perhaps, a fancied superior order of angelic beings, the
poet makes his figurative address; which may be thus rendered in
English verse:—

Ye confidents of the Most High,


Ye everlasting lights!
Who deck, with your refulgent fires,
The scene of godlike rights!
Whose wings o’erspread the glorious throne
Whereon your Lord is plac’d,
That Lord, by whose transcendent pow’r
Your borrow’d rays are grac’d;
Speak out, bright orbs of heaven’s expanse!
And frankly let us know:
To the exalted Newton’s name,
Can you refuse to bow?

41. Godfrey Kirch was born in the year 1640, at Guben in Lower
Lusatia, and lived with Hevelius. He published his Ephemerides in
1681, and became established at Berlin in 1700. This astronomer
made numerous observations.

42.

—-—-—“Amid the radiant orbs


That mere than deck, that animate the sky,
The life-infusing suns of other worlds,
Lo! from the dread immensity of space
Returning with accelerated course,
The rushing Comet to the sun descends;
And, as he sinks below the shading earth,
With awful train projected o’er the heavens,
The guilty nations tremble. But, above
Those superstitious horrors that enslave
The fond sequacious herd, to mystic faith
And blind amazement prone, th’ enlighten’d few,
Whose godlike minds Philosophy exalts,
The glorious stranger hail. They feel a joy
Divinely great; they in their powers exult;
That wond’rous force of thought, which mounting spurns
This dusky spot, and measures all the sky;
While, from his far excursions through the wilds
Of barren ether, faithful to his time,
They see the blazing wonder rise anew,
In seeming terror clad, but kindly bent
To work the will of all-sustaining love:
From his huge vapoury train perhaps to shake
Renewing moisture on the numerous orbs,
Through which his long elipsis winds; perhaps
To lend new fuel to declining suns,
To light up worlds, and feed th’ eternal fire.”
Thomson’s Summer, l. 1702 and seq.

43. Mr. Messier observed this Comet in France, eleven days


before it was discovered in England by Miss Herschel.

44. That the mind of the female sex is capable of compassing


great and extraordinary attainments, even in the most arduous
branches of science, is attested by many instances; and it cannot be
doubted that these would be more numerous, were women oftener
attentive to philosophical pursuits. Those who have been just named
serve to shew, that astronomy has been cultivated with success, by
them. And Dr. Reid tells us (in his Essays on the intellectual and
active Powers of Man,) that both the celebrated Christiana, Queen of
Sweden, and the Princess Elizabeth, daughter of Frederick, King of
Bohemia, and aunt of George I., were adepts in the philosophy of
Descartes. The latter of these princesses, though very young when
Descartes wrote his Principia, was declared by that philosopher to
be the only person he knew, who perfectly understood not only all his
philosophical writings, but the most abstruse of his mathematical
works.

45. The writer is happy in having it in his power to cite, in support


of his own opinion, that of an amiable and conspicuous female, in
favour of ladies making themselves acquainted with, at least, the
rudiments of astronomical science.

The Countess of Carlisle, a woman whose literary attainments, as


well as virtues and accomplishments, do honour to her sex and
station, in her Letters, under the signature of Cornelia, thus
recommends an attention to the study of astronomy, to the young
ladies to whom her letters are addressed. “Attain a competent
knowledge of the globe on which you live, that your apprehension of
Infinite Wisdom may be enlarged; which it will be in a much higher
degree, if you take care to acquire a general idea of the structure of
the universe. It is not expected you should become adepts in
astronomy; but a knowledge of its leading principles you may, and
ought to obtain.”—Her ladyship then refers her young female
correspondents to the Plurality of Worlds of Fontenelle, in order that
they might acquire a knowledge of the planetary orbs; pleasantly
recommending this author as a proper person, in the capacity of “a
gentleman usher,” to “introduce” them to an “acquaintance” with “that
brilliant assembly.”

Lady Carlisle’s Letters, lett. 8th.

46. Translated from the Latin.

47. This very eminent mathematician, as well as learned and pious


divine, died in the year 1677, aged only forty-seven years. See the
life of this extraordinary man, written in 1683, by the learned
Abraham Hill; prefixed to the first volume of the doctor’s theological
works; a fifth edition of which, in three folio volumes, was published
by archbishop Tillotson, in 1741. He also wrote and published many
geometrical and mathematical works, all in Latin.

“The name of Dr. Barrow,” says Mr. Granger, one of his


biographers, “will ever be illustrious, for a strength of mind and a
compass of knowledge that did honour to his country. He was
unrivalled in mathematical learning, and especially in the sublime
geometry, in which he was excelled only by one man; and that man
was his pupil, the great Sir Isaac Newton. The same genius that
seemed to be born only to bring hidden things to light, to rise to the
heights or descend to the depths of science, would sometimes
amuse itself in the flowery paths of poetry, and he composed verses
both in Greek and Latin.”

This “prodigy of learning,” as he is called by Mr. Granger, was


interred in Westminster Abbey, where a monument, adorned with his
bust, is erected to his memory.

48. Flavius Josephus informs us, (in his Jewish Antiquities, b. i.


chap. 7. 8.) that the sons of Seth employed themselves in
astronomical contemplations. According to the same historian,
Abraham inferred the unity and power of God, from the orderly
course of things both at sea and land, in their times and seasons,
and from his observations upon the motions and influences of the
sun, moon and stars. He further relates, that this patriarch delivered
lectures on geometry and arithmetic to the Egyptians, of which they
understood nothing, until Abraham introduced those sciences from
Chaldea into Egypt, from whence they passed into Greece: and,
according to Eupolemus and Artapan, he instructed the Phœnicians,
as well as the Egyptians, in astronomy.

49. We are informed by some ancient writers, that when Babylon


was taken, Calisthenes, one of Aristotle’s scholars, carried from
thence, by the desire of his master, celestial observations made by
the Chaldeans, nearly two thousand years old; which carried them
back to about the time of the dispersion of mankind by the confusion
of tongues: and those observations are supposed to have been
made in the famous temple of Belus, at Babylon. But these accounts
are not to be depended on: because Hipparchus and Ptolemy could
find no traces of any observations made at Babylon before the time
of Nabonassar, who began his reign 747 years before the birth of
Christ; and various writers, among the ancients, agree in referring
the earliest Babylonian observations to about the same period. In all
probability, the Chaldean observations were then little more than
matters of curiosity; for, even in the three or four centuries
immediately preceding the Christian era, the celestial observations
which were made by the Greeks were, for the most part, far from
being of any importance, in relation to astronomical science.

Indeed, the knowledge of astronomy at much later periods than


those in which the most celebrated philosophers of Greece
flourished, must have been very limited and erroneous, on account
of the defectiveness of their instruments. And, added to the great
disadvantages arising from this cause, the ancients laboured under
the want of a knowledge of the telescope and the clock; and also
maintained a false notion of the system of the world; which was
almost universally adhered to, until the revival and improvement of
the Pythagorean system by Copernicus, who died in 1543. Within
the last two hundred years, but, particularly, since the laws of nature
have been made manifest by the labours and discoveries of the
immortal Newton, the science of astronomy has made astonishing
advances towards perfection.

50. This sovereign re-established the university of Naples,


founded that of Vienna in Austria, in the year 1237, and imparted
new vigour to the schools of Bologna and Salerno. He caused many
ancient works in medicine and philosophy to be translated from the
Arabian tongue; particularly, the Almagest of Ptolemy.

Cotemporary with the Emperor Frederick II. was Alphonso X. King


of Castile, surnamed the Wise. This prince was the first who
manifested a desire of correcting the Tables of Ptolemy. In the year
1240, even during the life of his father, he drew to Toledo the most
experienced astronomers of his time, Christians, Moors, or Jews; by
whose labours he at length obtained the Alphonsine Tables, in 1252
(the first year of his reign:) which were first printed at Venice, in
1483. He died in the year 1284.

51. His name was John Holywood; deduced, according to a


practice prevalent in his time, from the place of his nativity, which
was Halifax, a town in the west-riding of Yorkshire, in England, where
he was born in the year 1204. It was formerly named Holy-wood; and
was, probably, so called in Sacro-Bosco’s day: but the more ancient
name of that place was Horton, or Hair-town; and Halifax signifies
Holy-hair.—This great man was the inventor of the sphere; and
wrote a work, entitled De Sphærâ, which was very celebrated. He
died at Paris, in 1256.

52. He died in 1294, at the age of eighty years.

53. Dr. Rush’s Eulogium, “intended to perpetuate the memory of


David Rittenhouse,” &c. was delivered before the American
Philosophical Society in Philadelphia, (a great many public
characters, and a numerous concourse of private citizens, also
attending,) on the 17th of December 1796. It was pronounced in
pursuance of an appointment made by the society, in these words,
viz:
“At a meeting convened by special order, on the 1st of July, 1796,
the following motion was made, and unanimously adopted; viz. That
this Society, deeply affected by the death of their late worthy
President, do resolve, That an Eulogium, commemorative of his
distinguished talents and services, be publicly pronounced before
the Society, by one of its members.”—Dr. Rush’s appointment was
made at the next meeting of the society.

The following resolutions passed by them, after the delivery of the


oration, will evince the high sense they entertained of the merit of
this performance; viz.

“Philosophical Hall, Dec. 17, 1796.—In Meeting of the American


Philosophical Society,

“Resolved, unanimously, That the thanks of this society be


presented to Dr. Benjamin Rush, for the eloquent, learned,
comprehensive, and just Eulogium, which he has this day
pronounced, upon the character of our late respected President, Dr.
David Rittenhouse.

“Resolved, unanimously, That Dr. Rush be requested to furnish the


society with a copy of the Eulogium, to be published under their
direction.

“An extract from the minutes:—Samuel Magaw, Robert


Patterson, W. Barton, John Bleakley, Secretaries.”

It may not be thought superfluous, to add, that Dr. Rush well knew
Mr. Rittenhouse. A personal friendship of an early date subsisted
between them: it probably originated when the latter established his
residence in Philadelphia, about six and twenty years before his
death. In the summer of 1772, Mr. Rittenhouse (in a letter to the Rev.
Mr. Barton) expressed his friendly estimation of the doctor in these
few words—“The esteem I have for Dr. Rush is such, that his
friendship for Mr. —— would, alone, give me a very good opinion of
that gentleman.”
54. “Biography, or the writing of Lives,” says Dr. Hugh Blair, “is a
very useful kind of composition; less formal and stately than history;
but to the bulk of readers, perhaps, no less instructive; as it affords
them the opportunity of seeing the characters and tempers, the
virtues and failings of eminent men, fully displayed; and admits them
into a more thorough and intimate acquaintance with such persons,
than history generally allows. For, a writer of lives may descend, with
propriety, to minute circumstances and familiar incidents. It is
expected of him, that he is to give the private, as well as public life,
of the person whose actions he records; nay, it is from private life,
from familiar, domestic, and seemingly trivial occurrences, we often
receive most light into the real character.”—Lectures on Rhetoric and
Belles Lettres, sect. 36. In addition to so respectable an opinion as
that of Professor Blair, respecting the utility and characteristic
features of biographical works, the writer of these memoirs hopes he
will be excused for giving the sentiments on the same subject,
contained in the following extracts from Dr. Maty’s Memoirs of the
Life of Lord Chesterfield, “tending to illustrate the civil, literary, and
political history of his own time.”

“Besides the great utility which general history derives from private
authorities, other advantages no less important,” says this learned
and ingenious biographer, “may be obtained from them. It is from
observing individuals, that we may be enabled to draw the outlines of
that extraordinary, complicated being, man. The characteristics of
any country or age must be deduced from the separate characters of
persons, who, however distinguishable in many respects, still
preserve a family-likeness. From the life of almost any one
individual, but chiefly from the lives of such eminent men as seemed
destined to enlighten or to adorn society, instructions may be drawn,
suitable to every capacity, rank, age or station. Young men, aspiring
to honours, cannot be too assiduous in tracing the means by which
they were obtained: by observing with what difficulty they were
preserved, they will be apprized of their real value, estimate the risks
of the purchase, and discover frequent disappointment in the
possession.”
“It is from the number and variety of private memoirs, and the
collision of opposite testimonies, that the judicious reader is enabled
to strike out light, and find his way through that darkness and
confusion in which he is at first involved.”

“Who does not wish that Cæsar had lived to finish his
Commentaries; and that Pompey’s sons, instead of fighting their
father’s cause, had employed themselves in writing his life?—What a
valuable legacy would Cicero have left us, if, instead of his
philosophical works, he had written the memoirs of his own times! Or
how much would Tyro, to whom posterity is so much indebted for the
preservation of his master’s letters, have encreased that obligation,
if, from his own knowledge, he had connected and explained them!
The life of Agricola, by his son-in-law Tacitus, is undoubtedly one of
the most precious monuments of antiquity.”

55. The duchy of Guelderland formerly belonged to the Spanish


monarchy; but by the peace of Utrecht, in 1713, part of it was ceded
to Austria, part to Prussia, and guaranteed to them by the treaty of
Baden, in 1714: that part which became subject to Prussia was, in
exchange for the principality of Orange, ceded to France. By the
barrier-treaty, in 1715, the states general of the United Provinces
likewise obtained a part of it. But the Upper and Lower Guelderland
have no connexion with each other: Lower Guelderland is (or was,
until very lately) one of the Seven United Provinces: it is the largest
of them all, and the first in rank. Arnheim, which is the capital of the
whole province, is a large, populous, and handsome town: it was
formerly the residence of the dukes of Guelderland, and the states of
the province held their meetings there.

56. The writer of these memoirs having been in Holland in the


summer of the year 1778, adverted, while in Amsterdam, to the
circumstance of the Rittenhouses, of Pennsylvania, having come into
America from some part of the United Provinces; and his curiosity
being excited, by his consanguineous connexion with that family, to
obtain some information concerning them, the following was the
result of his enquiries. He found a Mr. Adrian Rittinghuysen, (for so
he himself wrote his name,) residing in that city. This venerable man,
who was then eighty-five years of age, appeared to be at least
independent in his condition; and had, probably, retired from
business, the part of the city in which he resided (the Egelantier’s
Gracht, or Canal,) not exhibiting the appearance of a street of trade.

The information derived from this respectable old man, was, that
his forefathers had long been established at Arnheim; that his father,
Nicholas, was a paper-manufacturer in that city, as others of the
family had been; and that his father’s brother, William, went with his
family to North America, where he some time afterward, as he had
understood, established the paper-mills near Germantown. He
further stated, that he had only one child, a daughter, who was
married, and resided at the Hague; and that he was, himself, as he
believed, the last of his family-name, remaining in the United
Provinces.

Although plain in his dress and manners, and in the general


appearance of his household, this person seemed to be pleased in
shewing the writer a family-seal, on which was engraved a coat of
arms. The armorial device represented a castellated house, or
chateau; on the left side of which was a horse, standing on his hind
feet and rearing up, with his fore feet resting against the wall of the
house: and this house very much resembled the chateau in the
armorial bearing of the Spanish family “de Fuentes, señores del
Castillio,” as represented in Dubuisson’s French Collection of Arms:
The seal having been much worn, the lines, &c. describing the
several tinctures of the bearing, could not be discerned; and,
therefore, it cannot be properly blazoned. At the same time, the old
gentleman did not omit to mention, that his mother was a De Ruyter;
and that her arms were, a mounted chevalier armed cap-à-piè.

These facts, relative to the origin of the American Rittenhouses,


did not appear to the writer to be unworthy of notice. They are
correctly stated, being taken from a memorandum made by him,
immediately after his interview with Adrian Rittinghuysen.
The introduction of this slight sketch of the occupation and
condition of some of the European ancestors of our Philosopher, into
his Life, may be the more readily excused, since the great Newton
himself was not inattentive to such objects. There is, indeed,
implanted by nature in the human mind, a strong desire to become
acquainted with the family-history of our forefathers. Hence, Sir
Isaac Newton left, in his own hand-writing, a genealogical account or
pedigree of his family; with directions, subjoined thereto, that the
registers of certain parishes should be searched, from the beginning
to the year 1650; and he adds—“Let the extracts be taken, by
copying out of the registers whatever may be met with, about the
family of the Newtons, in words at length, without omitting any of the
words.” This investigation and enquiry of Sir Isaac, was made in the
sixty-third year of his age; and he himself caused the result to be
entered in the books of the herald’s office.

Such, also, was the curiosity of Dr. Benjamin Franklin. While the
Doctor was in England, he undertook a journey to Eaton, in
Northamptonshire, (a village situated between Wellingborough and
Northampton,) the residence of his forefathers, for the purpose of
obtaining information, as he tells us himself, concerning his family.
—“To be acquainted with the particulars of my parentage and life,
many of which are unknown to you,” (said Dr. Franklin in his Life,
which he addressed to his son,) “I flatter myself, will afford the same
pleasure to you as to me—I shall, relate them upon paper.”

57. See the preceding note.

58. Conradus Rittershusius was a learned civilian of Germany. He


was born at Brunswick in the year 1560, and died at Altorf in
Switzerland, in 1613. Two of his sons, George and Nicholas, also
distinguished themselves in the republic of letters. The writer of the
present memoirs is too little acquainted with the genealogies of
either German or Dutch families, to pretend to claim any
consanguinity between this C. Rittershuysen (or, as latinized,
Rittershusius,) and our Rittenhouses. But the name appears to have
been, originally, the same; and the ancestors of both, it may be
presumed, were of the same country: In giving a latin termination to
the name, the y is omitted, not being a Roman letter.

59. The Dutch were early and long distinguished for the superior
quality of the paper manufactured in their country. It excelled, in its
whiteness and the closeness of its texture, as well as its goodness in
other respects, the paper made elsewhere; and it was an article of
great importance to the republic, both for the internal consumption
and for exportation, until the Hollanders were rivalled in this
manufacture by the perfection to which it was afterwards brought in
other parts of Europe.

Paper, made from linen rags (for that made from cotton, silk, and
some other substances, was of a much elder date,) is said to have
been originally introduced into Germany from Valencia and
Catalonia, in Spain, as early as the year 1312, and to have appeared
in England eight or ten years afterwards. But the first paper-mill in
Great Britain was erected at Dartford in Kent, by Mr. Speelman, a
German, jeweller to queen Elizabeth, in the year 1558: and it was
not until more than a century after, that any other paper than of an
inferior quality was manufactured in England. Little besides brown
paper was made there, prior to the revolution in 1688: yet, soon after
that period, the English were enabled to supply themselves with
much the greater part of the various kinds of paper used in their
country, from their own mills; and the perfection to which the
manufacture of this important article has since been carried, not only
in England, but in France, Italy and Germany, has greatly diminished
the consumption of Dutch paper.

It is a fact worthy of notice, that the establishment of paper-mills in


Pennsylvania, by the Rittenhouses, was nearly co-eval with the
general introduction of the manufactory of white paper in the mother
country. This appears from the following circumstance:—There is
now before the writer of these memoirs a paper in the hand-writing of
the celebrated William Penn, and subscribed with his name,
certifying that “William Rittinghousen and Claus” (Nicholas) “his son,”
then “part owners of the paper-mill near Germantown,” had recently
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