Sep 16 2022
Aug 31 2022
Developers use serverless to pay for cloud computing services that execute functions on an as-needed basis.
Cloud providers serverless offering, also known as Functions as a Service (FaaS), only charge per request. Compared to virtual machines (VMs) that run 24/7 and cost money even when they are not executing code, serverless offers companies significant cost savings.
Traditional serverless products, also known as cloud serverless, execute code from a single data center, which leads to higher latency when user requests come from long distances. Cloud serverless products also use computing engines that need to “warm up” if an instance of a function is not already running on the server, which can create slow or failed responses.
Higher latency. Slower response times. None of this is good. Especially for developers who are conscious of web performance.
Serverless has come a long way since it’s inception: Now, cloud serverless performance can be improved on by adopting new edge application architectures. Edge serverless (e.g. Serverless EdgeEngine), minimizes the impact of cold starts and leverages a distributed network to execute functions from servers that are closest to the end user.
These benefits, and other differences between cloud and edge serverless are explained in more detail below.
Edge Serverless | Cloud Serverless | |
---|---|---|
Definition | A method for executing functions at the edge on an as-needed basis with the fastest execution time and lowest latency. | A method for executing functions in the cloud on an as-needed basis. |
Server location | The function is routed to a point of presence (PoP) on a distributed network that is closest to the end user. | All functions are routed to the same data center in a region that’s chosen by the developer. |
Execution engine | Chrome V8: Compiles and executes JavaScript code concurrently and optimizes code at runtime.
For non-JavaScript code, there is support for WebAssembly, which means that other languages such as C, C++, Rust, Go, PHP, and Python can be compiled to run on the same platform.” | Varies: The execution environment varies based on the service provider and language. The provider must specifically support the language you wish to write your code in. |
Latency | Latency is lower than average because the user client is routed to the closest point of presence (PoP). | Latency is higher than average because the user client is routed to the region where the function was originally deployed.
Our own testing shows a 5x difference in average response time when dealing with location-dependent latency. |
Cold start boot time | 50-200ms | 50-500ms |