Google Sign-In Required

Use your company Google account to access the BetterFleet private content.

Back to private home

BetterFleet Support Private
Skip to content
BetterFleet Dev Wiki
0017 - Instantiated Models
Initializing search
    bf-dev
    • Home
    • Product Capabilities
    • Process
    • Current Work
    • System Design
    • Software Reference
    • Operations
    bf-dev
    • Home
      • Overview
      • Manage
      • Overview
      • Product Engineering Workflow
      • Product Engineering Delivery
      • Product Engineering Workflow in Linear
        • GitLab Feature Flags
        • In-App Docs Authoring
        • Release Notes
      • Templates
      • Publishing
      • Workflow Companions
      • Overview
      • Active Artifacts
      • Backlog Artifacts
      • Archived Artifacts
      • Overview
      • Microgrid
      • OSCP
        • Challenge
        • Specification
        • Spec
        • Architecture
        • Overview
        • Script Runtime Model
        • Compose Profiles and Modes
        • Repo Topology
        • CI and Release Integration
        • Overview
        • Internal Application Diagrams
          • Overview
          • Web Model
          • Core Model
        • Service Interaction Flows
        • Data and State
          • Index
          • bf-manage-web
          • bf-manage-core
          • bf-manage-connect
          • bf-manage-sitepwrmon
          • bf-manage-incidents
          • bf-telematics
          • bf-depot-sim
          • bf-manage-roaming
          • bf-support-microsite
          • bf-digital-twin
          • bf-schedule-creator
        • Overview
        • Internal Application Diagrams
        • Migration and Flags
        • Simulation Request Lifecycle
          • Index
          • bf-bnl-ui
          • bf-bnl-settings
          • bf-bnl-schedule-analysis-compute
          • bf-route-modelling
          • bf-schedule-creator
          • bf-digital-twin
        • Overview
        • Secrets and Env Strategy
        • Vendors and Local Dependencies
        • ADRs
        • Service Matrix
        • Cloud Dependencies
        • Ports and URLs
      • Onboarding
      • Daily Operations Runbook
        • Overview
        • Staging Hotfix Release
        • Production Hotfix Release
        • Terraform Plan Dry Runs
      • Troubleshooting
      • Testing Guide
    • Date
    • Status
    • Context and Scope
    • Decision Drivers
    • Decision
    • Consequences

    0017 - Instantiated Models¶

    Date¶

    2024-02-07

    Status¶

    Proposed

    Context and Scope¶

    This architectural decision record revises our strategy for managing instanced versions of models within our SaaS product, particularly focusing on vehicle models. This revision proposes using instanced clones of the vehicle_model table for customizations. This approach aims to enhance data integrity, scalability, and ease of management.

    Decision Drivers¶

    • Data Integrity: Ensuring that customizations do not compromise the original model's data.
    • Scalability: Facilitating growth in the number of model instances and their customizations.
    • Simplicity: Streamlining the process for managing and querying model data.
    • Performance: Maintaining high performance levels even with an increase in data volume due to clones.

    Decision¶

    1. Model Template Management
      • Creation and Reading: Users can create and read class models (vehicle_model), with initial restrictions on update and delete actions. This provides a stable template for creating instanced clones.
    2. Instanced Clone Management
      • Creation of Instanced Clones: When customization at the individual vehicle level is required, an instanced clone of the vehicle_model table will be created. This clone represents a separate instance that can be modified without affecting the original template.
      • Customization: Customizations are applied directly to the clone, allowing for greater flexibility and specificity in modifications without impacting the base model.
    3. Data Retrieval and Dependency Management
      • Combined Retrieval Strategy: Access to vehicle details will involve selecting the relevant vehicle instance alongside its clone (if applicable), to present a unified view of the vehicle's configuration.
      • Dependency Handling: Relationships and dependencies should be managed carefully so that cloning preserves necessary links while allowing divergence where needed.
    4. No Direct Mutation of Shared Template
      • Direct customization on the shared base model for per-instance use cases will be avoided.

    Consequences¶

    • Better isolation between template and customized instance data.
    • More flexibility for per-vehicle variations.
    • Additional complexity in retrieval logic and lifecycle management for clones.
    Made with Material for MkDocs