Can Multiple Datasets Have Different Schemas?
Yes, datasets in a Sanity project can absolutely have different schemas! Since Sanity is schemaless at the database level, each dataset can store completely different document types and structures.
How to Manage Different Schemas
You have a few approaches:
1. Single Studio with Workspaces (Recommended for most cases)
Workspaces let you configure multiple isolated Studio environments in one codebase. Each workspace can connect to a different dataset and display only the relevant schema for that dataset. This is the most maintainable approach because:
- You share one codebase but have different configurations
- You can switch between datasets with a dropdown in the Studio
- All schemas are defined in one place, but you conditionally show what's relevant per workspace
The catch is that all possible schemas need to be defined in your Studio config, and you'll want to use conditional desk structures to only show schema relevant to the active dataset.
2. Separate Studio Repos
You can totally have different Git repos (or branches) with completely different Studio configurations pointing to different datasets in the same project. This gives you:
- Complete schema independence
- Simpler individual codebases
- More deployment overhead (you'll need to deploy each Studio separately)
If you go this route, you'd just configure each Studio with a different dataset value in sanity.config.ts but the same projectId.
3. Git Branches (Less Common)
Using Git branches for different datasets is possible but generally not recommended for production setups. It works better for temporary scenarios like testing schema changes before applying them to production.
Which Should You Choose?
- Workspaces: Best when datasets share similar structure or you want centralized management
- Separate repos: Best when datasets are completely different projects (different brands, products, etc.) or when different teams need full independence
- Branches: Best for development/staging/production workflows with the same schema
The multi-tenancy guide has great examples of how companies use these patterns in practice!
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.