Serverless has taken the cloud computing world by storm, seeing massive growth over the past few years and very positive predictions for the future, with the market expected to grow at a compound rate of over 20% by 2028, according to recent forecasts annual growth rate.
Essentially, serverless architecture unlocks the full potential of cloud-based technology through IT automation software, allowing businesses to drive growth instead of spending time and resources on IT infrastructure management.
While this sounds promising, serverless cloud platforms are still stateless and centralized, so applications need to address this shortcoming of storing state and avoid being subject to vendor lock-in.
Internet computers provide another layer of security, control, and trust—all through decentralization, with no single party controlling the hardware or software, and in addition, Internet computers are designed to operate in a stateful manner.
In this article, we describe how Internet computer blockchains can provide serverless computing capabilities with two important additional benefits: decentralization and statefulness.
What is serverless?
Serverless is a novel cloud computing paradigm that enables fast and flexible development cycles without having to consider the underlying infrastructure (provisioning and scaling the right virtual machines, installing and maintaining software and frameworks), thereby reducing overall operational costs.
Serverless comes in many forms, the most relevant in our case is Functions as a Service (FaaS), where (large code bases are split into) small functions with very short runtimes (milliseconds to minutes) and functions are used on a per-use basis Charged (i.e. based on running time) plus a fixed fee per call, the last important feature to mention is the excellent scalability to launch up to thousands of instances of the same function in a short period of time.
Internet Computing as a Serverless Platform
Taking a brief look at the architecture of Internet Computer, you'll easily notice that it offers serverless capabilities and even additional benefits.
Today, FaaS functions are packaged as containers or simply as code (Python, Javascript, Java, Rust, etc.) and provide a single endpoint that can be called directly by external users or other functions.
Container smart contracts on Internet computers can also be programmed in a variety of languages, including Rust, Motoko, JavaScript, or Python, and can expose multiple endpoints that provide different functionality for each container.
The following table summarizes the main serverless capabilities and their corresponding Internet computers, as well as the advantages of blockchain over cloud-based serverless:
As you can see from the table, Internet computers meet all the requirements for a serverless environment. Developers may not know it, but they are already executing serverless code, as our research shows, with almost as much efficiency as what traditional cloud providers offer. same.
In some dimensions (such as memory), Internet computers even exceed the capabilities provided by traditional cloud providers. However, the most important capabilities we want to highlight for developers are: stateful and decentralized, traditional serverless The cloud does not provide these two features.
In Table 2-3, we invite the tech-savvy reader to delve into the technical aspects that make the Internet Computer a competitive serverless platform. It is important to note here that the Internet Computer has two types of smart contract execution - update mode and query mode, the former represents stateful calls, while the latter is stateless, just like general serverless computing.
Persisting state after function execution is a long-sought-after feature in the serverless/FaaS world, and it's very difficult to implement because it often conflicts with the seamless fan-out type of scalability currently available in the cloud.
Fortunately, Internet computers were designed from the ground up with statefulness in mind and provide developers with this functionality without the need for any kind of manual intervention, such as saving data to an external storage layer or database, so all variables Or the data will be automatically persisted after calling the smart contract on the Internet computer.
Decentralization is another important characteristic that is often overlooked. Modern serverless products are currently served by several large centralized clouds, which leads to vendor lock-in, where developer code and data are only as secure as their provider. and are vulnerable to geographic disruptions or simple supplier policy changes.
Internet computers are completely decentralized, with node machines running in different geographical locations and operating under strong consensus guarantees that can even tolerate Byzantine (malicious) failures.
Internet computers and traditional serverless platforms
To evaluate the performance of the Internet Computer blockchain in terms of serverless clouds, we ran a CPU-intensive benchmark computing primes on the Internet Computer and one of the top 3 serverless platforms. For smaller inputs, the Internet Computer was better than the traditional serverless platform. The server is faster, and for larger inputs, it's only half as fast as traditional (see the results below).
This is very encouraging and shows that, although there is still a long way to go, Internet computing is gaining traction in terms of performance compared to traditional centralized clouds. For more details, we encourage Check out our recent peer-reviewed articles from the prestigious USENIX ATC conference:
usenix.org/system/files/atc23-arutyunyan.pdf
Improve performance
Additional built-in features, such as decentralization and statefulness, result in lower performance of Internet computers when handling large workloads (see Figure 2), and while these features are powerful and important, they also weaken raw performance.
DFINITY engineers and researchers will continue to look for and explore ways to enhance and improve computer performance on the Internet, some areas of improvement may be increasing parallelism or replacing the current storage layer with a log-structured merge tree approach to reduce checkpoint times.
Unlocking the full power of compound queries to support more complex applications will also have a positive impact on performance. Work has already begun on compound queries to enable horizontal dapp scaling and simplify client code, allowing cross-subnet query invocation and replicated execution. Further works are underway.
Build serverless applications on Internet computers
Run Enterprise Pilot on Internet Computers
IC content you care about
Technology Progress | Project Information | Global Events
Collect and follow IC Binance Channel
Stay up to date with the latest information