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. For a full list of attributes of data types, see our API Reference on Creating a Data Type.

Each data type is associated with a Concrete Type, which specifies the actual data structure of the type. The options are boolean, composite, date,int,string,timestamp and uuid. 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. For a full list of attributes of fields, see our API Reference on Creating a Data Type.

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.