Best Practices for Database Naming Conventions

By in ,
4270
Best Practices for Database Naming Conventions

The importance of establishing rigorous naming conventions for your Recipes and Ingredients cannot be overstated, especially when working with a large database. A solid naming convention will simplify data organization and allow you to narrow and sort search results to more easily identify your items.

This post walks through best practices and tips for defining your own naming conventions.

Getting Started

Before delving into specifics, start with a few ground rules:

  • Keep it simple. Your naming conventions should be easily understood by everyone in your organization and should follow a logical format.
  • Archive older data first. Avoid a huge overhaul by moving your older, unused Recipes and Ingredients out of the naming project. We suggest creating Groups called “Archived Ingredients” and “Archived Recipes.” Groups can then be hidden from search results.
  • Consider using a unique identifier in the User Code field. If you generally use unique codes in the Ingredient or Recipe names, you can simplify the database name by putting that identifier in the User Code field. Later, you can search by User Code.
  • Stay consistent. Pick a naming convention, document it, and stick to it! Address specifics in your documentation, like capitalization, and make sure to define each naming field.

Naming Convention Dos

Naturally Ordered: Order elements from general (category, family, etc.) to specific (type, flavor, size, etc.) as much as possible, i.e. Latte Nonfat Vanilla (Small 12 oz). This simplifies naming and allows for inferences for naming scenarios that fall outside documented parameters.

Location: If your Ingredient or Recipe is intended for a specific geographic region, be sure to include a region code or abbreviation in your naming convention.

Numbering: When including numbers in a file name always use at least two digits rather than one in order to maintain a correctly sorted numeric order. Specifically, it is important to include the zero for numbers 0-9 (01, 02, 03, etc.) so you don’t end up with 1, 10, 11, 12 … 19, 2, 20, 21 when you want 01, 02, 03 … 19, 20, 21.

Version Control: Some records go through many versions before being finalized and it is important to be able to differentiate between drafts and the final version by giving them each their own designation. (Examples: RecipeA-v01, RecipeA-v02, RecipeA-v03).

Dates: If your Ingredient/Recipe is season- or date-specific, you can list the date in the name or product field. As a best practice, state the date “back to front” with the year first. Examples: YYYYMMDD, YYYYMM, or YYYYQ1.

Naming Convention Don’ts

Abbreviations: Avoid using abbreviations, acronyms, initials, and codes that are not commonly understood whenever possible.

Special Characters/Punctuation: Use of special characters (such as * : \ / < > | ” ? ! [ ] ; = + & £ $) is discouraged.

Take it Up a Notch

For further organization, we suggest assigning ingredients and recipes to specific groups.  Check out our blog post: Using Groups for Organization, Exporting, and Access Control.