In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to use Serverless in Java". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to use Serverless in Java.
Serverless & FaaS
In 2019, 40% of the 1500 IT professionals surveyed by O'Reilly worked in organizations that adopted the Serverless architecture. According to the 2020 DataDog survey, more than 50% of AWS users are now using AWS Lambda based on Serverless architecture.
Serverless is becoming mainstream, thus giving birth to the following picture, from the management of single applications to the management of micro-service applications to the management of functions.
So far, there is no precise definition of Serverless.
Baas is the full name of Backend-as-a-Service, the back-end as a service, the full name of FaaS is Function-as-a-Service, function as a service.
Today let's talk about FaaS. This is Wikipedia's definition of FaaS:
Function as a Service (FaaS) is a type of cloud computing service that provides a platform for customers to develop, run, and manage application functions without having to build and maintain the infrastructure typically associated with developing and launching applications. Building applications following this model is one way to implement the Serverless architecture, which is usually used when building micro-service applications.
For Python, JavaScript, a development language that naturally supports Lambda, it is a perfect combination with FaaS. Serverless Framework's research report also illustrates this point very well. NodeJS and Python are the top two languages in FaaS usage.
We know that because JVM takes up a lot of memory, the startup of Java applications will be a little slow, which is not suitable for the scenario of FaaS, which is also the reason for the low utilization of Java.
In addition, Spring Boot/Cloud has become the de facto standard for Java developers, and dependency injection is the core of Spring Framework. What kind of spark will Spring Boot/Cloud collide with the FaaS scenario? This is the Spring Cloud Function we are going to talk about today.
Java Function
Before introducing Spring Cloud Function, let's take a look at the core function definitions in Java.
JDK 1.8 introduces a new feature, Lambda expression, and many functions are available under the java.util.function package. These three functions are particularly important:
1. Java.util.function.Function: you need one parameter to get another result.
@ FunctionalInterfacepublic interface Function {R apply (T t);}
For example, you can change a string from lowercase to uppercase through Function through the map method in Stream API:
Stream.of ("a", "b", "c") .map (String::toUpperCase)
The map method here requires a Function parameter:
Stream map (Function
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.