Naming conventions
This page describes naming conventions for databases, tables, and columns.
Consistent naming improves readability, reduces confusion, and makes it easier to work across services and teams.
General principles
Section titled “General principles”All database-related names should be:
- Descriptive
- Consistent
- Easy to read
- Predictable across services
Avoid abbreviations unless they are well-known and consistently used.
Database names
Section titled “Database names”Database names must be:
- Singular
- Written in
snake_case - Lowercase
Examples:
device_flowdevicedevice_data_flowoutageTable names
Section titled “Table names”Table names must be:
- Singular
- Written in
snake_case - Lowercase
Examples:
organizationrulenotificationRelationship (join) tables
Section titled “Relationship (join) tables”For relationship tables, include the names of both related tables.
Examples:
rule_notificationrule_operationnotification_smsColumn names
Section titled “Column names”Column names must be:
- Written in
snake_case - Descriptive
- Lowercase
Examples:
created_atupdated_atnamedescriptionIdentifier columns
Section titled “Identifier columns”- Primary keys should be named
id - Foreign keys should reference the related table name
Examples:
iduser_idorganization_idTimestamp columns
Section titled “Timestamp columns”Use the following timestamp columns where applicable:
created_atupdated_atThese columns should be:
- Automatically set by the system
- Stored in UTC
Reserved keywords
Section titled “Reserved keywords”Avoid using reserved SQL keywords for database, table, or column names.
If unavoidable, choose a more descriptive alternative rather than relying on quoting.
Summary
Section titled “Summary”- Use
snake_casefor all database identifiers - Keep names singular and descriptive
- Follow the same conventions across all services