Naming Standards

Audience

  • Data Modelers

  • Database Administrators

  • Database Developers

  • Application Developers

A simple and consistent naming convention for database objects, when followed rigorously, can help database application developers greatly.

Common Naming Standards

Common standards are followed

  • Singular names for the entities

  • Object name length to be less than 30 chars

  • Lowercase object names separated by an underscore (_)

  • Only defined abbreviations are used

  • No prefix or suffix to the table names

  • Each table is defined as an alias, this alias is used in constraints and index names

Database Naming Standards

The database names will follow the below naming convention mosip_(abbreviated value of the module name)

Ex: mosip_prereg

Schema Naming Standards

The schema name is named after the DB name, by default, without mosip_. If there is more than one schema in a DB, then a proper single-word name is assigned, either a full word or an abbreviated word. Ex: prereg

Table Naming Standards

  • The table name can have one or two words that describe the contents of the table separated by an underscore (_).

  • Table name should always be in the singular.

  • An alias for each table is defined, this alias can be used in various other places like reference keys, indexes, constraints, etc.

Index Naming Standards

Indexes are named as idx_(table-alias)_(column-abbreviation)

Key Naming Standards (Primary, Unique, Foreign Keys)

Primary Key: Each table should have a primary key, the key should be named “pk_table-alias_column-name”. If it is a composite key, then in place of the column name any meaningful name can be provided.

Unique Key: If a surrogate is used as PK then create a unique key, on fields that uniquely define a business key. The naming of the unique key should be “uk_table-alias_column-names”.

Foreign Key: For any references from a table with the other tables, creating a foreign key is mandatory. This helps maintain referential integrity. A foreign key can be named as fk__table-alias1_table-alias2

Attribute Standards

Standardize the attribute implementation-defined the following common datatypes used across the MOSIP system. The datatype sizes are defined to consider multi-language storage support, which may vary based on the implementation.

Acronyms

The following acronyms are used in the data model

Last updated