In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
Serverless how to build serverless image porn detection Web application, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
What is Serverless?
Serverless, translated into Chinese as "serverless", can be traced back to "Why The Future Of Software And Apps Is Serverless" published by Ken Fromm in 2012. He describes a scenario in which the transformation of the computing model will not stop from the physical machine maintained by the user, to IaaS, and then to PaaS. When the cloud computing infrastructure is mature, the application does not need to consider the existence of the server. Serverless computing allows developers to build and run applications and services without considering the server. Then in 2016, Mike Roberts divided the Serverless architecture into Backend as a Service (BaaS) and Functions as a Service (FaaS) in Martin Fowler's blog "Serverless Architectures".
● BaaS is the back-end as a service, that is, the application architecture is organized by a large number of three-party cloud services and API, so that the logic and state of the server in the application are managed by the service provider. For example, typical single-page applications (SPA) and mobile APP rich client applications, the interaction between the front and back end is mainly Rest API calls, only need to call the API of the service provider to complete the corresponding functions, such as authentication, data access and so on.
● FaaS can be called a function as a service. Developers can directly deploy and run the service-side business logic code in a stateless computing container provided by a third party. Developers only need to write business code without paying attention to the server, and the execution of the code is triggered by events.
An Serverless application is such an application that combines BaaS and FaaS. Users pay attention to the business logic code of the application, run it on the FaaS platform with function granularity, and integrate it with BaaS tripartite services, and finally build a complete system, the whole process does not need to pay attention to the server.
Advantages of Serverless
1. No need to manage the server
Developers only need to pay attention to the business logic of the application, but do not need to pay attention to the existence of the server, lower the service access threshold, quickly launch, and improve the efficiency of development and operation and maintenance.
two。 Flexible expansion, pay-on-demand
According to Gartner and McKinsey statistics, the average CPU utilization of servers worldwide is only 6% to 12%, and the resource utilization of a large number of applications is very low, especially for applications with obvious load peaks and troughs. On the other hand, Serverless can scale and scale according to the load and pay on demand, and it can be billed according to the resources consumed by the actual operation, and the business runs at the granularity of the function, which can make full use of fragment resources and greatly reduce the operating cost.
Function Workflow FunctionGraph
After a brief introduction to the Serverless architecture and its advantages, let's take a look at Huawei Cloud's functional workflow (FunctionGraph,FGS).
Function Workflow (FunctionGraph,FGS) is an event-driven function managed computing service. Managed functions can be run in a millisecond flexible, maintenance-free and highly reliable way. Through the function workflow, developers do not need to configure and manage the server, but only need to pay attention to the business logic, write the function code, and build the application in a serverless way, then they can develop an elastic and highly available back-end system and charge according to the resources consumed by the actual operation. The efficiency of development and operation and maintenance is greatly improved, and the operation cost is reduced.
Build a serverless picture porn detection web application
In order to give you a more intuitive understanding of Serverless architecture and function workflow, next we will introduce how to quickly build a complete Web application for image porn detection through function workflow, as shown in the following figure, the application receives pictures uploaded by users and analyzes them to determine whether they are pornographic or not. Click here to experience Demo for free
Just imagine, if we develop this application through the traditional mode, how do we need to develop it?
Even based on the current cloud platform, we still need to buy a CVM and pay attention to the selection and operation and maintenance of its specifications, images, network and other metrics, and then we may need to consider the integration with other cloud services in the development process. A large number of non-business codes are coupled in the code, and resources such as servers are not on demand, which may result in a lot of unnecessary fees.
Now we can quickly build this system through functional workflow services, and do not care about the server at all, and run on demand, as shown in the figure:
After the configuration is completed, you have successfully built the front-end system of this case. You can access your front-end page through the access address provided by obs, and when the image is detected, the page will send a request to your function.
By building a complete serverless image porn detection Web application from end to end above, we can find that the architecture of Serverless has the following advantages:
1. There is no need to pay attention to any server, just focus on the core business logic, quickly build the back-end system and go online in 5 minutes, which greatly improves the development efficiency.
two。 The function runs flexibly and expands with the volume of business and is paid on demand. When the created function is not executed, it is not billed.
3. You can simply configure to connect function workflow and other cloud services, or even cloud services and cloud services. For example, in this case, you only need to create an APIG trigger to connect the API gateway to the function workflow, and then call the porn detection API of the content detection service in the function, then the function connects the two cloud services together like a glue.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.