Data Lab Functions vs. Data Lab Projects
In Seeq, Data Lab projects can be configured to serve as an arbitrary coding environment (the most common) or as a backend service. Under the hood, this is done through the project_type
property of the Seeq SDK /projects
API. The project_type
property is an Enum that supports either DATA_LAB_FUNCTIONS
representing the backend service configuration or DATA_LAB
(the default value) for the standard JupyterLab environment, which is a Data Lab Project.
Shared Resources and Dynamic Efficiency
A key divergence between these two project types lies in how they handle resources and user interactions. When an Add-On calls a Data Lab Project, a new project is initiated for each user, each needing to wait for the project to start. In contrast, Data Lab Functions efficiently share resources among users, dynamically setting up a Data Lab Project when a front-end Add-On initiates a call to a Data Lab Functions endpoint. This collaborative resource-sharing approach eliminates the time-consuming process of spinning up new projects for each user, resulting in a more responsive and streamlined experience.
It's essential to note that Data Lab Functions projects remain active and ready to respond to requests. By default, they are shutdown after 3 days of inactivity. In contrast, Data Lab Projects are shutdown after 5 minutes of inactivity, reflecting their more transient nature.
Restricted Access for Code Security
One noteworthy aspect is the accessibility of these projects to users. Data Lab Functions prioritize code security by restricting user access. If a user attempts to open a project classified as a Data Lab Function, they will be notified that entry is prohibited.
This stringent control ensures that the underlying code remains confidential and inaccessible to users. In contrast, Data Lab Projects allow users to open them, even with read-only access. While users can view the project, they are unable to make modifications, striking a balance between visibility and security.
For more detailed information on the different Add-on Elements, please refer to our dedicated Add-On Extension Mechanisms page.
To explore insights on resource sizing, head over the Resource Sizing Options of our Elements guide.
In summary, the choice between Data Lab Functions and Data Lab Projects hinges on the desired balance between resource efficiency and code security. Understanding these key differences empowers Add-On developers to make informed decisions based on the specific requirements of their applications.