Skip to content

workspace deletion behavior (should files be deleted?) #274

@Ahmath-Gadji

Description

@Ahmath-Gadji

Description:

There is an ambiguity regarding what should happen to files when a workspace is deleted. This depends on how we conceptually model workspaces.

Case 1 — Workspace as a View

Setting:

  • Collection: main storage of files
  • Partition: logical grouping of data
  • Workspace: behaves like a view over a set of files in a partition

Implication: Yn that case, deleting a workspace should not delete the associated files, similar to deleting a SQL view.

Case 2 — Workspace as a Container / Partition

In Twake, the storage model is the following:

  • One partition per user: Here a partition is akin to a collection
  • The user can create a workspace to work with a set of files: Here a workspace is akin to partition

Implication: In this setup, files are associated with workspaces. When a workspace is deleted, some files may become orphan files (files that are no longer associated with any workspace). Then it does make sense to delete orphan files.

Solution

Allow both behaviors via an API parameter by adding a delete_files boolean option in the endpoint:

@router.delete(
"/partition/{partition}/workspaces/{workspace_id}",
dependencies=[Depends(require_partition_owner)],
)
async def delete_workspace(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions