Fuuz Schema Design Standards

Fuuz Schema Design Standards

This article provides an introduction to Fuuz schema design standards.

Depending on the version, some of the schema design standards may be enforced by Fuuz, making it impossible to violate some of the standards.

Custom Schema

  • Always start with a standard MES schema

    • Add fields or tables as needed

    • (Optionally) Consider suggesting changes to the standard package

  • Search for schema before adding a new schema

  • Never delete any standard MES schema

    • Someone else may need it in the future

    • Skip screen generations for anything not being using

  • A copy of integrations (aka dataflows) pushing the standard data into tables will be required for our standard packages

    • Example: pushing basic customer data into standard tables

    • Export a version with any custom fields or tables removed

Example Schemas

Documentation

Documentation is auto-generated for the entire API model. 

  • Some screens may rely on the documentation for field level help

  • Each table must have a description, including any triggers, unique indexing constraints, and exemptions from API methods

  • Each column must have a description, including any default values and exemptions from API methods

Label Field

  • Every table must have a meaningful label field

  • In most cases that will not be ID

Data Change Capture Retention Days

  • The default is 120 days

  • It is recommended that data changing on a regular basis be lowered

  • Data in tables with a corresponding history table must adjust this value as well

    • Example: Current Tag Values versus Tag Value History tables

TTL

  • Data retention must be taken into account for each table

  • TTL indexes must be added for data that does not need to be kept for long periods of time

Mutations

  • Disable mutation methods with caution; consider security policies instead

    • It may not be beneficial to prevent everyone from updating a data model

  • Prepare to explain any mutation edits during an internal review

  • If you prevent updates to an entire model, turn off the Data Change Capture option

Column Naming

  • All DateTime fields must end with At

    • Examples: createdAt, recordedAt, updatedAt, measuredAt

  • All ID fields must reference the complete object name plus ID

    • Example: strategyId should be productStrategyId

  • All reference fields need to reference the complete object name

    • Example: strategy should be productStrategy

  • All booleans must be positively named to avoid double negatives

    • Example: active is true instead of inactive being false)

  • Exceptions may exist when multiple links exist, but they must be well named and documented

    • Examples:  primaryProductStrategyId and secondaryProductStrategyId

  • Back references

    • Can be changed if they provide more meaningful context on the relationships

    • Can be removed if they do not make sense or link to too much data 

      • Example: Inventory on a status table

    • Must be renamed to remove duplicate names with parent/child relations

      • Examples: salesOrderSalesOrderLines can become salesOrderLines

Grouping And Ordering

Sort each section to provide additional context to the importance or hierarchy of the data.

  • ID field

  • Required fields 

  • Non-required fields

  • Pairs of required ID fields followed by the object

  • Pairs of non-required id fields followed by the object

  • All back references

    • Related Articles

    • JSON Schema Inputs

      Within Fuuz you can use a JSON Schema to generate a dynamic form that builds JSON data from a users inputs. The JSON schema inputs can be expanded to use components found in the Screen Designer through the inputProps field. For more information about ...
    • GraphQL Mutation Standards

      This article provides an introduction to GraphQL Mutation Standards. Overview Usage Standards Design Pattern Overview When working with GraphQL in the Fuuz environment there are four types of mutations to consider: Create Update Upsert Delete Usage ...
    • Getting Started with Fuuz Scripting

      This article provides an introduction to Fuuz scripting and its relevant training resources. Fuuz Scripting Language Fuuz Scripting Windows Fuuz Scripting Language Fuuz's scripting language is an extension of the JSONata transformation language. Fuuz ...
    • Application Designer (AD)

      The Fuuz Application Designer is a culmination of all the designers which are available in the Fuuz Application. Currently the Application Designer supports Data Models, Data Flows, and Screens. Other designers will available in future. In the ...
    • Data Modeling

      Open the Fuuz app. Select the Fuuz dropdown menu. Select the System option. Select the Data Modeling option. The options include: Data Model Deployment Logs Data Models Schema Designer