当前位置:网站首页>Six lessons to be learned for the successful implementation of edge coding
Six lessons to be learned for the successful implementation of edge coding
2022-07-02 01:30:00 【Software testing network】
As companies rush to get the low latency that the edge can provide 、 flexibility 、 Cost and performance benefits , The demand for edge computing is expanding dramatically .IDC It is estimated that ,2022 Global edge hardware 、 Spending on software and services will reach 1760 Billion dollars , Increase over the previous year 14.8%, To 2025 The years will reach 2740 Billion dollars . therefore , Your developers are probably developing edge applications now , Or will do so in the near future .
However , Before you delve into it , There are some things to consider . As an enterprise architect, I have experience of cooperating with development organizations , Let me tell you some lessons when creating edge applications . Keeping these lessons in mind can help you avoid detours , And make sure you take advantage of the edge .

lesson 1: Challenge your way of thinking
A lot of times , When developers create edge applications , Just like they are used in data center or cloud . But edge is a different paradigm , You need to write code in different ways , We also need to use a thoughtful method to select applications suitable for the edge .
Most developers are used to centralized computing environments , There are a lot of computing resources in a small number of servers . however , Edge computing turns this situation around , Relatively modest resources are distributed on many servers in different locations . This may affect the scalability of any edge workload . for example , An application that uses a lot of memory may not scale well in hundreds of edge instances . For this reason , Most edge applications will be designed specifically for edges , Not from existing data centers or cloud deployments “ Promotion and migration ”.
You need to think carefully about how edge architecture affects your application , And which applications will benefit from this distributed approach . It is often easier to bring logic to where the data is located . therefore , If the data is more regional , Or you need to access large centralized data storage , A cloud based approach may be reasonable . however , When an application uses data generated at the edge -- For example, requests from online users / Respond to 、cookies And header information -- This is where edge computing really shines .
lesson 2: Don't ignore the basics
Although distributing code to the edge can improve latency and scalability , But it won't magically run faster . Inefficient code will be equally inefficient on the edge . As mentioned earlier , Every point of existence at the edge will be subject to more resource constraints than a typical centralized computing environment , Especially in the edge environment without servers . When writing code for edges , Optimizing efficiency is critical to making full use of this architecture .
When the push function to the edge is relatively fast and easy , You still need to apply a diligent management process like managing other code . This includes a good change management process , Store the code in source code control , And use code reviews to evaluate code quality .
lesson 3: Rethink scalability
On the edge , You are “ expand ” instead of “ increase ”. therefore , You need to develop code to accommodate the constraints of each request , Instead of considering the constraints of each server . This includes memory usage 、CPU Constraints on cycle and time per request . The constraints will vary depending on the edge platform you use , So it's important to understand them and design your code accordingly .
Generally speaking , You want to operate with the minimum data set required for each operation . for example , If you do it on the edge A/B test , You just want to store a subset of the data you need for the specific request or page you are working on , Instead of the entire rule set . For location-based experience , You only need to save the data of the specific state or region served by the edge instance in a lightweight query , Not data from all regions .
lesson 4: Code for reliability
Ensuring the reliability of edge applications is absolutely necessary to provide a positive user experience . Please make sure that in your QA The plan includes testing edge code . It is also important to add appropriate error handling , To ensure that your code can handle errors gracefully , It includes the fallback behavior when planning and testing events occur . for example , If your code exceeds the platform limit , To create a fallback to some default content , In this way, users will not receive an error message that affects their experience .
Distributed load testing is a good practice , You can confirm the scalability of your application . Once you deploy the code , Continue to monitor the platform , To make sure it doesn't exceed CPU And memory limitations , And track any errors .
lesson 5: Optimize performance
The main benefit of edge computing is to significantly reduce latency by moving data and computing resources near users . When you are in hundreds of places (PoPs) When expanding on , Create lightweight 、 Efficient code is critical to achieving this benefit . The data needed to complete a function should also be on the edge . Developing code that needs to get data from centralized data storage will erase the latency advantage provided by the edge .
The emphasis on efficient execution also applies to any third-party code utilized by edge applications . Some existing code bases are inefficient , Damage the performance or exceed the edge platform CPU And memory limits . therefore , Before incorporating any code into edge deployment , Evaluate it carefully .
lesson 6: Don't make wheels over and over again
Although the edge is a new pattern , But that doesn't mean you have to write everything from scratch . Most edge platforms are connected to various content distribution networks (CDN) Functional integration , Allows you to create custom logic , Generate an output signal , Prompt existing CDN function , Caching .
It's also a good idea to design your code to be reusable , In this way, it can be executed both at the edge and in a centralized computing environment . Abstract the core functions as browser independent 、Node.JS Or a library of platform specific functions , You can make the code have “ Isomorphism ”, Can be on the client 、 Servers and edges run .
Using existing open source libraries is another way to avoid rewriting common functions . But pay attention to those who need Node.JS Or the library of browser functions . And consider cooperating with third-party developers who integrate with the edge platform you are using , This can save time and energy , At the same time, it provides mature interoperability advantages .
Put these experiences into practice
To illustrate the impact of these best practices , Please consider a real case : An organization encountered difficulties in implementing geofencing applications at the edge . They met people who exceeded the platform CPU And high error rate caused by memory limitation .
See how they build their own applications , They have data on all geographically fenced areas ,900KB Of JSON, Stored on each edge PoP in . Use one CPU Dense algorithm to check the interest points of each geographical fence , When no point of interest is found in the first few areas , It will trigger CPU Overtime .
To solve this problem , The data of each geo fenced area is transferred to a key value store (KVS) in , Each area is stored in a separate entry . Added a lightweight check , To determine the possibility of a point of interest “ candidate region ”( Usually 1 To 3 Candidate areas ). Complete data and CPU Intensive inspection is only carried out in candidate areas , Greatly reduced CPU The amount of work . These changes reduce the error rate to a negligible level , At the same time, it improves the initialization time and reduces the use of memory , As shown in the figure below .

chart 1: Comparison of success rate and error rate ( Be careful , The scale of success and error indicators are different , So you can't directly compare ).

chart 2: Comparison of initialization time

chart 3: Compare the memory usage before and after ( picture source :Akamai)
Give full play to the role of the edge
The edge calculation is close to the user 、 Applications that provide personalized user experience quickly and efficiently offer great advantages . The key to success is to ensure that the application is a good candidate for edge platforms , Then optimize your code , To make full use of the functions of the edge platform , At the same time, work under its limited conditions .
Please pay attention to the lessons I have learned in working with organizations , You can get the edge advantage faster , And there is no headache .
边栏推荐
- 站在新的角度来看待产业互联网,并且去寻求产业互联网的正确方式和方法
- Liteos learning - first knowledge of development environment
- 浅浅了解Servlet
- Brief introduction to the development of mobile network
- Learning note 24 - multi sensor post fusion technology
- What are the differences between software testers with a monthly salary of 7K and 25K? Leaders look up to you when they master it
- How can I batch produce the same title for the video?
- No converter found for return value of type: class
- Minimize the error
- 技术大佬准备就绪,话题C位由你决定
猜你喜欢

首场“移动云杯”空宣会,期待与开发者一起共创算网新世界!

How to compress video size while adding watermark with one click?

Android high frequency network interview topic must know and be able to compare Android development environment
![[WesternCTF2018]shrine writeup](/img/26/1700095c9b38b9b74a1b1136e5d5de.jpg)
[WesternCTF2018]shrine writeup
![[IVX junior engineer training course 10 papers to get certificates] 03 events and guessing numbers games](/img/69/44219af52baef20cedec3870147589.jpg)
[IVX junior engineer training course 10 papers to get certificates] 03 events and guessing numbers games

遷移雲計算工作負載的四個基本策略
![[IVX junior engineer training course 10 papers to get certificates] 09 chat room production](/img/a8/25215e74162b7ab3f29df65681932b.jpg)
[IVX junior engineer training course 10 papers to get certificates] 09 chat room production

Penser au jeu 15: penser au service complet et au sous - service

Have you stepped on the nine common pits in the e-commerce system?

Learn C language from scratch day 025 (maze)
随机推荐
Liteos learning - first knowledge of development environment
Altium designer measure distance (ctrl+m)
Cat Party (Easy Edition)
Ubuntu20.04 PostgreSQL 14 installation configuration record
Réseau neuronal convolutif (y compris le Code et l'illustration correspondante)
遷移雲計算工作負載的四個基本策略
Raspberry pie 4B learning notes - IO communication (1-wire)
GL Studio 5 安装与体验
Basic concepts of machine learning
Learning notes 25 - multi sensor front fusion technology
Two TVs
Android: how can golden nine and silver ten squeeze into the first-line big factories from small and medium-sized enterprises? The depth of interview questions in large factories
We should make clear the branch prediction
About asp Net core uses a small detail of datetime date type parameter
成功实现边缘编码需要了解的六大经验教训
关于ASP.NET CORE使用DateTime日期类型参数的一个小细节
Shell Function
[image enhancement] vascular image enhancement based on frangi filter with matlab code
[IVX junior engineer training course 10 papers] 06 database and services
What are the affordable Bluetooth headsets? Student party parity Bluetooth headset recommendation