Skip to main content

Advanced patterns: Aliases and multi-tenancy

Collection aliases

Collection Aliases

Aliases provide indirection (an intermediate layer) between your application and collections, enabling operational flexibility without downtime.

If you deploy schema changes → Use blue-green deployment with aliases

Products (alias) → ProductsV1 (collection)
(deploy v2) → switch Products (alias) → ProductsV2 (collection)

If you need version management → Use aliases for rollback capability

  • Deploy to new collection, switch alias, keep old version for rollback

Multi-tenancy patterns

Multi-tenancy enables data isolation within a single collection while sharing configuration and indexes.

If customers need strict data isolation → Multi-tenant collection

# Each tenant sees only their data
results = client.collections.use("JournalEntries").with_tenant("customer_123").query...

If tenants have different activity levels → Use tenant states

  • ACTIVE: Normal operations and resource usage
  • INACTIVE: Reduced resource usage, fast reactivation
  • OFFLOADED: Moved to cold storage, slower reactivation
What's next?

Now let's explore access control and security considerations for production deployments.

Login to track your progress