Data types

In UserClouds, data types play a crucial role in defining how data is structured, stored, and manipulated within the system. This documentation provides an overview of data types, their significance, and how they interact with columns and transformers, ensuring efficient data management and integrity. Examples of data types include Boolean, String, Int, Address, SSN and E.164 phone number.

The Role of Data Types

Data types define the nature of data that can be stored in a column, influencing how data is processed, validated, and interacted with. They are fundamental to ensuring that data adheres to expected formats and behaviors, which is critical for maintaining data integrity, enabling efficient data operations, and supporting complex data transformations.

Why Data Types Matter

  • Data Validation: Data types help in validating the data being stored or processed, ensuring it matches the expected format.
  • Interpretation: Data types dictate how information is interpreted by the database system, differentiating, for example, between numeric values and textual data. This distinction is essential for accurately performing operations like sorting, filtering, and calculations, ensuring that data behaves as expected within the application.
  • Functionality and Operations: Certain operations are only applicable to specific data types, such as text manipulation functions for strings or arithmetic operations for numeric types.
  • Performance Optimization: By knowing the type of data stored, the database can optimize storage and retrieval operations, making data access more efficient.
  • Constraint Application: Certain constraints can only be applied to columns with specific data types, affecting data uniqueness, mutability, and integrity.
  • Transformation Compatibility: Data types determine compatibility with transformers, guiding how data can be transformed during input or output operations.

Data Type Definitions

Each column and transformer within UserClouds is associated with a data type. These data types come with specific attributes that define their behavior and interaction within the system.

Attributes of Data Types

Attributes of Data Types

  • Name: A free text identifier for the data type.
  • Description: A free text description of the data type’s purpose or usage.
  • Concrete Type: Specifies the actual data structure of the type, options include:
    • boolean: A true or false value.
    • composite: A complex structure containing one or more fields.
    • date: Represents a calendar date.
    • int: An integer value.
    • string: A sequence of characters.
    • timestamp: A specific point in time.
    • uuid: A universally unique identifier.
  • Associate with a Unique ID?: A boolean attribute indicating whether the data type should be associated with a unique identifier. Only available for composite data types.

Composite Data Types

Composite data types are complex types that consist of one or more fields, each with its own data type and set of attributes. Composite types allow for the creation of structured, multi-attribute data types, enabling the storage and management of complex data sets within a single column.

Attributes of Fields on Composite Data Types

  • Field Name: Identifier for the field.
  • Field Data Type: Specifies the type of data the field holds.
  • Ignore for Uniqueness?: Determines if the field should be ignored when evaluating the uniqueness of a composite type.
  • Required?: Indicates whether a value for the field is mandatory.

Customization and Mutability

UserClouds supports both provisioned (default) and custom data types. While provisioned data types offer a standard set of structures for common data needs, custom data types provide flexibility to define unique data structures tailored to specific requirements.

The mutability of these types is as follows:

  • Custom data types, which must be composite, can be edited post-creation as long as they are not currently being used by any column or transformer.
  • Provisioned data types provided by UserClouds cannot be edited. This ensures system stability and integrity.

Summary

Data types in UserClouds serve as the backbone for data structure and integrity, ensuring that data is stored, processed, and transformed in ways that meet the application's requirements. By leveraging both provisioned and custom data types, users can tailor their data management strategies to their specific needs, maintaining flexibility while ensuring data compatibility and integrity.