Organizing resources in Workspaces¶
When working with Tinybird, projects can quickly accumulate a multitude of resources. Effective organization is essential for maintaining efficiency and clarity. While there’s no one-size-fits-all approach, we recommend structuring each Workspace around a specific use case. This practice keeps related resources together and simplifies collaboration and management.
In the Tinybird UI, your Data Project is automatically divided into two main folders: Pipes and Data Sources. These folders are fundamental and cannot be deleted or removed. However, you have the flexibility to further organize your resources by assigning specific attributes using Tags.
Organizing resources in the UI¶
Assigning Tags to Resources¶
Tags are a powerful way to categorize and manage your resources. You can add tags to both Pipes and Data Sources:
- For Pipes: You’ll find the option to add tags directly under the title of the Pipe or in the Pipe list screen.
- For Data Sources: Tags can be added in the metadata section of each Data Source or in the Data Source list screen.
When you create a tag, it becomes available to assign to multiple resources, allowing for consistent categorization across your project.
If you didn’t assign tags when creating your resources, you can always add or modify them later from the general lists of Pipes and Data Sources.
Filtering Resources¶
One of the main advantages of using tags is the ability to filter your resources in the sidebar.
For instance, if you have a tag called “latest” to denote the most recent versions of your resources, you can easily filter the sidebar to display only those tagged resources. This is especially helpful when your Workspace contains numerous resources, and you need to focus on specific versions or categories to streamline your workflow.
By effectively using tags, you can enhance your productivity and maintain a well-organized Workspace, making it easier to navigate and manage your Tinybird projects.
Renaming Tags¶
If you need to change the name of a tag, go to any resource that it's tagged with the one you want to replace. Click on it and choose "Rename tag"
Deleting Tags permanently¶
If you need to delete a tag from the whole Workspace, go to any resource that it's tagged with the one you want to delete. Click on it and choose "Delete permanently"
You'll see a list with all resources attached to the tag. Once you confirm, the tag will be deleted and the resources dettached from the tag.
Organizing resources using the CLI¶
Tags are supported in CLI versions 5.8.0 and above.
Tags in datafiles¶
Tags are not restricted to working in the UI. If you use the CLI to manage your projects, you can also add tags to Data Sources and Pipes using their datafiles. The tags syntax is TAGS
followed by comma-separated values, at the top section of the files.
TAGS stock_case, stats
To tag a Data Source, write the TAGS directive right before SCHEMA
tinybird/datasources/example.datasource
TOKEN tracker APPEND DESCRIPTION > Analytics events **landing data source** TAGS stock_case, stats SCHEMA > `timestamp` DateTime `json:$.timestamp`, `session_id` String `json:$.session_id`, `action` LowCardinality(String) `json:$.action`, ...
To tag a Pipe, write the TAGS directive right before the NODE
s settings
tinybird/pipes/sales_by_hour_mv.pipe
DESCRIPTION materialized Pipe to aggregate sales per hour in the sales_by_hour Data Source TAGS stock_case, stats NODE daily_sales SQL > SELECT toStartOfDay(starting_date) day, country, sum(sales) as total_sales FROM teams GROUP BY day, country TYPE MATERIALIZED DATASOURCE sales_by_hour
When you deploy your changes, the resource will get tagged. You can use the tags to filter the data project later in the UI.
Tags get created automatically. You don't have to worry about creating a new one before tagging a resource. If the tag you've written doesn't exist, pushing that file will create it.
To know more about publishing changes to your data project, read the Deployment Strategies docs.
To know more about the datafiles syntax, read the datafiles doc in the CLI section.
tb tag¶
tb tag
is a CLI command to manage your Workspace tags. You can create, list and delete tags in your workspace.
Please refer to the tb tag command reference for more details.
Do you miss any functionality in our tags system? Would you like any other command in the CLI regarding tags? Do you have in mind any other feature that would benefit from our tagging system?
We would love to hear your feedback. Please, contact Tinybird at support@tinybird.co or in the Community Slack.