Skip to main content

Database

🎯 Overview​

The Database Page serves as the central management hub for generating, distributing, and maintaining SQLite databases used by mobile scanning devices. This specialized interface provides comprehensive database lifecycle management, from initial generation through device deployment and updates. The system automatically creates compact, optimized databases containing match data, product information, and configuration settings tailored for offline scanning operations.

The Database Module operates with integrated components for complete database management:

  • πŸ“Š Database Generation: Automated SQLite database creation from project match data
  • πŸ“± Device Distribution: Streamlined database deployment to scanning devices and device groups
  • πŸ”„ Version Management: Job tracking, progress monitoring, and database lifecycle control

πŸ” Access Requirements​

πŸ‘₯ Required Roles & Permissions​

  • View Databases: databases.view permission
  • Generate Databases: databases.start permission
  • Cancel Generation: databases.cancel permission
  • Remove Databases: databases.remove permission
  • Import Databases: databases.import permission
  • Super Admin Features: system.super-admin role (for Android-specific generation)

🌐 Permission Scope​

  • Project-Based: Database operations limited to user's assigned projects
  • Role-Based Features: Advanced features available based on role level
  • System-Level Access: Import operations require system-level permissions

πŸ’» Database Page Interface Layout​

πŸŽ›οΈ Main Database Overview​

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Database Generation β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Match-database: PROJECT_ABC_2024 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Product Data (P) β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Article Match records: 15,423 β”‚ β”‚
β”‚ β”‚ [Generate] [Generate Android] (Super Admin only) β”‚ β”‚
β”‚ β”‚ β”‚ β”‚
β”‚ β”‚ Generation History: β”‚ β”‚
β”‚ β”‚ β”œβ”€β”€ [βœ“] Completed (Nov 3, 14:30) β”‚ β”‚
β”‚ β”‚ β”‚ [Download 1] [Remove] β”‚ β”‚
β”‚ β”‚ β”œβ”€β”€ [↻] Running (75%) β”‚ β”‚
β”‚ β”‚ β”‚ Progress: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’ [Cancel] β”‚ β”‚
β”‚ β”‚ └── [βœ—] Failed (Nov 2, 16:45) β”‚ β”‚
β”‚ β”‚ Reason: Database timeout error [Remove] β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Store Data (S) β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Article Match records: 8,921 β”‚ β”‚
β”‚ β”‚ [Generate] [Generate Android] β”‚ β”‚
β”‚ β”‚ β”‚ β”‚
β”‚ β”‚ Generation History: β”‚ β”‚
β”‚ β”‚ β”œβ”€β”€ [βœ“] Completed (Nov 3, 13:15) β”‚ β”‚
β”‚ β”‚ β”‚ [Download 1] [Remove] β”‚ β”‚
β”‚ β”‚ └── [βœ“] Completed (Nov 2, 11:30) β”‚ β”‚
β”‚ β”‚ [Download 1] [Remove] β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“± Device Distribution Interface (Super Admin)​

Upload Database to Devices
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Device Groups β”‚ Devices in Warehouse A β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ β–Ί Warehouse A β”‚ β”‚ β”‚ Device-001 (DEV001) β”‚ β”‚
β”‚ β”‚ [Upload All] [Cancel] β”‚ β”‚ β”‚ Progress: 45% [Upload] [Cancel]β”‚ β”‚
β”‚ β”‚ β–Ί Warehouse B β”‚ β”‚ β”‚ Device-002 (DEV002) β”‚ β”‚
β”‚ β”‚ [Upload All] [Cancel] β”‚ β”‚ β”‚ Status: Ready [Upload] β”‚ β”‚
β”‚ β”‚ β–Ί Mobile Units β”‚ β”‚ β”‚ Device-003 (DEV003) β”‚ β”‚
β”‚ β”‚ [Upload All] [Cancel] β”‚ β”‚ β”‚ Uploading: 78% β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ—„οΈ Database Generation Component​

The Database Generation section provides automated creation of SQLite databases optimized for mobile scanning devices.

⭐ Database Generation Features​

  • Multi-Type Support: Generate databases for different match types (Product, Store, Custom)
  • Automatic Optimization: SQLite databases optimized for mobile device performance
  • Version Control: Multiple scanner versions with Android-specific optimization
  • Record Counting: Real-time match record count display for generation planning

πŸ“Š Database Types and Categories​

  • πŸ“¦ Product Data (P): Primary product match database with full product catalog
  • πŸͺ Store Data (S): Store-specific match data with location-based information
  • 🏷️ Custom Types: Project-configured custom match types based on ScanFlowConfig
  • πŸ”— Zone Linking: Specialized databases for zone-to-zone linking operations

πŸ”„ Generation Process Workflow​

  1. Data Collection: Gather match data from project repositories
  2. Database Creation: Generate optimized SQLite database structure
  3. Data Population: Insert match records with validation and optimization
  4. Compression: Create compressed ZIP archives for distribution
  5. Verification: Validate database integrity and sample match codes

πŸ“± Device Distribution Component (Super Admin)​

The Device Distribution section enables efficient deployment of databases to scanning devices across the organization.

⭐ Device Distribution Features​

  • Group Management: Organize devices into logical groups for batch operations
  • Individual Control: Upload to specific devices with progress tracking
  • Batch Operations: Upload to entire device groups simultaneously
  • Progress Monitoring: Real-time upload progress with percentage completion

πŸ“‹ Device Group Organization​

  • Warehouse Groups: Devices organized by physical warehouse locations
  • Mobile Units: Portable scanning devices and mobile teams
  • Department Groups: Devices grouped by operational departments
  • Custom Groups: Project-specific device groupings

πŸ”„ Distribution Process​

  1. Device Selection: Choose individual devices or entire groups
  2. Database Transfer: Stream database files to selected devices
  3. Progress Tracking: Monitor upload progress per device
  4. Verification: Confirm successful database installation
  5. Activation: Enable new database on target devices

⭐ Core Database System Features​

🎯 Automated Database Generation​

  • Background Processing: Non-blocking database generation with job queue management
  • Progress Monitoring: Real-time progress updates with percentage completion
  • Error Handling: Comprehensive error reporting with detailed failure messages
  • Resource Optimization: Efficient memory and CPU usage during generation

πŸ“ Database File Management​

  • Version Tracking: Maintain multiple database versions with timestamps
  • Download Access: Direct download links for generated database files
  • Automatic Cleanup: Scheduled removal of old database files
  • Compression Support: ZIP compression for efficient distribution

πŸ” Quality Assurance​

  • Data Validation: Pre-generation validation of match data integrity
  • Sample Verification: Generate sample match codes for validation
  • Record Counting: Accurate match record counts for planning
  • Integrity Checks: Post-generation database integrity verification

πŸ“˜ Database Page Usage Guide​

πŸš€ Getting Started with Database Generation​

  1. Navigate to Database page via main navigation menu
  2. Review Match Database: Check current project match database name
  3. Check Record Counts: Review available match records per database type
  4. Select Database Type: Choose appropriate type for generation needs
  5. Monitor Generation: Track progress and download completed databases

πŸ—„οΈ Generating Databases​

  1. Standard Generation:

    πŸ“Š Review match record count for database type
    πŸ”„ Click "Generate" button for standard SQLite generation
    πŸ“ˆ Monitor progress with real-time percentage updates
    ⏳ Wait for completion (typically 2-10 minutes depending on data size)
  2. Android-Optimized Generation (Super Admin):

    πŸ€– Click "Generate Android" for Android-optimized databases
    ⚑ Enhanced optimization for Android scanning devices
    πŸ“± Improved performance on mobile hardware
    πŸ“Š Same monitoring process as standard generation
  3. Monitor Generation Progress:

    πŸ”„ Real-time progress bar with percentage completion
    πŸ“Š Background job processing without blocking interface
    ⚠️ Error handling with detailed failure messages
    βœ… Automatic notification upon completion

πŸ“₯ Managing Generated Databases​

  1. Download Databases:

    βœ… Wait for "Completed" status in generation history
    πŸ“₯ Click "Download" button to get compressed database file
    πŸ’Ύ Save database file for distribution or backup
    πŸ” Verify file integrity before deployment
  2. Job Management:

    🚫 Cancel: Stop running generation jobs
    πŸ—‘οΈ Remove: Delete completed/failed jobs and associated files
    πŸ“‹ History: Review generation history and timestamps
    ⚠️ Error Review: Check failure details for troubleshooting

πŸ“± Device Distribution (Super Admin Only)​

  1. Select Target Devices:

    πŸ“‹ Choose device group from left panel
    πŸ“± Review devices in selected group
    πŸ” Check upload status and progress for each device
    βœ… Verify devices are available for upload
  2. Upload to Individual Devices:

    πŸ“± Click "Upload" for specific device
    πŸ“Š Monitor upload progress percentage
    ⏸️ Use "Cancel" to stop uploads if needed
    βœ… Confirm successful installation
  3. Batch Upload to Groups:

    πŸ“‹ Select device group
    πŸ”„ Click "Upload All" for group-wide deployment
    πŸ“Š Monitor progress across all devices in group
    🚫 Use "Cancel All" to stop group upload if needed

πŸ“Š Understanding Database Status Indicators​

  • πŸ“Š Record Count: Number of match records available for database generation
  • πŸ”„ Running: Database generation in progress with percentage complete
  • βœ… Completed: Generation finished successfully, ready for download
  • ❌ Failed: Generation encountered errors and stopped
  • 🚫 Cancelled: Generation was manually stopped by user
  • πŸ“₯ Download Available: Compressed database file ready for download
  • πŸ“± Upload Progress: Device upload progress percentage
  • βœ… Upload Complete: Database successfully installed on device

⚠️ Database Page Troubleshooting​

🚫 Common Database Generation Issues​

❌ "Invalid database name" Error

  • βœ… Project Configuration: Verify project has valid database name configuration
  • βœ… Database Settings: Check project database settings in configuration
  • βœ… Name Format: Ensure database name follows required naming conventions
  • βœ… Admin Contact: Request database name setup from administrator

❌ "Database generation failed" Status

  • βœ… Data Integrity: Verify match data is complete and valid
  • βœ… Resource Availability: Check server resources (memory, disk space)
  • βœ… Record Count: Ensure sufficient match records exist for generation
  • βœ… Error Logs: Review detailed error messages in job failure details

❌ "No match records" Warning

  • βœ… Data Import: Ensure match data has been imported into project
  • βœ… Type Configuration: Verify match type is properly configured
  • βœ… Data Validation: Check that imported data passed validation
  • βœ… ScanFlow Setup: Confirm ScanFlowConfig includes required match types

❌ "Generation already running" Message

  • βœ… Wait for Completion: Only one generation per type allowed at once
  • βœ… Cancel Existing: Cancel running job if needed to start new generation
  • βœ… Check Progress: Monitor existing job progress before starting new one
  • βœ… Job Queue: Wait for current job to complete before queuing new one

πŸ“± Device Distribution Issues (Super Admin)​

❌ "Upload failed" Error

  • βœ… Device Connectivity: Verify target device is online and accessible
  • βœ… Database Availability: Ensure generated database file exists
  • βœ… Network Connection: Check network connectivity to devices
  • βœ… Device Storage: Confirm sufficient storage space on target device

❌ "Device not responding" Status

  • βœ… Device Status: Check if device is powered on and connected
  • βœ… Network Issues: Verify network connectivity between server and device
  • βœ… Device Software: Ensure device has compatible scanning software
  • βœ… Retry Upload: Attempt upload again after connectivity is restored

πŸ”„ Database Performance Optimization​

  • Generate During Off-Peak: Schedule generation during low system usage
  • Monitor Record Counts: Large databases may require more time for generation
  • Regular Cleanup: Remove old database files to maintain performance
  • Batch Device Updates: Update device groups during maintenance windows

πŸ› οΈ Database System Technical Details​

πŸ—οΈ Database Architecture​

// Database System Structure
{
databaseGeneration: {
matchDatabase: "PROJECT_ABC_2024",
supportedTypes: ["P", "S", "CustomTypes"],
scannerVersions: ["standard", "android"],
optimization: "sqlite_mobile"
},
jobProcessing: {
backgroundJobs: true,
progressTracking: "realtime",
errorHandling: "comprehensive",
resourceManagement: "optimized"
},
deviceDistribution: {
groupManagement: true,
batchOperations: true,
progressMonitoring: "individual",
transferProtocol: "chunked_upload"
}
}

πŸ—„οΈ Database File Structure​

// Generated Database File
{
filename: "PROJECT_ABC_2024_P_1.zip",
format: "SQLite compressed in ZIP",
content: {
database: "match_database.sqlite",
metadata: {
recordCount: 15423,
generatedAt: new Date(),
databaseType: "P",
scannerVersion: "android",
sampleMatchCode: "ABC123"
}
},
optimization: {
compression: "ZIP deflate",
indexing: "optimized_mobile",
caching: "device_friendly"
}
}

πŸ”„ Database Job Structure​

// Database Generation Job
{
_id: "job123",
type: "generateSqlite",
status: "running", // waiting, running, completed, failed, cancelled
progress: {
percent: 75,
processed: 11567,
total: 15423
},
data: {
databaseName: "PROJECT_ABC_2024",
databaseType: "P",
scannerVersion: "android",
userId: "user789"
},
created: new Date(),
failures: [
{
value: "Memory allocation error during SQLite creation",
timestamp: new Date()
}
]
}

πŸ“± Device Message Structure​

// Device Upload Message
{
deviceId: "device123",
command: "DatabaseTransferMessage",
payload: {
ChunkSize: 102400,
DatabaseName: "PROJECT_ABC_2024_",
MatchType: "P",
RecordCount: 15423,
DownloadLocationURL: "https://server.com/database.zip",
Batches: [
{
BatchNumber: 1,
RecordCount: 15423,
FileSize: 2048576,
BatchAction: 0
}
],
VerifyMatchCode: "ABC123"
},
progress: 0, // 0-100
closedAt: null
}

πŸ” Database Security Features​

  • Access Control: Role-based access to generation and distribution features
  • Project Isolation: Databases contain only project-specific data
  • Integrity Validation: Complete validation of generated database files
  • Secure Transfer: Encrypted transfer of databases to devices
  • Audit Trail: Complete logging of all database operations

πŸ“ˆ Database Performance Optimizations​

  • SQLite Optimization: Mobile-optimized database schema and indexing
  • Chunked Processing: Large datasets processed in memory-efficient chunks
  • Background Generation: Non-blocking generation using job queue system
  • Compression: ZIP compression reduces transfer time and storage requirements
  • Caching Strategy: Intelligent caching of frequently accessed match data

πŸ”„ Integration Points​

  • Match Data: Direct integration with project match repositories
  • ScanFlow Config: Database types derived from scanning configuration
  • Device Management: Integration with device and device group systems
  • File Storage: GridFS or external storage for database file management
  • Job Processing: Background job system for generation and distribution

πŸ“Š Database Generation Optimization​

// SQLite Generation Process
const generateDatabase = async (databaseType, matchData, options) => {
const optimizations = {
android: {
pageSize: 4096,
cacheSize: 2000,
synchronous: 'NORMAL',
journalMode: 'WAL'
},
standard: {
pageSize: 1024,
cacheSize: 1000,
synchronous: 'FULL',
journalMode: 'DELETE'
}
};

const config = optimizations[options.scannerVersion] || optimizations.standard;

return {
database: await createOptimizedSQLite(matchData, config),
verification: await validateDatabase(database),
compression: await compressDatabase(database)
};
};

This documentation covers the comprehensive Database system with generation, distribution, and management capabilities. The system provides automated SQLite database creation optimized for mobile scanning devices with efficient distribution to device fleets. For advanced database configuration, custom optimization settings, or troubleshooting complex generation issues, consult with your system administrator.