Documentation

    Documentation

    Documentation

    Ring Platform Logo

    Завантаження документації...

    Підготовка контенту платформи Ring

    Ring Platform Logo

    Завантаження документації...

    Підготовка контенту платформи Ring

    Ring Platform Logo

    Завантаження документації...

    Підготовка контенту платформи Ring

    1. /
    2. /Database Backend Selection

    Updated Jun 12, 20262 min listen

    1. /
    2. /Database Backend Selection

    Updated Jun 12, 20262 min listen

    1. /
    2. /Database Backend Selection

    Updated Jun 12, 20262 min listen

    Concepts, value, and typical clone scenarios — less code.

    Welcome to Ring
    Quick Reference
    Getting Started
    Prerequisites
    Installation
    Database migrations
    First Success Validation
    Troubleshooting
    Next Steps
    Architecture
    Backend modes and databases
    Data Model
    Authentication Architecture
    Email AI-CRM architecture
    PaymentConductor architecture
    Refcodes architecture
    News Kingdom architecture
    Proxy and internationalization
    Real Time
    Discovery Mutation Sync
    Security
    Features
    Doc System
    Authentication
    Email AI-CRM
    Entities
    Opportunities
    Notifications
    Push Notifications with FCM (Ring-Powered)
    Tunnel Protocol
    Web3 Wallet
    Multi-Vendor Store
    Inventory & Stock
    Vendor Management
    Commissions & Settlements
    Referral Codes (Refcodes)
    Affiliate & Referral Enablement
    Payment Integration
    PaymentConductor
    VideoConductor
    WayForPay Payment Integration
    News Module - Digital Newspaper Experience
    Member Blogs
    Scientific Editor
    Locale System
    Security & Compliance
    NFT Marketplace
    Token Staking System
    Performance Optimization Patterns
    Mobile Experience
    Wallet
    Wallet Security Tips
    API
    Authentication
    Email AI-CRM API
    Entities
    Opportunities
    Messaging API
    Notifications API
    Wallet API
    Store API
    Admin API
    CLI
    Customization
    Quick Start — Your First Ring Clone
    Customization Guide
    Database Backend Selection
    Token Economics Setup
    Payment Gateway Integration
    AI Agent Customization
    Reference Ring deployments
    Branding
    Features
    Localization
    Themes
    Components
    Web3
    Token launch jurisdictions
    Deployment
    Self-hosted deployment
    Vercel
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery
    Development
    Local Setup
    Code Structure
    Documentation components
    Community tooling
    Ring MCP Server
    Generative Images (ImageConductor)
    Autonomous Newsroom (Grok)
    OSS vs enterprise
    Whitelabel Navigation
    Best Practices
    Workflow
    Code Style
    Performance
    Testing
    Deployment
    Debugging
    Contributing
    MCP
    ring-image-create
    ring-video-create
    Roadmap
    Examples
    Quick Start
    Authentication
    Email AI-CRM developer guide
    API Integration Examples
    Web3 Integration
    White Label
    Real World
    API Examples (cURL)
    Integrations
    Ethereum wallets (Wagmi v3)

    Quick entry (CTOs · auditors · agents)

    Welcome — mission & audiences
    Quick Reference
    Getting started
    Architecture & Auth.js
    Backend modes & databases (DB_BACKEND_MODE)
    Self-hosted
    Ring MCP Tools
    Ring MCP Server
    Token economics
    Token launch jurisdictions
    Deploy (Docker · k8s)
    Security & compliance reads
    ringdom.org — LegioX homebase
    Source — MIT license (GitHub)

    Concepts, value, and typical clone scenarios — less code.

    Welcome to Ring
    Quick Reference
    Getting Started
    Prerequisites
    Installation
    Database migrations
    First Success Validation
    Troubleshooting
    Next Steps
    Architecture
    Backend modes and databases
    Data Model
    Authentication Architecture
    Email AI-CRM architecture
    PaymentConductor architecture
    Refcodes architecture
    News Kingdom architecture
    Proxy and internationalization
    Real Time
    Discovery Mutation Sync
    Security
    Features
    Doc System
    Authentication
    Email AI-CRM
    Entities
    Opportunities
    Notifications
    Push Notifications with FCM (Ring-Powered)
    Tunnel Protocol
    Web3 Wallet
    Multi-Vendor Store
    Inventory & Stock
    Vendor Management
    Commissions & Settlements
    Referral Codes (Refcodes)
    Affiliate & Referral Enablement
    Payment Integration
    PaymentConductor
    VideoConductor
    WayForPay Payment Integration
    News Module - Digital Newspaper Experience
    Member Blogs
    Scientific Editor
    Locale System
    Security & Compliance
    NFT Marketplace
    Token Staking System
    Performance Optimization Patterns
    Mobile Experience
    Wallet
    Wallet Security Tips
    API
    Authentication
    Email AI-CRM API
    Entities
    Opportunities
    Messaging API
    Notifications API
    Wallet API
    Store API
    Admin API
    CLI
    Customization
    Quick Start — Your First Ring Clone
    Customization Guide
    Database Backend Selection
    Token Economics Setup
    Payment Gateway Integration
    AI Agent Customization
    Reference Ring deployments
    Branding
    Features
    Localization
    Themes
    Components
    Web3
    Token launch jurisdictions
    Deployment
    Self-hosted deployment
    Vercel
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery
    Development
    Local Setup
    Code Structure
    Documentation components
    Community tooling
    Ring MCP Server
    Generative Images (ImageConductor)
    Autonomous Newsroom (Grok)
    OSS vs enterprise
    Whitelabel Navigation
    Best Practices
    Workflow
    Code Style
    Performance
    Testing
    Deployment
    Debugging
    Contributing
    MCP
    ring-image-create
    ring-video-create
    Roadmap
    Examples
    Quick Start
    Authentication
    Email AI-CRM developer guide
    API Integration Examples
    Web3 Integration
    White Label
    Real World
    API Examples (cURL)
    Integrations
    Ethereum wallets (Wagmi v3)

    Quick entry (CTOs · auditors · agents)

    Welcome — mission & audiences
    Quick Reference
    Getting started
    Architecture & Auth.js
    Backend modes & databases (DB_BACKEND_MODE)
    Self-hosted
    Ring MCP Tools
    Ring MCP Server
    Token economics
    Token launch jurisdictions
    Deploy (Docker · k8s)
    Security & compliance reads
    ringdom.org — LegioX homebase
    Source — MIT license (GitHub)

    Concepts, value, and typical clone scenarios — less code.

    Welcome to Ring
    Quick Reference
    Getting Started
    Prerequisites
    Installation
    Database migrations
    First Success Validation
    Troubleshooting
    Next Steps
    Architecture
    Backend modes and databases
    Data Model
    Authentication Architecture
    Email AI-CRM architecture
    PaymentConductor architecture
    Refcodes architecture
    News Kingdom architecture
    Proxy and internationalization
    Real Time
    Discovery Mutation Sync
    Security
    Features
    Doc System
    Authentication
    Email AI-CRM
    Entities
    Opportunities
    Notifications
    Push Notifications with FCM (Ring-Powered)
    Tunnel Protocol
    Web3 Wallet
    Multi-Vendor Store
    Inventory & Stock
    Vendor Management
    Commissions & Settlements
    Referral Codes (Refcodes)
    Affiliate & Referral Enablement
    Payment Integration
    PaymentConductor
    VideoConductor
    WayForPay Payment Integration
    News Module - Digital Newspaper Experience
    Member Blogs
    Scientific Editor
    Locale System
    Security & Compliance
    NFT Marketplace
    Token Staking System
    Performance Optimization Patterns
    Mobile Experience
    Wallet
    Wallet Security Tips
    API
    Authentication
    Email AI-CRM API
    Entities
    Opportunities
    Messaging API
    Notifications API
    Wallet API
    Store API
    Admin API
    CLI
    Customization
    Quick Start — Your First Ring Clone
    Customization Guide
    Database Backend Selection
    Token Economics Setup
    Payment Gateway Integration
    AI Agent Customization
    Reference Ring deployments
    Branding
    Features
    Localization
    Themes
    Components
    Web3
    Token launch jurisdictions
    Deployment
    Self-hosted deployment
    Vercel
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery
    Development
    Local Setup
    Code Structure
    Documentation components
    Community tooling
    Ring MCP Server
    Generative Images (ImageConductor)
    Autonomous Newsroom (Grok)
    OSS vs enterprise
    Whitelabel Navigation
    Best Practices
    Workflow
    Code Style
    Performance
    Testing
    Deployment
    Debugging
    Contributing
    MCP
    ring-image-create
    ring-video-create
    Roadmap
    Examples
    Quick Start
    Authentication
    Email AI-CRM developer guide
    API Integration Examples
    Web3 Integration
    White Label
    Real World
    API Examples (cURL)
    Integrations
    Ethereum wallets (Wagmi v3)

    Quick entry (CTOs · auditors · agents)

    Welcome — mission & audiences
    Quick Reference
    Getting started
    Architecture & Auth.js
    Backend modes & databases (DB_BACKEND_MODE)
    Self-hosted
    Ring MCP Tools
    Ring MCP Server
    Token economics
    Token launch jurisdictions
    Deploy (Docker · k8s)
    Security & compliance reads
    ringdom.org — LegioX homebase
    Source — MIT license (GitHub)
    Docs
    Customization
    Docs
    Customization
    Docs
    Customization

    Database Backend Selection

    Executive summary

    Production Ring clones use DB_BACKEND_MODE=k8s-postgres-fcm — PostgreSQL for application data, Firebase Admin only for FCM push when configured. Legacy DATABASE_MODE is removed. Pick a mode before first boot.

    Backend modes (architecture)

    Adapters, FCM vs Firestore, DB_HYBRID_MODE

    Database migrations

    schema.sql + kingdom migration order

    Quick Start

    First clone with Postgres

    DB_BACKEND_MODE decision

    The three modes

    DB_BACKEND_MODEApplication dataFirestore for DB?Push
    k8s-postgres-fcmPostgreSQL (self-hosted, k3s, Docker)NoFCM + Apple when configured
    supabase-fcmPostgreSQL on SupabaseNoSame FCM pattern
    firebase-fullFirestore pathsYesFull Firebase stack

    Implementation: lib/database/backend-mode-config.ts, lib/database/DatabaseService.ts, lib/database/BackendSelector.ts.

    ConnectPlatform (connect-brand.com) is realtime collaboration — not a DB_BACKEND_MODE adapter. See Tunnel protocol.

    Setup by mode

    Recommended default

    OSS self-host, k3s, Ringdom handoff, PaymentConductor, News Kingdom, data/schema.sql v4.

    1. 1

      Set mode and connection in .env.local:

      Optional: DB_POOL_SIZE, DB_TIMEOUT, DB_RETRIES.

    2. 2

      Provision PostgreSQL 14+ (18 recommended locally) — Docker docker-compose.dev.yml, Homebrew bootstrap, or your cluster.

    3. 3

      Apply schema and migrations:

      Full order: Database migrations.

    4. 4

      FCM (optional): set NEXT_PUBLIC_FIREBASE_* + service account from env.local.template. App data stays on Postgres.

    What not to use

    Legacy / invalidReplacement
    DATABASE_MODE=firebase_only / postgresql_onlyDB_BACKEND_MODE values above
    npm run db:migrate / db:backup./scripts/run-migration.sh, pg_dump
    DB_HYBRID_MODE as primary switchDB_BACKEND_MODE — see architecture page

    Changing modes later

    1. 1

      Export data from source (Firestore export or pg_dump).

    2. 2

      Provision target Postgres; apply migrations.

    3. 3

      Update DB_BACKEND_MODE and connection secrets on staging.

    4. 4

      Smoke-test auth, store, payments, news before production cutover.

    Pre-launch checklist (Postgres-primary):

    • DB_BACKEND_MODE set — app starts clean
    • data/schema.sql + kingdom migrations applied
    • Backups configured (pg_dump, CNPG, provider snapshots)
    • FCM vars only if push required
    • 004_payment_transactions.sql if using payments

    Environment config

    Secret groupings and locale vars

    Payment integration

    Requires Postgres ledger

    Quick Start (new clone)

    One deployment per customer — Ringdom pattern

    Database Backend Selection

    Executive summary

    Production Ring clones use DB_BACKEND_MODE=k8s-postgres-fcm — PostgreSQL for application data, Firebase Admin only for FCM push when configured. Legacy DATABASE_MODE is removed. Pick a mode before first boot.

    Backend modes (architecture)

    Adapters, FCM vs Firestore, DB_HYBRID_MODE

    Database migrations

    schema.sql + kingdom migration order

    Quick Start

    First clone with Postgres

    DB_BACKEND_MODE decision

    The three modes

    DB_BACKEND_MODEApplication dataFirestore for DB?Push
    k8s-postgres-fcmPostgreSQL (self-hosted, k3s, Docker)NoFCM + Apple when configured
    supabase-fcmPostgreSQL on SupabaseNoSame FCM pattern
    firebase-fullFirestore pathsYesFull Firebase stack

    Implementation: lib/database/backend-mode-config.ts, lib/database/DatabaseService.ts, lib/database/BackendSelector.ts.

    ConnectPlatform (connect-brand.com) is realtime collaboration — not a DB_BACKEND_MODE adapter. See Tunnel protocol.

    Setup by mode

    Recommended default

    OSS self-host, k3s, Ringdom handoff, PaymentConductor, News Kingdom, data/schema.sql v4.

    1. 1

      Set mode and connection in .env.local:

      Optional: DB_POOL_SIZE, DB_TIMEOUT, DB_RETRIES.

    2. 2

      Provision PostgreSQL 14+ (18 recommended locally) — Docker docker-compose.dev.yml, Homebrew bootstrap, or your cluster.

    3. 3

      Apply schema and migrations:

      Full order: Database migrations.

    4. 4

      FCM (optional): set NEXT_PUBLIC_FIREBASE_* + service account from env.local.template. App data stays on Postgres.

    What not to use

    Legacy / invalidReplacement
    DATABASE_MODE=firebase_only / postgresql_onlyDB_BACKEND_MODE values above
    npm run db:migrate / db:backup./scripts/run-migration.sh, pg_dump
    DB_HYBRID_MODE as primary switchDB_BACKEND_MODE — see architecture page

    Changing modes later

    1. 1

      Export data from source (Firestore export or pg_dump).

    2. 2

      Provision target Postgres; apply migrations.

    3. 3

      Update DB_BACKEND_MODE and connection secrets on staging.

    4. 4

      Smoke-test auth, store, payments, news before production cutover.

    Pre-launch checklist (Postgres-primary):

    • DB_BACKEND_MODE set — app starts clean
    • data/schema.sql + kingdom migrations applied
    • Backups configured (pg_dump, CNPG, provider snapshots)
    • FCM vars only if push required
    • 004_payment_transactions.sql if using payments

    Environment config

    Secret groupings and locale vars

    Payment integration

    Requires Postgres ledger

    Quick Start (new clone)

    One deployment per customer — Ringdom pattern

    Database Backend Selection

    Executive summary

    Production Ring clones use DB_BACKEND_MODE=k8s-postgres-fcm — PostgreSQL for application data, Firebase Admin only for FCM push when configured. Legacy DATABASE_MODE is removed. Pick a mode before first boot.

    Backend modes (architecture)

    Adapters, FCM vs Firestore, DB_HYBRID_MODE

    Database migrations

    schema.sql + kingdom migration order

    Quick Start

    First clone with Postgres

    DB_BACKEND_MODE decision

    The three modes

    DB_BACKEND_MODEApplication dataFirestore for DB?Push
    k8s-postgres-fcmPostgreSQL (self-hosted, k3s, Docker)NoFCM + Apple when configured
    supabase-fcmPostgreSQL on SupabaseNoSame FCM pattern
    firebase-fullFirestore pathsYesFull Firebase stack

    Implementation: lib/database/backend-mode-config.ts, lib/database/DatabaseService.ts, lib/database/BackendSelector.ts.

    ConnectPlatform (connect-brand.com) is realtime collaboration — not a DB_BACKEND_MODE adapter. See Tunnel protocol.

    Setup by mode

    Recommended default

    OSS self-host, k3s, Ringdom handoff, PaymentConductor, News Kingdom, data/schema.sql v4.

    1. 1

      Set mode and connection in .env.local:

      Optional: DB_POOL_SIZE, DB_TIMEOUT, DB_RETRIES.

    2. 2

      Provision PostgreSQL 14+ (18 recommended locally) — Docker docker-compose.dev.yml, Homebrew bootstrap, or your cluster.

    3. 3

      Apply schema and migrations:

      Full order: Database migrations.

    4. 4

      FCM (optional): set NEXT_PUBLIC_FIREBASE_* + service account from env.local.template. App data stays on Postgres.

    What not to use

    Legacy / invalidReplacement
    DATABASE_MODE=firebase_only / postgresql_onlyDB_BACKEND_MODE values above
    npm run db:migrate / db:backup./scripts/run-migration.sh, pg_dump
    DB_HYBRID_MODE as primary switchDB_BACKEND_MODE — see architecture page

    Changing modes later

    1. 1

      Export data from source (Firestore export or pg_dump).

    2. 2

      Provision target Postgres; apply migrations.

    3. 3

      Update DB_BACKEND_MODE and connection secrets on staging.

    4. 4

      Smoke-test auth, store, payments, news before production cutover.

    Pre-launch checklist (Postgres-primary):

    • DB_BACKEND_MODE set — app starts clean
    • data/schema.sql + kingdom migrations applied
    • Backups configured (pg_dump, CNPG, provider snapshots)
    • FCM vars only if push required
    • 004_payment_transactions.sql if using payments

    Environment config

    Secret groupings and locale vars

    Payment integration

    Requires Postgres ledger

    Quick Start (new clone)

    One deployment per customer — Ringdom pattern