Browse topics

Database

Nocly Shortener stores everything in one MySQL or MariaDB database using the utf8mb4 character set. All dates are stored in UTC and shown in each user's time zone.

Tables

TableContents
users, user_sessions, user_tokensAccounts, signed-in sessions, password reset and email verification tokens
settingsAdmin settings (name/value)
domains, domain_checksMain and custom short domains, verification history
links, tags, link_tagsShort links and their tags
clicks, link_visitorsClick analytics and unique visitor tracking
api_keys, api_request_logsAPI keys (secrets stored as one-way hashes) and request logs
idempotency_keysDuplicate-submission protection for forms and the API
rate_limitsRate limit counters
webhooks, webhook_deliveriesWebhook endpoints (secrets encrypted) and the delivery queue
abuse_reports, blocklist, moderation_actionsAbuse handling
audit_logsTamper-evident record of important actions
system_logs, cron_runsApplication logs and cron history
backupsBackup records

The schema is in database/schema.sql (not web-accessible) and is created by the installer.

Integrity

  • Short aliases are unique per domain and case-insensitive: Promo and promo are the same link.
  • Click limits are enforced with an atomic database update, so a link with a limit of 100 never redirects more than 100 times, even under heavy concurrent traffic.
  • Foreign keys remove dependent data when a user, link or webhook is deleted.
  • Multi-step operations (installation, registration, link creation) run in transactions and leave no partial records on failure.

Size and retention

The clicks table grows with traffic. The daily cron cleanup removes:

  • clicks older than the analytics retention period (default 365 days),
  • system logs, API request logs, cron history and finished webhook deliveries older than the log retention period (default 90 days),
  • expired tokens, sessions, idempotency keys and rate limit counters.

Audit logs are never removed automatically.

Backups

Use Admin → Backup & restore for complete backups. You can also use cPanel's Backup or phpMyAdmin → Export. See Backup.