In this lesson, you will learn how to create a predictable environment for your analytical team by standardizing how fact tables are named and documented.
As your data warehouse grows, teams often struggle to find the right table for their analysis. If one engineer names a table tbl_sales_final and another names a similar table fact_revenue_daily, users will be confused about which one is authoritative. To solve this, we establish a strict naming convention and maintain a living "data dictionary."
Establishing Naming Conventions
A professional naming convention should be descriptive and consistent. A common standard follows the pattern: fact_[process]_[type].
fact: Indicates the table is a fact table.[process]: Describes the business activity (e.g.,sales,inventory,support_tickets).[type]: Identifies the grain/timing (e.g.,transaction,daily_snapshot,accumulating).
For example, instead of vague names, you might use:
fact_sales_transactionfact_inventory_daily_snapshotfact_order_accumulating
Documenting Metadata
Naming is only half the battle. Documentation provides the "why" and "how" behind the numbers. Every fact table should have an associated metadata entry that includes:
- The Grain: A clear statement of what one row represents (e.g., "One row per individual line item on a customer invoice").
- Date Context: Which business process date this table tracks (e.g.,
order_datevs.ship_date). - Additivity: Whether the metrics are fully additive (can be summed across all dimensions) or semi-additive (like inventory balances that shouldn't be summed over time).
- Owner: The team responsible for maintaining the data.
When a data scientist opens your database, they shouldn't have to hunt for a Slack thread to understand the data. By standardizing these names and maintaining a central repository of documentation, you ensure that anyone—from a junior analyst to an executive—can discover and trust the data immediately.
Key Takeaway: Consistent naming patterns and centralized metadata documentation turn a chaotic database into a discoverable, self-service library for your entire organization.