Is a Sanity Dataset like a database or a table?
Great question! A dataset is more like a database than a table.
In Sanity's architecture, a dataset is a named, isolated collection of all your JSON documents and assets within a project. Think of it as a complete, self-contained database environment where all your different content types (which you might think of as "tables") live together.
Here's the breakdown:
- Project = Your overall Sanity account/application
- Dataset = A complete database (like
production,development, orstaging) - Document types (defined in your schema) = More like tables within that database
Each dataset is completely isolated from others - you can't directly query data from one dataset while connected to another. This isolation makes datasets perfect for creating separate environments. For example, you might have:
- A
productiondataset with your live content - A
developmentdataset where developers can test schema changes without affecting live content - A
stagingdataset for validating changes before going live
The cool part is that datasets are schemaless, meaning different datasets can have completely different content structures if needed. You can configure your Studio to work with different datasets using environment variables, so running sanity start locally might use your development dataset while sanity deploy uses production.
Free plans include 2 datasets, and paid plans offer more depending on your needs. If you're on an Enterprise plan, you also get access to Advanced Dataset Management features like cloud cloning and hot swapping, which make managing multiple datasets even easier.
Show original thread63 replies
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.