Database Reference
Status: Current
Last reviewed: 2026-05-10
This page reflects nexus-backend/migrations/001_initial_schema.sql through 014_unified_enc_credentials.sql.
Core Tables
nodes
Node inventory and agent connectivity.
Important columns:
idnamepublic_ipstatuslast_heartbeatmetadataiso_3166_codesecret_hashconnect_addressmultiplexmultiplex_port
Historical note: WireGuard-specific columns were removed by migration 008. Region/datacenter/latitude/longitude were removed or replaced by migration 009.
node_links
Measured topology edges between nodes.
Important columns:
from_node_idto_node_idlatency_mspacket_lossbandwidth_mbpsjitter_msupdated_at
routes
Legacy/unified route table. It still exists, but L4 chains are the primary gateway workflow.
Important columns include:
nameprotocoldomainportenabledpriorityl4_protocoll4_listen_addrl4_listen_portl4_tlsl4_tls_cert_domainl7_protocoll7_host_matchl7_path_matchupstream_cluster_namelb_strategyrate_limit_rpstimeout_msretry_countserver_names
Historical note: route_rules was merged into routes and later dropped by migration 010.
route_hops
Ordered hop metadata for legacy routes.
Important columns:
route_idnode_idhop_orderactionconfig
tunnel_chains
Current L4 chain storage.
Important columns:
idnameclient_protocolenabledstagesversioncreated_atupdated_at
stages is JSON and carries the per-hop chain model used by backend deployment.
upstream_clusters
Current upstream endpoint registry.
Important columns:
idnameendpointhealth_check_pathhealth_check_interval_msenabled
Historical note: endpoints[] and upstream-local lb_strategy were simplified by migration 011.
enc_keys
Unified encryption credentials.
Important columns:
idnamepublic_keyprivate_keykey_typemetadatacreated_at
Supported key types:
udp_noise: X25519 key pair for UDP Noise / legacy ENC.tls_cert: TLS certificate/key PEM stored in public/private fields.reality: X25519 REALITY key material plus metadata.
auth_users
RBAC user accounts.
Important columns:
usernamepassword_hashroletotp_secretdisabledlast_login_at
audit_logs
Immutable audit trail.
Important columns:
user_idactionresource_typeresource_idold_statenew_statediffip_addressuser_agentcreated_at
certificates
Certificate storage was created by the initial schema and is used by TLS APIs.
Current Gaps
The L3PTP roadmap requires future tables for L3 networks, endpoints, and routes. Those tables do not exist yet. See L3PTP REALITY.