Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is JD.com 's exploration in Serverless?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

JD.com Zhaopinyun in Serverless exploration is how, many novices are not very clear, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.

The concept and definition of Serverless

When it comes to Serverless, "home basically" time will think of AWS lambda, yes, what makes the name Serverless really popular is AWS's FaaS service-Lambda, which is a platform that allows you to allow unique code snippets on the cloud and trigger the operation of the code through pre-set events.

In addition to FaaS, there is BaaS, which is similar to the abbreviation of Blockchain as a Service, but it is actually the abbreviation of Backend as a Service-back-end as a service. You need to write / manage all server-side components, which are similar to virtual machines and containers, and are conceptually closer to SaaS (Software as a Service). BaaS services are domain-wide component services that are enabled by API tuning.

After talking about the definition, let's take a look at the history of Serverless.

The earliest can be traced back to 2006, when Zimki launched the code enforcement platform, which is a pay-as-you-go service.

Then there was Parse in 2011, which provided the BaaS framework, based on which customers built applications faster, which was later acquired by Facebook.

In 2012, there were Fribase, a mobile development platform for mobile applications, and IronWorker services, which were later acquired by Google, while the latter was a container-based load platform.

In 2014, AWS launched Lambda, a cloud-based FaaS service, bringing the Serverless concept to the public's point of view.

Then, in 2016, Google,Azure,IBM launched FaaS services on their cloud services.

When it comes to cloud computing in the past, "home" is familiar with IaaS,PaaS,SaaS, so what is the difference between this FaaS and the other three? In my definition, IaaS;PaaS, which requires OPS above, is similar to FaaS. Except for the OPS layer, cloud service providers are responsible for OPS. SaaS is the simplest and ready-made one, and you can use it directly.

People may wonder, since you say that FaaS and PaaS are similar, why not just call them PaaS? Don't worry, let's take a look at this first: CloudFoundry, there may be some strangers, but if you are a cloud computing soldier, then you certainly will not be strangers.

AWS was launched in 2006, and the earliest Argyun in China was established in 2009. In fact, around 2012, the concept of cloud computing slowly spread to China. I started to dabble in cloud computing in 2013. At that time, I actually started the competition of IaaS,PaaS,SaaS. Some companies start from IaaS, some start directly from PaaS or SaaS. When you mention PaaS at that time, you will definitely mention CloudFoundry (an open source PaaS platform in the industry). Many interconnected enterprises have built PaaS cloud services based on CloudFoundry, such as JD.com 's JAE, Sina's SAE, Baidu's private cloud and so on.

When I came into contact with FaaS for the first time, my first feeling was, "Hey, this is very similar to CloudFoundry. When you publish a response to CloudFoundry, you have requirements for the implementation environment and clearly choose what development language and version you are based on. If the current platform is not supported, then you are actually deployed and operated by law. Secondly, the platform also provides" dynamic elastic expansion "and" mobile service ". And customs / routing services, and then you find that the most significant difference between the two is that the CloudFoundry platform provides a resident service, but FaaS is an event-triggered code operation service.

To give the family a more intuitive understanding, let's take a look at this.

In the era of naked CloudFoundry, operation and maintenance was needed from hardware to code, and then there was virtualization, like the CVM services on various clouds, so that the client only needed to pay attention to the layer above the operating system, and then to the advent of container technology, so that the client needed to pay attention to the container body and business code. The former CloudFoundry platform provided container services, and customers deployed the container code to the container. As a resident service. On the far right is Function. Customers don't even need to maintain containers, they just need to pay attention to the code.

The emergence of each new technology is to solve the problems encountered by the current technology, at the same time, the adoption of new technology will inevitably lead to new problems. First, let's talk about the advantages of Serverless:

Advantages: reduce costs, which includes both operating costs and development costs, which is easy to understand. Since you do not need to maintain related components such as operating systems and hardware, you do not need to hire employees in the corresponding fields to reduce costs.

Advantages: accelerate innovation, when the development of business code, and ready-made Serverless third-tier services (such as authentication services, component storage services, etc.), you can quickly deploy and transport the business, which shortens the cycle of business development in the past.

Advantage 3: scalability: before FaaS, to solve the auto scaling feature of the business, you need to purchase the auto scaling service provided by the cloud provider and configure the corresponding conditions before you can achieve the dynamic auto scaling of the business. In FaaS services, the auto auto scaling feature is supported by default.

Let's move on to the disadvantages of Serverless:

Disadvantages: delay. Due to the adoption of the Serverless deployment service, all calls between services need to go through network transmission, which cannot be the original local call, so the relative latency will definitely increase.

Disadvantages: integration testing, due to the adoption of Serverless technology, it will be more troublesome when you want to test and verify in the local environment after you have developed the code, because you do not have a local and cloud-like environment.

Disadvantage 3: supplier binding, because Serverless technology is an emerging technology, the technology and standards provided by each supplier are not unique, so once you deploy your business based on the Serverless services of some cloud provider, if you want to move to other clouds, it will inevitably have a transformation cost to your business.

The application and practice of Serverless in JD.com Zhi Lianyun

After introducing the concept and definition of Serverless, let's take a look at the application and practice of Serverless in JD.com Zhilian Cloud.

What are the lists of Serverless services that have been provided on JD.com Zhaopin Cloud before "Let's take a look":

In the last 20 years of 16 years, JD.com Zhaopin Cloud launched the object storage service, the first cloud-based system based on serverless architecture.

In September of 18 years, we launched the Faas service, which is an event-driven computing service. Through the function service, customers need to configure and manage the server and other infrastructure, so that they can flexibly and reliably run the business code, build the service quickly, and only pay for the resources actually consumed by the code.

In the last 12 months of 18 years, we have launched API gateway, which provides full life cycle management of API. Customers can realize system integration and service aggregation through API gateway, and can also easily and securely open their business functions and data, and connect with developers or partners.

In the first half of 19 years, we launched the queuing service, which is a fully managed message queuing service based on serverless architecture, which can provide "reliable and limited" managed message queues.

In the first half of 20 years, we launched the notification service, which is a message notification service that implements the publish and subscribe model based on serverless architecture, and provides a "reliable,"scalable" and dynamically scalable message push topic.

Next, take a detailed look at JD.com 's FaaS service technology architecture diagram.

The part framed by the middle powder belongs to the internal system module of Faas.

First of all, let's take a look at the function event registration process. API will receive the event registration request from the web side, store the metadata information such as event trigger conditions in the MySQL relational database, and store the function operation code in the BaaS service, that is, the OSS object storage service, thus completing the event registration process.

Next, let's take a look at the trigger process of function events. Trigger is a master-slave service. When an external event sends an event to trigger, if it is a synchronous event, it will send the event directly to the dispatcher service. If it is an asynchronous event, it will first be sent to the queue server, and then the queue will pass the event to the dispatcher service. Dispatcher will adopt the deployment mode of the cluster. Dispatcher will determine whether the corresponding function code of the current event is already in the running state, and if so, it will directly call the function code of the container upload. Otherwise, the request is sent to the scheduler service. Scheduler is a "master-slave" service, and the scheduler service will be responsible for starting a container service. During the process of starting container, the corresponding event function code will be pulled from the oss service and run.

Throughout the system, trigger, dispatcher, and scheduler services all interact with etcd services to ensure the availability of data and select major operations through etcd.

The event sources that have been connected by the former FaaS are API gateway, OSS [object Storage] and Cloud events (similar to notification service, where you can define event sources. "if the monitoring metric of a resource triggers a condition, the FaaS service will be called), and there is also JQS [queue service]. The first three events are actively pushed, and the events of JQS are obtained by polling through FaaS. The events received by FaaS on API shutdown will be handled synchronously, while the other three will be handled asynchronously.

The first step before making "new technology" is to understand what new technology is, and then how to transform existing business based on new technology.

Next, let's take a simple monomer application as an example. This is a business of the type of "Server S". Server is a "monomer response", which adopts the architecture of MVC, which covers two modules of HTML,JS,Service,Data Access, and data is stored in Database. All services except Database require developers and OPS.

After this should be "Serverless", it becomes such an architecture. The static components of HTML,JS are stored and stored through OSS, and the user authentication adopts a separate User Authentication third "service. It is no longer necessary for customers to develop a separate service service to deal with the login authentication problem. Other business logic enables FaaS to be deployed and exposed through API Gateway. When the browser triggers the business call, the corresponding FaaS service will be triggered. Through Serverless, the only function that really needs to be developed is the business code of FaaS, which is much more convenient than the traditional one.

Next, let's take a look at how JD.com makes Serverless service available.

The case study is Jingxing messaging platform. Jingxing is a furniture service market provided by JD.com to merchants, through which you can download chat tools, order push tools, operation analysis tools, and so on. The figure below is the message platform service of Jingxing. The order, merchandise, after-sales and other information will be sent to the JQS of JD.com Zhilian Cloud in real time after processing. JQS is a fully hosted message queuing service based on Serverless architecture, and the corresponding appliance will obtain the corresponding information from the corresponding JQS and display the corresponding information to the corresponding merchants. Because the message volume of message sources is dynamic, the demand for cluster processing of message queues is also dynamic, so JQS satisfies Beijing's demands and pays according to the real volume.

The case study is Jingxi alarm platform, which is a social e-commerce platform based on spelling business under JD.com. When an alarm message is sent to the message queue in the platform service, the FaaS service of the corresponding business line alarm processing will be triggered, and the corresponding response events can be sent text messages, e-mails or phone calls according to the alarm contents in the MQ. At the same time, according to the fixed alarm logic, you can perform related operations such as restarting services, cleaning data and so on.

Because the alarm itself is not normal, and with the increase of business, if there is a resident service to deal with the alarm business, it will inevitably be a waste of resources. FaaS can be used to avoid the waste of resources, and when there is an alarm, the corresponding service will be used to deal with the alarm.

The above two scenarios are "simpler scenarios where JD.com is enabling Serverless services, and of course there are more complex scenarios that will also make them available." As mentioned above, Serverless is not "omnipotent" and can not meet the demands of all scenarios, but I am still optimistic about its future.

Challenge and Future of Serverless

In the future form of Serverless, there are still many challenges to be solved:

The new BaaS service can provide temporary and persistent storage services, so that you can avoid purchasing resident storage services and reduce the cost of related fees.

In line with the concept of Serverless, reduce the deployment overhead between services; for "online business systems", low latency is a topic that can never be avoided. In the case of Serverless, how to "meet" business requirements is the premise of serverless "scale".

The combination of software and hardware provides more efficient processing performance; for the specific language code running on the FaaS platform, "enter" the special optimization related to the hardware layer to speed up the implementation of code operation and improve the performance.

The adoption of Serverless technology reduces the cost of IT output; it really makes people realize that the response of Serverless can reduce the output and investment of IT.

Adopting Serverless can realize the function more conveniently and quickly; through the peripheral tools, it is more convenient for customers to use serverless to build business systems, which can really realize the speed of business iteration and innovation.

Even though there are still so many challenges to be solved in Serverless, I am still full of information about the future of Serverless. More and more Serverless services have been added to the former serverless of CNCF. I believe that with the rise of Yunyuan, Serverless can catch up with this fast train and start off smoothly.

I firmly believe that the future of Serverless is promising!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report