Practical Spring Cloud Function: Developing Cloud-Native Functions For Multi-Cloud and Hybrid-Cloud Environments 1st Edition Banu Parasuraman
Practical Spring Cloud Function: Developing Cloud-Native Functions For Multi-Cloud and Hybrid-Cloud Environments 1st Edition Banu Parasuraman
com
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
https://ebookmass.com/product/cloud-native-computing-pethuru-raj/
ebookmass.com
https://ebookmass.com/product/comptia-cloud-guide-to-cloud-computing-
west/
ebookmass.com
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
https://ebookmass.com/product/after-the-shadows-amanda-cabot/
ebookmass.com
https://ebookmass.com/product/tratado-de-ginecologia-1st-edition-
febrasgo/
ebookmass.com
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
Acknowledgments������������������������������������������������������������������������������xv
Introduction��������������������������������������������������������������������������������������xvii
v
Table of Contents
vi
Table of Contents
vii
Table of Contents
viii
Table of Contents
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
xviii
CHAPTER 1
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.
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
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.
4
Chapter 1 Why Use Spring Cloud Function
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.
6
Chapter 1 Why Use Spring Cloud Function
7
Chapter 1 Why Use Spring Cloud Function
8
Chapter 1 Why Use Spring Cloud Function
9
Chapter 1 Why Use Spring Cloud Function
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
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:
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:
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
13
Chapter 1 Why Use Spring Cloud Function
14
Chapter 1 Why Use Spring Cloud Function
15
Chapter 1 Why Use Spring Cloud Function
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:
16
Chapter 1 Why Use Spring Cloud Function
17
Chapter 1 Why Use Spring Cloud Function
18
Chapter 1 Why Use Spring Cloud Function
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.
19
Chapter 1 Why Use Spring Cloud Function
Abbreviations: ROSA: Red Hat OpenShift on AWS; ARO: Azure Red Hat OpenShift;
EKS: Elastic Kubernetes Services; AKS: Azure Kubernetes Services; GKE: Google
Kubernetes Engine
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:
21
Chapter 1 Why Use Spring Cloud Function
22
Chapter 1 Why Use Spring Cloud Function
23
Chapter 1 Why Use Spring Cloud Function
24
Chapter 1 Why Use Spring Cloud Function
25
Chapter 1 Why Use Spring Cloud Function
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.”
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.
W. B.
Mr. Smart, in the poem before quoted, has prettily expressed this
idea, in the following lines:—
Mr. Dryden has thus translated the original into English verse:—
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:—
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.
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.”
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.
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.”
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.
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.
ebookmass.com