Sanity
Sanity is a headless CMS that treats content as structured data in a real-time 'Content Lake.' Unlike traditional CMS platforms, Sanity lets you define content schemas in code (TypeScript/JavaScript) and query content with GROQ, its custom query language. It's built for developers who want full control over content architecture and real-time collaboration.
§ 1 Definition
Sanity is a cloud-hosted, API-first Headless CMS founded in 2015. It differentiates itself through three core innovations: the Content Lake (a real-time, queryable database that stores content as structured data rather than pages or entries), GROQ (a custom query language for fetching exactly the content you need), and a developer-first approach where content schemas are defined in code. Unlike Contentful which provides a visual content modeling interface, Sanity expects developers to define content models in TypeScript or JavaScript. This makes it more flexible for complex content architectures but requires developer involvement for any schema changes. Sanity is widely used with modern frontend frameworks like Next.js, Nuxt, and SvelteKit, and excels at multi-channel content delivery and real-time collaboration.
§ 2 The Content Lake and GROQ
Sanity's Content Lake is its most distinctive feature. It's not a traditional database with tables and rows. It's a real-time, document-oriented data store that treats content as JSON-like documents. Every piece of content (a blog post, product description, author bio, site settings) is a document with a defined schema. Documents can reference each other, creating rich content relationships. GROQ (Graph-Relational Object Queries) is Sanity's custom query language. It's more powerful than REST endpoints and more flexible than GraphQL. A typical GROQ query looks like: ```groq *[_type == "post" && published == true] | order(publishedAt desc) [0...10] { title, slug, excerpt, "author": author->name, "categories": categories[]->title } ``` This query fetches published posts, joins author and category references, orders by date, and limits to 10 results. All in one request. Content updates in the Content Lake are reflected immediately in queries. The Content Lake also supports real-time subscriptions, so frontend applications can listen for content changes and update in real time without polling.
§ 3 Sanity vs Contentful vs Strapi
The three most compared headless CMS options serve different needs: Sanity is for teams that want maximum flexibility. Content schemas in code. Real-time collaboration. Custom query language (GROQ). Great developer experience. Content editors get a clean, customizable Studio interface. Best for: teams with strong frontend engineering that need a flexible, real-time content platform. [Contentful](/glossary/contentful) is for enterprise teams that need governance. Visual content modeling. Rich roles and permissions. SLAs and enterprise support. More structured migration workflows. Contentful is more expensive and less flexible than Sanity, but it provides guardrails that enterprise organizations need. Best for: regulated industries, large content teams, enterprises needing vendor support. [Strapi](/glossary/strapi) is for teams that want self-hosted control. Open source, MIT license. You host it yourself. Admin panel is generated from content types. Plugin system for extensions. Strapi gives you the most control over infrastructure but requires you to manage hosting, database, and updates. Best for: teams that need to self-host, want to avoid SaaS fees, or need on-premise deployment. Atomic Glue's take: We use Sanity for most headless projects. The developer experience and real-time content lake are genuinely better. We use Contentful when clients require enterprise SLAs or have non-negotiable content governance requirements. We use Strapi when clients need on-premise or air-gapped deployment.
§ 4 Sanity Pricing and Scale
Sanity offers a generous free tier (up to 3 users, 100,000 documents, 10 GB bandwidth) that covers small projects and development. Paid plans start at $15/user/month for the Growth tier, scaling to Enterprise with custom pricing, dedicated support, and advanced security. Sanity bills on usage beyond the tier limits: documents, bandwidth, API requests, and asset storage. This metered model means costs scale with content volume and traffic. For high-traffic sites with large content libraries, costs can add up. For most sites, Sanity's pricing is competitive with other headless CMS platforms and often cheaper than Contentful at similar scales. The Studio (the content editing interface) is completely customizable and self-hosted or cloud-hosted. You can brand it, customize field components, and build custom editing tools. This is a significant advantage over Contentful, where the editor interface is fixed.
§ 5 In code
// Define a Sanity schema (TypeScript)
export default {
name: 'post',
title: 'Blog Post',
type: 'document',
fields: [
{ name: 'title', type: 'string', title: 'Title', validation: Rule => Rule.required() },
{ name: 'slug', type: 'slug', title: 'Slug', options: { source: 'title' } },
{ name: 'author', type: 'reference', to: [{ type: 'author' }] },
{ name: 'body', type: 'blockContent', title: 'Body' },
{ name: 'publishedAt', type: 'datetime', title: 'Published At' },
],
preview: {
select: { title: 'title', media: 'mainImage' }
}
}§ 6 Common questions
- Q. Is Sanity free to use?
- A. Yes, Sanity has a free tier that covers small projects: 3 users, 100,000 documents, 10 GB bandwidth, and 1 GB asset storage. Paid plans start at $15/user/month.
- Q. What is GROQ?
- A. GROQ (Graph-Relational Object Queries) is Sanity's custom query language. It's more powerful than REST endpoints and more flexible than GraphQL for fetching specific slices of content across document relationships.
- Q. Do you need to code to use Sanity?
- A. Yes, for setup and schema changes. Content editors use the Studio interface without coding. But developer involvement is required for content modeling, frontend integration, and infrastructure configuration.
- Sanity is a headless CMS with a real-time Content Lake, code-defined schemas, and the GROQ query language.
- It offers more flexibility than Contentful but requires more developer involvement for content modeling.
- Real-time collaboration and customizable Studio set it apart from other headless CMS options.
- Sanity is a strong choice for teams with frontend engineering resources who need a flexible, API-first content platform.
We build on Sanity for clients who need a flexible, real-time headless CMS. Custom Studio configurations, complex GROQ queries, and seamless frontend integration with Next.js or Nuxt. Modern content infrastructure for modern teams. Get in touch.
Get in touchSanity is a headless CMS that treats content as structured data in a real-time 'Content Lake.' Unlike traditional CMS platforms, Sanity lets you define content schemas in code (TypeScript/JavaScript) and query content with GROQ, its custom query language. It's built for developers who want full control over content architecture and real-time collaboration.
Category: Cms
Author: Atomic Glue Editorial Team
## Definition
Sanity is a cloud-hosted, API-first [Headless CMS](/glossary/headless-cms) founded in 2015. It differentiates itself through three core innovations: the Content Lake (a real-time, queryable database that stores content as structured data rather than pages or entries), GROQ (a custom query language for fetching exactly the content you need), and a developer-first approach where content schemas are defined in code. Unlike [Contentful](/glossary/contentful) which provides a visual content modeling interface, Sanity expects developers to define content models in TypeScript or JavaScript. This makes it more flexible for complex content architectures but requires developer involvement for any schema changes. Sanity is widely used with modern frontend frameworks like Next.js, Nuxt, and SvelteKit, and excels at multi-channel content delivery and real-time collaboration.
## The Content Lake and GROQ
Sanity's Content Lake is its most distinctive feature. It's not a traditional database with tables and rows. It's a real-time, document-oriented data store that treats content as JSON-like documents. Every piece of content (a blog post, product description, author bio, site settings) is a document with a defined schema. Documents can reference each other, creating rich content relationships. **GROQ (Graph-Relational Object Queries)** is Sanity's custom query language. It's more powerful than REST endpoints and more flexible than GraphQL. A typical GROQ query looks like: ```groq *[_type == "post" && published == true] | order(publishedAt desc) [0...10] { title, slug, excerpt, "author": author->name, "categories": categories[]->title } ``` This query fetches published posts, joins author and category references, orders by date, and limits to 10 results. All in one request. Content updates in the Content Lake are reflected immediately in queries. The Content Lake also supports real-time subscriptions, so frontend applications can listen for content changes and update in real time without polling.
## Sanity vs Contentful vs Strapi
The three most compared headless CMS options serve different needs: **Sanity** is for teams that want maximum flexibility. Content schemas in code. Real-time collaboration. Custom query language (GROQ). Great developer experience. Content editors get a clean, customizable Studio interface. Best for: teams with strong frontend engineering that need a flexible, real-time content platform. **[Contentful](/glossary/contentful)** is for enterprise teams that need governance. Visual content modeling. Rich roles and permissions. SLAs and enterprise support. More structured migration workflows. Contentful is more expensive and less flexible than Sanity, but it provides guardrails that enterprise organizations need. Best for: regulated industries, large content teams, enterprises needing vendor support. **[Strapi](/glossary/strapi)** is for teams that want self-hosted control. Open source, MIT license. You host it yourself. Admin panel is generated from content types. Plugin system for extensions. Strapi gives you the most control over infrastructure but requires you to manage hosting, database, and updates. Best for: teams that need to self-host, want to avoid SaaS fees, or need on-premise deployment. **Atomic Glue's take:** We use Sanity for most headless projects. The developer experience and real-time content lake are genuinely better. We use Contentful when clients require enterprise SLAs or have non-negotiable content governance requirements. We use Strapi when clients need on-premise or air-gapped deployment.
## Sanity Pricing and Scale
Sanity offers a generous free tier (up to 3 users, 100,000 documents, 10 GB bandwidth) that covers small projects and development. Paid plans start at $15/user/month for the Growth tier, scaling to Enterprise with custom pricing, dedicated support, and advanced security. Sanity bills on usage beyond the tier limits: documents, bandwidth, API requests, and asset storage. This metered model means costs scale with content volume and traffic. For high-traffic sites with large content libraries, costs can add up. For most sites, Sanity's pricing is competitive with other headless CMS platforms and often cheaper than Contentful at similar scales. The Studio (the content editing interface) is completely customizable and self-hosted or cloud-hosted. You can brand it, customize field components, and build custom editing tools. This is a significant advantage over Contentful, where the editor interface is fixed.
## In code
// Define a Sanity schema (TypeScript)
export default {
name: 'post',
title: 'Blog Post',
type: 'document',
fields: [
{ name: 'title', type: 'string', title: 'Title', validation: Rule => Rule.required() },
{ name: 'slug', type: 'slug', title: 'Slug', options: { source: 'title' } },
{ name: 'author', type: 'reference', to: [{ type: 'author' }] },
{ name: 'body', type: 'blockContent', title: 'Body' },
{ name: 'publishedAt', type: 'datetime', title: 'Published At' },
],
preview: {
select: { title: 'title', media: 'mainImage' }
}
}## Common questions
Q: Is Sanity free to use?
A: Yes, Sanity has a free tier that covers small projects: 3 users, 100,000 documents, 10 GB bandwidth, and 1 GB asset storage. Paid plans start at $15/user/month.
Q: What is GROQ?
A: GROQ (Graph-Relational Object Queries) is Sanity's custom query language. It's more powerful than REST endpoints and more flexible than GraphQL for fetching specific slices of content across document relationships.
Q: Do you need to code to use Sanity?
A: Yes, for setup and schema changes. Content editors use the Studio interface without coding. But developer involvement is required for content modeling, frontend integration, and infrastructure configuration.
## Key takeaways
- Sanity is a headless CMS with a real-time Content Lake, code-defined schemas, and the GROQ query language.
- It offers more flexibility than Contentful but requires more developer involvement for content modeling.
- Real-time collaboration and customizable Studio set it apart from other headless CMS options.
- Sanity is a strong choice for teams with frontend engineering resources who need a flexible, API-first content platform.
## Related entries
- [Headless CMS](atomicglue.co/glossary/headless-cms)
- [Contentful](atomicglue.co/glossary/contentful)
- [Strapi](atomicglue.co/glossary/strapi)
- [Payload CMS](atomicglue.co/glossary/payload-cms)
- [CMS](atomicglue.co/glossary/cms)
Last updated July 2025. Permalink: atomicglue.co/glossary/sanity