当前位置:网站首页>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 .
边栏推荐
- [IVX junior engineer training course 10 papers to get certificates] 03 events and guessing numbers games
- matlab 实现语音信号重采样和归一化,并播放比对效果
- uTools
- 6-2漏洞利用-ftp不可避免的问题
- Single chip microcomputer -- hlk-w801 transplant NES simulator (III)
- Penser au jeu 15: penser au service complet et au sous - service
- ACM tutorial - quick sort (regular + tail recursion + random benchmark)
- Part 29 supplement (XXIX) basis of ECMAScript
- 站在新的角度来看待产业互联网,并且去寻求产业互联网的正确方式和方法
- 笔者更加愿意将产业互联网看成是一个比消费互联网要丰富得多的概念
猜你喜欢
![[rust web rokcet Series 1] Hello, world and get, post, put, delete](/img/d8/7dd5fe409d349a13128b6af554f952.jpg)
[rust web rokcet Series 1] Hello, world and get, post, put, delete
![[IVX junior engineer training course 10 papers] 02 numerical binding and adaptive website production](/img/b7/aecb815ca9545981563a1e16cfa19e.jpg)
[IVX junior engineer training course 10 papers] 02 numerical binding and adaptive website production

三分钟学会基础k线图知识

遊戲思考15:全區全服和分區分服的思考

6-3漏洞利用-SSH环境搭建

Docker安装Oracle_11g

Data visualization in medical and healthcare applications

Feature extraction and detection 16 brisk feature detection and matching

6-3 vulnerability exploitation SSH environment construction

matlab 使用 audiorecorder、recordblocking录制声音,play 播放声音,audiowrite 保存声音
随机推荐
Learn C language from scratch day 025 (maze)
The first "mobile cloud Cup" empty publicity meeting, looking forward to working with developers to create a new world of computing!
uTools
k线图形态这样记(口诀篇)
[IVX junior engineer training course 10 papers to get certificates] 09 chat room production
机器学习基本概念
matlab 使用 audioread 、 sound 读取和播放 wav 文件
站在新的角度来看待产业互联网,并且去寻求产业互联网的正确方式和方法
笔者更加愿意将产业互联网看成是一个比消费互联网要丰富得多的概念
Single chip microcomputer -- hlk-w801 transplant NES simulator (III)
Ubuntu20.04 PostgreSQL 14 installation configuration record
技术大佬准备就绪,话题C位由你决定
Since I understand the idea of dynamic planning, I have opened the door to a new world
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
Develop those things: how to use go singleton mode to ensure the security of high concurrency of streaming media?
只是以消费互联网的方式和方法来落地和实践产业互联网,并不能够带来长久的发展
Circular statements in shell programming
Learn about servlets
Have you stepped on the nine common pits in the e-commerce system?
Brief introduction to the development of mobile network