Execution Modes#
Lithops compute backends can be classified in 3 different execution modes depending on the backend you choose.
Localhost mode#
The “localhost mode” in Lithops is a convenient feature that enables you to execute functions on your local machine using processes, without relying on cloud resources or serverless computing environments. It serves as the default execution mode if no specific configuration is provided.
To use localhost mode, you can simply write your functions using the Lithops programming model and execute them locally. Lithops will handle the distribution and coordination of the function executions, optimizing performance by leveraging multiple processes.
This mode is particularly useful for development, testing, and debugging purposes, as it eliminates the need to deploy code to a cloud environment during the development phase.
Note
This is the preferable option for starting with Lithops, and for testing (debugging) your applications.
fexec = lithops.LocalhostExecutor()
Available backends: Localhost
Serverless mode#
The “serverless mode” in Lithops is designed to execute functions using publicly accessible serverless compute services, including IBM Cloud Functions, Amazon Lambda, Google Cloud Functions, and more, enabling parallel task execution in isolated cloud environments.
In serverless mode, Lithops leverages the power of these serverless platforms to execute functions as independent tasks. Each function invocation is treated as a separate parallel task, benefiting from the scalability, automatic provisioning of resources, and isolation provided by the serverless compute service.
By utilizing serverless platforms, developers can offload the burden of managing infrastructure and focus solely on writing and deploying their functions. The serverless mode in Lithops abstracts away the complexities of configuring and scaling embarrassingly parallel applications, making it easier to develop and deploy large-scale data processing workloads.
This execution mode offers flexibility and elasticity, as resources are dynamically allocated based on workload demands, ensuring efficient utilization of compute power. It allows developers to seamlessly leverage the scalability and reliability of serverless platforms while benefiting from Lithops’ programming model and distributed computing capabilities.
fexec = lithops.ServerlessExecutor()
Standalone mode#
The “standalone mode” in Lithops provides the capability to execute functions on one or multiple virtual machines (VMs) simultaneously, in a serverless-like fashion, without requiring manual provisioning as everything is automatically created. This mode can be deployed in a private cluster or in the cloud, where functions within each VM are executed using parallel processes.
In standalone mode, Lithops simplifies the deployment and management of VMs, enabling users to effortlessly scale their compute resources to meet the demands of their workloads. By leveraging the automatic creation and configuration of VMs provided by Lithops, developers can focus on writing their functions while Lithops takes care of the underlying infrastructure.
Note
This is the preferable option if your application (or a part) requires a more powerful environment than the ones provided by the Serverless backends (in terms of CPU and Memory).
fexec = lithops.StandaloneExecutor()
Available backends: IBM Virtual Private Cloud, AWS Elastic Compute Cloud (EC2), Azure Virtual Machines, Virtual Machine