dfaas

Decentralized FaaS platform

View on GitHub

DFaaS overview

High-level components of a single DFaaS node

Low-level components of a single DFaaS node

Single DFaaS node: a single Kubernetes (k3s) cluster composed of a single node.

Component Deployment/Chart Pods Containers
DFaaS Agent DFaaS Agent 1 1
DFaaS Agent DFaaS Forecaster 1 1
Proxy HAProxy 1 1
FaaS Platform OpenFaaS 1 2
Metrics Prometheus 4 5

Note: in addition there are the individual FaaS functions (with zero or more replicas).

Proxy

Improvement proposals:

FaaS Platform

Improvement proposals:

Metrics

^ depends on the offloading strategy

Data flow

Without forwarding:

sequenceDiagram
    actor U as User

    box transparent DFaaS
        participant P as Reverse Proxy
        participant GF as Gateway FaaS
        participant FF as FaaS Function
    end

    Note right of FF: Function already instantiated!

    U ->> +P: figlet("Hello")

    P ->> P: Check forwarding table

    P ->> +GF: figlet("Hello")

    GF ->> +FF: figlet("Hello")

    FF ->> FF: Execute function

    FF ->> -GF: response "HELLO"

    GF ->> -P: response "HELLO"

    P ->> -U: response "HELLO"

With forwarding:

sequenceDiagram
    actor U as User

    box transparent DFaaS (node A)
        participant PA as Reverse Proxy A
    end

    box transparent DFaaS (node B)
        participant P as Reverse Proxy B
        participant GF as Gateway FaaS
        participant FF as FaaS Function
    end

    Note right of FF: Function already instantiated!

    U ->> +PA: figlet("Hello")

    PA ->> PA: Check forwarding table

    PA ->> +P: figlet("Hello")

    P ->> +GF: figlet("Hello")

    GF ->> +FF: figlet("Hello")

    FF ->> FF: Execute function

    FF ->> -GF: response "HELLO"

    GF ->> -P: response "HELLO"

    P ->> -PA: response "HELLO"

    PA ->> -U: response "HELLO"

Control flow

Periodic weight recalculation:

sequenceDiagram
    box transparent DFaaS (node A)
        participant A as DFaaS Agent
        participant F as Forecaster
        participant P as Reverse Proxy
        participant GF as Gateway FaaS
        participant M as Metrics
    end

    box transparent DFaaS (node B)
        participant AB as DFaaS Agent B
    end


    A ->> +A: Recalculation timer

    opt Strategy requires forecasting?
        A ->> F: GetForecast
        F ->> A: Forecast
    end

    A ->> GF: Get functions
    GF ->> A: List of functions
    
    A ->> M: Get metrics
    M ->> A: Metrics

    A ->> A: Compute weights

    A ->> P: Update configuration
    P ->> A: Configuration updated

    A ->> AB: Send forwarding weights/metrics

    deactivate A

Offloading strategies implemented in DFaaS

The strategies determine the computation of request handling weights (forwarding, local processing, or rejection).

Recalc Strategy

Node Margin Strategy

Static Strategy

Running experiments

How DFaaS nodes are connected

Improvement proposals: