Appearance
Database Architecture & Multi-Tenancy
Multi-Tenancy Model
GuildUSA implements a high-performance, single-database Multi-User-Per-Tenant (Tenant-Per-Row) architecture.
- All core tables contain a
tenant_idforeign key. - Database queries must scope traffic using Global Query Scopes or explicitly append
.where('tenant_id', $tenantId)to prevent cross-tenant data leaks.
Core Databases
- Main Application Database (
guildusa_main): Manages global tenant accounts, user authentication, billing metadata, subscriptions, and RBAC permissions. - Bot & Media Database (
guildusa_bots): High-throughput transactional database handling live AI bot instances, dialer schedules, and webhook log queues.
Automated Off-Site Backups
- Pipeline: Cron utility executes nightly script at 2:00 AM.
- Storage: Encrypted archives are transferred securely to an isolated Cloudflare R2 backup bucket.
- Retention Policy: Configured with an automated 30-day lifecycle rule for cost efficiency and storage compliance.