Training Manual — Section 49 · Ultra Technical

Global Data Model & Database Schema

The ultra-technical data backbone — entity models, relationships, schemas, indexing strategy, multi-tenant isolation, audit logging, versioning, and AI-ready data pipelines.

Data model and database schema
01

Data Architecture Overview

Purpose

Create a global, unified, multi-tenant data architecture that supports QC, testing, fabric, production, sustainability, training, certification, community, partnership, AI, and governance.

Data Architecture Layers

Entity layerRelationship layerSchema layerIndexing layerVersioning layerAudit layerMulti-tenant layerAI data pipeline layer
02

Core Entity Model (Master Entities)

Master Entities

  • User
  • Factory
  • Brand
  • Buyer
  • University
  • Lab
  • Tenant
  • Role
  • Permission

Operational Entities

  • QC record
  • Testing record
  • Fabric inspection
  • Production record
  • Sustainability record
  • Training module
  • Assessment
  • Certification
  • Partnership
  • Community post
  • GGKI node
  • SOP
  • Version record

AI Entities

  • AI decision log
  • AI knowledge node
  • AI model version
  • AI inference record
03

Entity Relationship Model (ERM)

User ↔ Tenant

Many-to-One

User ↔ Role

Many-to-Many

Factory ↔ QC records

One-to-Many

Factory ↔ Testing records

One-to-Many

Factory ↔ Production records

One-to-Many

Factory ↔ Sustainability records

One-to-Many

Buyer ↔ Testing rules

One-to-Many

Buyer ↔ QC rules

One-to-Many

GGKI node ↔ SOP

Many-to-Many

GGKI node ↔ AI knowledge node

One-to-One

Assessment ↔ Certification

One-to-One

Community post ↔ User

Many-to-One

Version record ↔ SOP

One-to-Many

Version record ↔ Testing rule

One-to-Many

Version record ↔ QC rule

One-to-Many
04

Database Schema (Top-Level Tables)

users

1/17
  • id (PK)
  • tenant_id (FK)
  • name
  • email
  • password_hash
  • role_id
  • status
  • created_at
  • updated_at

tenants

2/17
  • id (PK)
  • name
  • type (factory, brand, buyer, university, lab, NGO)
  • region
  • status
  • created_at
  • updated_at

roles

3/17
  • id (PK)
  • name
  • description

permissions

4/17
  • id (PK)
  • name
  • description

qc_records

5/17
  • id (PK)
  • factory_id (FK)
  • style_id
  • date
  • inspector_id
  • defect_type
  • defect_severity
  • measurement_deviation
  • aql_result
  • corrective_action
  • preventive_action
  • version_id
  • created_at
  • updated_at

testing_records

6/17
  • id (PK)
  • factory_id (FK)
  • test_type
  • test_method
  • test_result
  • buyer_requirement
  • compliance_status
  • version_id
  • created_at
  • updated_at

fabric_inspections

7/17
  • id (PK)
  • factory_id (FK)
  • roll_number
  • defect_points
  • gsm
  • shrinkage
  • color_consistency
  • acceptance_status
  • created_at
  • updated_at

production_records

8/17
  • id (PK)
  • factory_id (FK)
  • line_id
  • date
  • output
  • smv
  • efficiency
  • bottlenecks
  • created_at
  • updated_at

sustainability_records

9/17
  • id (PK)
  • factory_id (FK)
  • water_usage
  • energy_usage
  • waste_generated
  • chemical_compliance
  • carbon_emission
  • created_at
  • updated_at

training_modules

10/17
  • id (PK)
  • title
  • category
  • difficulty
  • content
  • created_at
  • updated_at

assessments

11/17
  • id (PK)
  • user_id (FK)
  • module_id (FK)
  • mcq_score
  • practical_score
  • case_score
  • viva_score
  • project_score
  • total_score
  • created_at
  • updated_at

certifications

12/17
  • id (PK)
  • user_id (FK)
  • certification_type
  • level
  • score
  • issued_at
  • expiry_at

partnerships

13/17
  • id (PK)
  • partner_type
  • partner_name
  • status
  • roadmap
  • created_at
  • updated_at

community_posts

14/17
  • id (PK)
  • user_id (FK)
  • category
  • content
  • upvotes
  • status
  • created_at
  • updated_at

ggki_nodes

15/17
  • id (PK)
  • category
  • title
  • description
  • relationships (JSON)
  • version_id
  • created_at
  • updated_at

sop_versions

16/17
  • id (PK)
  • sop_id (FK)
  • version_number
  • change_log
  • approved_by
  • released_at

ai_decision_logs

17/17
  • id (PK)
  • user_id (FK)
  • input_text
  • output_text
  • model_version
  • ggki_nodes_used (JSON)
  • created_at
05

Indexing Strategy

High-Priority Indexes

users.email
qc_records.factory_id
testing_records.factory_id
fabric_inspections.factory_id
production_records.factory_id
sustainability_records.factory_id
ggki_nodes.category
sop_versions.sop_id

Indexing Goals

  • Fast queries
  • Low latency
  • High scalability
06

Multi-Tenant Data Isolation

Isolation Methods

  • Tenant ID column
  • Row-level security
  • Tenant-specific encryption keys
  • Tenant-specific storage buckets

Tenant Types

Factory tenantBrand tenantBuyer tenantUniversity tenantLab tenantNGO tenant
07

Audit Logging Model

Audit Logs Include

user_id
action
entity
entity_id
old_value
new_value
timestamp

Audit Goals

  • Full traceability
  • Compliance
  • Security
08

AI Data Pipeline Model

Pipeline Stages

  1. 1Input parsing
  2. 2Category classification
  3. 3GGKI retrieval
  4. 4Decision logic
  5. 5AI inference
  6. 6Logging
  7. 7Monitoring
  8. 8Retraining

AI Data Stored

  • Inputs
  • Outputs
  • GGKI nodes
  • Model version
  • Confidence score
09

Data Governance Rules

No orphan data
No unversioned data
No unapproved data
No unencrypted data
No cross-tenant data leakage
10

Data Architecture Roadmap (2026–2036)

1

Phase 1

Master data model

2

Phase 2

Multi-tenant schema

3

Phase 3

AI data pipeline

4

Phase 4

Predictive data engine

5

Phase 5

Autonomous data governance system

Clean data, AI-ready, globally consistent

The data model connects to the enterprise architecture, GGKI governance, and knowledge versioning engine.

Written by Sanjeewa Dehiwalagewww.nosk.lifeAll rights reserved.

nosk.life

A modern learning management system built for the NOSK training ecosystem — tracks, modules, exams, and verified certificates in one place.

Company

  • Contact
  • Privacy Policy
  • Terms of Service
  • About NOSK Life

© 2026 NOSK Life. All rights reserved.