Schema Types

Learn about Document, Managed, and Unmanaged schema types in Nuvix Database

Nuvix Database provides three schema types, each optimized for different use cases and levels of control. Use this guide to choose the right approach for your application.

Document Schema

A NoSQL-style abstraction over PostgreSQL designed for rapid prototyping and developer-friendly use. Document schemas do not require SQL and expose document-based APIs for simplicity and speed.

Key features

  • NoSQL interface: JSON-based document CRUD operations
  • Collection-based: Data organized into collections with user-defined attributes
  • Query operators: Rich filtering and search capabilities
  • ACL permissions: Custom access control at collection and document levels

API structure

/v1/schemas/:schema/collections/:collection/documents

Common use cases

  • Rapid prototyping without SQL knowledge
  • Dynamic, flexible data models
  • NoSQL-style applications
  • Mobile and web app backends

Data definition

  • Collections defined via API
  • Attributes declared per collection
  • Indexes for performance optimization
  • No direct SQL table management required

Document schemas offer read-only SQL access. Use the API layer for any data modifications.

Managed Schema

A PostgreSQL schema governed by Nuvix automation. Managed schemas generate metadata, permission tables, and RLS policies automatically. This approach balances control and convenience.

Key features

  • Full SQL support: Complete PostgreSQL querying capabilities
  • Automatic RLS: Row Level Security policies generated automatically
  • Permission automation: Automatic creation of permission tables
  • Nuvix governance: Simplified management with built-in best practices

Built-in automation

  • Automatic _id column for each table
  • Automatic [table]_perms table for permissions
  • RLS enabled with CRUD policies generated
  • DDL triggers handle policy generation

API structure

/v1/schemas/:schema/tables/:table

Common use cases

  • Production-grade relational applications
  • Multi-tenant systems
  • Enterprise apps requiring structured data governance
  • Applications needing both SQL and API access

Managed schemas provide the best of both worlds: Postgres power with Nuvix automation.

You can also define custom RLS policies and triggers if needed, but the automated system covers most use cases.

Unmanaged Schema

A raw Postgres schema exposed through the Nuvix API without automation. You get complete control over schema design, SQL queries, and access policies.

Key features

  • Full Postgres control: Complete schema and permission management
  • No automation: No automatic RLS or permission tables
  • Manual governance: User-defined access controls and policies
  • Maximum flexibility: Custom constraints, indexes, and relationships

API structure

/v1/schemas/:schema/tables/:table

Common use cases

  • Advanced SQL workloads
  • Legacy database migrations
  • Custom governance systems
  • Complex relational designs

Unmanaged schemas require manual setup of permissions and RLS policies. Choose this option only if you need complete control.

Choosing the right schema type

Use caseRecommended typeReason
Quick prototypingDocumentNo SQL required, fastest setup
Production app with SQLManagedAutomated security with full SQL access
Legacy migrationUnmanagedComplete control over existing schema
Complex relationshipsManaged/UnmanagedFull PostgreSQL feature support
NoSQL-style appDocumentDocument-based API simplicity

How is this guide?

Last update: