Recommended Data Catalog and Tracking Plans Directory Structure
Alpha
Learn about the recommended directory structure for organizing your Data Catalog resources and Tracking Plans as YAML files.
Available Plans
free
starter
growth
enterprise
6 minute read
This guide outlines a recommended directory structure for organizing your RudderStack Data Catalog resources and Tracking Plans as YAML files in a Git repository.
How Rudder CLI works
The Rudder CLI tool (rudder-cli) is flexible in how it processes your YAML files:
File discovery: The CLI recursively scans the specified directory (or project root) for all .yaml and .yml files.
Flexible organization: You can organize files in any directory structure that makes sense for your project.
No naming requirements: File names and directory names are completely flexible—the CLI identifies resources by their kind and content, not file location.
Important YAML file requirements
Before organizing your files, understand these critical requirements:
Single YAML object per file
Each YAML file must contain exactly one YAML document/object with the standard structure:
Can contain multiple event definitions in the spec.events array
kind: properties
Can contain multiple property definitions in the spec.properties array
kind: custom-types
Can contain multiple custom type definitions in the spec.types array
kind: tp
Contains exactly one Tracking Plan definition
Unique resource identification
Each resource (event, property, custom type, Tracking Plan) must have a unique id across the entire project.
No duplicate id values are allowed, even across different YAML files.
Rudder CLI uses kind + metadata.name + resource id to create unique references.
Tracking Plan limitation
Each Tracking Plan YAML file (kind: tp) can define only one Tracking Plan.
If you need multiple Tracking Plans, create separate YAML files for each.
Recommended directory structure
The recommended directory structure offers developers a clear organizational hierarchy for configuration files while maintaining high-level alignment with the Data Governance structure in the RudderStack UI:
The Data Catalog and Tracking Plans are managed in separate, dedicated folders
Business logic is reflected by grouping events and properties into business-specific folders (for example, /product and /marketing)
In complex environments, you can maintain clarity by using separate files for similar assets within a business-specific folder (for example, the events/checkout folder has separate files for cart-events and purchase-events)
Tracking Plans are grouped by source
In complex environments, you can create dedicated Tracking Plans for use cases within a source folder (for example, /tracking-plans/web/checkout-flow.yaml)
When creating Tracking Plans, you can reference resources using the following format:
# Reference to an event$ref:"#/events/[metadata.name]/[event.id]"# Reference to a property $ref:"#/properties/[metadata.name]/[property.id]"# Reference to a custom type (in property definitions)type:"#/custom-types/[metadata.name]/[type.id]"
Example file contents
The following are some example file contents for the recommended directory structure:
version:rudder/v0.1kind:custom-typesmetadata:name:identifier-typesspec:types:- id:sku_typename:"SKU Type"description:"Custom type for SKU validation"type:stringconfig:minLength:5maxLength:255pattern:"^SKU-[0-9]+$"
version:rudder/v0.1kind:eventsmetadata:name:product-eventsspec:events:- id:product_viewedname:"Product Viewed"event_type:trackdescription:"User viewed a product"- id:product_added_to_cartname:"Product Added to Cart"event_type:trackdescription:"User added product to cart"
version:rudder/v0.1kind:tpmetadata:name:web-ecommerce-planspec:id:web_ecommerce_tracking_plandisplay_name:"Web E-commerce Tracking Plan"description:"Tracking Plan for web e-commerce events"rules:- type:event_ruleid:product_viewed_ruleevent:$ref:"#/events/product-events/product_viewed"allow_unplanned:falseproperties:- $ref:"#/properties/product-properties/product_sku"required:true- $ref:"#/properties/product-properties/product_name"required:false
Benefits of the recommended structure
Scalability: It is easy to add new domains, platforms, or resource types.
Maintainability: Clear organization makes finding and updating resources simple.
Reusability: Common properties and custom types can be easily referenced across different Tracking Plans.
Collaboration: Team members can work on different domains without merge conflicts.
Flexibility: While providing structure, allows teams to adapt the organization to their specific needs.
Get started
Choose an organizational approach that fits your team’s workflow.
Ensure all resource id values are unique across your entire project.
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
This site uses cookies to improve your experience. If you want to
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.