  The IoT area has grown significantly in the last few years and is expected to
reach a gigantic amount of 50 billion devices by 2020. The appearance of
serverless architectures, specifically highlighting FaaS, raises the question
of the of using such in IoT environments. Combining IoT with a serverless
architectural design can be effective when trying to make use of the local
processing power that exists in a local network of IoT devices and creating a
fog layer that leverages computational capabilities that are closer to the
end-user. In this approach, which is placed between the device and the
serverless function, when a device requests for the execution of a serverless
function will decide based on previous metrics of execution if the serverless
function should be executed locally, in the fog layer of a local network of IoT
devices, or if it should be executed remotely, in one of the available cloud
servers. Therefore, this approach allows to dynamically allocating functions to
the most suitable layer.
