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.viewpermission - Generate Databases:
databases.startpermission - Cancel Generation:
databases.cancelpermission - Remove Databases:
databases.removepermission - Import Databases:
databases.importpermission - Super Admin Features:
system.super-adminrole (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β
- Data Collection: Gather match data from project repositories
- Database Creation: Generate optimized SQLite database structure
- Data Population: Insert match records with validation and optimization
- Compression: Create compressed ZIP archives for distribution
- 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β
- Device Selection: Choose individual devices or entire groups
- Database Transfer: Stream database files to selected devices
- Progress Tracking: Monitor upload progress per device
- Verification: Confirm successful database installation
- 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β
- Navigate to Database page via main navigation menu
- Review Match Database: Check current project match database name
- Check Record Counts: Review available match records per database type
- Select Database Type: Choose appropriate type for generation needs
- Monitor Generation: Track progress and download completed databases
ποΈ Generating Databasesβ
-
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) -
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 -
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β
-
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 -
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)β
-
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 -
Upload to Individual Devices:
π± Click "Upload" for specific device
π Monitor upload progress percentage
βΈοΈ Use "Cancel" to stop uploads if needed
β Confirm successful installation -
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.