Skip to main content

Fluence Cloudless Function

Fluence Cloudless Function is a decentralized serverless solution deeply rooted in the decentralized physical infrastructure (DePin) paradigm. Even more than most serverless solutions, Fluence Cloudless Function lets you do more with less code and without having to worry about the underlying infrastructure. Unlike centralized cloud providers, Cloudless Function lets you select capacity providers, i.e., data centers, a la carte from a marketplace allowing you to customize the serverless infrastructure exactly to your Cloudless App's availability, performance, SLA and budget needs. By virtue of its DePin roots, Cloudless Function scales at exceptionally low cost without foregoing performance and service level. Moreover, Cloudless Function is supported with a proof system concerning function execution, i.e., Proof of Execution (PoE), and correctness of execution, i.e., Proof of Processing (PoP), that revolutionizes a broad range of audits while simplifying accurate billing.

In A Nutshell

To make Fluence Cloudless Function work for you, you need to complete four fundamental steps:

  • Create and manage your Compute Functions by compiling your business logic to Marine Wasm
  • Create your Aqua scripts to choreograph your Compute Functions
  • Create your Developer Offer to package your compute artifacts and deployment requirements
  • Submit your Developer Offer to the marketplace for matching

Cloudless Function is available on a Wasm runtime called Marine, with more runtimes already under development, providing performant, available and portable compute functions across capacity providers participating in the Compute Marketplace. Moreover, Aqua lets you choreograph compute functions into Cloudless Deployments.

Once you have coded your business logic in Rust and compiled it to the wasm-wasi compile target, you are ready to create your Cloudless Deployment, which simply specifies Cloudless Distributive, i.e., how many instances of your functions you want deployed, for how long, to what kind of (CPU and RAM)resources, in what locales, etc, and your Developer Offer where you specify your willingness to pay for the resources desired and the payment for your deployment.

Upon completion, you submit your deployment plan to the Fluence marketplace where the given deployment attributes are matched with Provider Offers. Depending on the matching success, your functions are deployed to the chosen providers or you are asked to refine your deployment. See Figure 1 for a stylized workflow.

mermaid

stateDiagram ProviderOffers --> ComputeMarketplace Developer --> Code: Business logic in Rust Code --> ComputeFunctions: Compile to wasm32-wasi ComputeFunctions --> CloudlessDeployment Developer --> PaymentGateway: Buy tokens Developer --> CloudlessDistributive: Deployment specifications Developer --> DeveloperOffer: Willingness to pay CloudlessDistributive --> CloudlessDeployment DeveloperOffer --> CloudlessDeployment PaymentGateway --> DeveloperOffer: Escrow payment CloudlessDeployment --> ComputeMarketplace: Send to match with capacity provider ComputeMarketplace --> CapacityProvider_1: matched offers ComputeMarketplace --> CapacityProvider_2: matched offers ComputeMarketplace --> CapacityProvider_k: matched offers CloudlessDeployment --> CapacityProvider_1: host and execute Deployment CloudlessDeployment --> CapacityProvider_2: host and execute Deployment CloudlessDeployment --> CapacityProvider_k: host and execute Deployment
stateDiagram ProviderOffers --> ComputeMarketplace Developer --> Code: Business logic in Rust Code --> ComputeFunctions: Compile to wasm32-wasi ComputeFunctions --> CloudlessDeployment Developer --> PaymentGateway: Buy tokens Developer --> CloudlessDistributive: Deployment specifications Developer --> DeveloperOffer: Willingness to pay CloudlessDistributive --> CloudlessDeployment DeveloperOffer --> CloudlessDeployment PaymentGateway --> DeveloperOffer: Escrow payment CloudlessDeployment --> ComputeMarketplace: Send to match with capacity provider ComputeMarketplace --> CapacityProvider_1: matched offers ComputeMarketplace --> CapacityProvider_2: matched offers ComputeMarketplace --> CapacityProvider_k: matched offers CloudlessDeployment --> CapacityProvider_1: host and execute Deployment CloudlessDeployment --> CapacityProvider_2: host and execute Deployment CloudlessDeployment --> CapacityProvider_k: host and execute Deployment

Figure 1: Stylized Fluence Cloudless Development And Deployment Flow

Prior to being able to submit your Deployment, you need to acquire FLT and USDC tokens from one of the (Fiat) gateway providers. USDC tokens are escrowed according to each Deployment and used to periodically compensate capacity providers with valid proofs attesting to the correct execution of your Cloudless Functions commensurate with the execution loads, i.e., CPU and memory model, length of execution, data payload, etc.

Of course, for development on a testnets, you are able to request testnet tokens, tFLT and tUSDC, free of charge and in sufficient quantities to support your development efforts.

info

For the purpose of launching the Fluence mainnet, billing follows an epoch rather than execution-based model also known as a subscription model. That is, you are billed for having a provider host your Deployments for some period of time regardless of the number of executions or loads. This is a temporary constraint.

An integral part of the Fluence Cloudless Function developer experience is the Fluence CLI, which supports all development and deployment aspects necessary to create and manage your Cloudless App.

Comparative Positioning

From a capabilities and development perspective, Cloudless Function is very similar to other serverless solutions such as AWS Lambda, Azure Functions and Google Cloud Functions. Unlike centralized serverless cloud providers, Fluence Cloudless Function leverages the power and portability of Wasm to provide a high-performance compute runtime hosted and executed across a customizable, high-availability capacity mesh, thereby eliminating single points of failure, access controls, high exit barriers and excessive rent seeking. See Table 1.

Table 1: High Level Serverless Provider Comparison

Fluence LambdaAWS LambdaAzure FunctionsGoogle Cloud Functions
RuntimeWasm
more coming
MultipleMultipleMultiple
LanguagesRust
more coming
MultipleMultipleMultiple
Workflow ManagementAquaStep FunctionsAzure Logic AppCloud Functions Workflow
       Orchestration
       Choreography
Endpoint AccessP2P or HTTP GatewayHTTPHTTPHTTP
Capacity (Data Center)Transparent & SelectableBlackboxBlackboxBlackbox
CLIFluence CLIAWS CLIAzure CLI, Azure PowerShellgcloud CLI

Unlike centralized cloud providers, the Fluence Protocol enables an open, permisisonless peer-to-peer network and compute marketplace that facilitates crowd sourcing of (data center) capacity. Make no mistake, the Fluence network is backed by a large number of Tier 4 data centers offering top of the line CPU and RAM configurations at extremely competitive prices for extraordinary SLAs. The Fluence Compute Marketplace is built on InterPlanetary Consensus (IPC), an EVM-compatible, modern high-performance PoS blockchain.

While developers can ignore the intricacies of the peer-to-peer network,including network security solutions such as DDOS and other attack prevention or mitigation schemes, a salient difference between Fluence Protocol and other serverless solutions is that Fluence network does not natively support HTTP request and response calls. That is, function choreography happens on the peer-to-peer level. However, this is easily solved with existing Fluence solutions at both (p2p) network ingress and egress such as the HTTP Gateway.

TODO: curl adapter reference

Use Cases

By virtue of its on-demand, easy-to-scale and pay-per-execution model, serverless compute is inherently suitable to enable event-driven architectures and systems. Some of the use cases Fluence Cloudless Function enable are summarized in Table 2.

Table 2: Sample Use Cases For Fluence Lambda

TypeApplications
Data ProcessingData preparation and processing
Process ControlTask scheduling
MessagingSend notifications
APIsMobile and web apps
Serverless WorkflowsChoreograph and compose functions

In summary, Fluence Cloudless Function supports the full breadth of event- and time-based triggers serverless developers like yourself are accustomed to.