Overview
Enterprise Sync is a core component of FreeTAKServer that provides comprehensive data synchronization, file storage, and content management capabilities. It serves as the backbone for storing and retrieving various types of data including data packages, mission content, ExCheck templates, and other synchronized content across the TAK ecosystem.Architecture
Component Structure
Key Classes
EnterpriseSync Facade
Location:FreeTAKServer/core/enterprise_sync/enterprise_sync_facade.py:15
save_enterprise_sync_data()- Save data and metadataget_enterprise_sync_data()- Retrieve data by UID or hashget_multiple_enterprise_sync_data()- Batch retrievalupdate_enterprise_sync_data()- Update existing datadelete_enterprise_sync_data()- Remove dataget_enterprise_sync_metadata()- Get metadata onlyget_all_enterprise_sync_metadata()- List all metadata
EnterpriseSyncGeneralController
Location:FreeTAKServer/core/enterprise_sync/controllers/enterprise_sync_general_controller.py:28
Coordinates operations across database, filesystem, and format synchronization controllers.
Core Functionality
Saving Data
Method:save_enterprise_sync_data()Location:
enterprise_sync_general_controller.py:113
Retrieving Data
Single Object Retrieval
Method:get_enterprise_sync_data()Location:
enterprise_sync_general_controller.py:179
Multiple Object Retrieval
Method:get_multiple_enterprise_sync_data()Location:
enterprise_sync_general_controller.py:190
Metadata Operations
Get Metadata
Method:get_enterprise_sync_metadata()Location:
enterprise_sync_general_controller.py:257
Update Metadata
Method:update_enterprise_sync_metadata()Location:
enterprise_sync_general_controller.py:149
Get All Metadata
Updating Data
Method:update_enterprise_sync_data()Location:
enterprise_sync_general_controller.py:134
Deleting Data
Method:delete_enterprise_sync_data()Location:
enterprise_sync_general_controller.py:287
Data Types (synctype)
Enterprise Sync supports various data types:| Synctype | Description | Used By |
|---|---|---|
content | General data packages | Missions, file sharing |
ExCheckTemplate | ExCheck templates | ExCheck component |
ExCheckChecklist | Active checklists | ExCheck component |
ExCheckChecklistTask | Checklist tasks | ExCheck component |
| Custom types | Application-specific | Various components |
Storage Architecture
Dual Storage Model
Enterprise Sync uses a dual storage approach:-
Filesystem Storage: Actual file data stored on disk
- Organized by synctype
- Accessed via
EnterpriseSyncFilesystemController - Supports both binary and text data
-
Database Metadata: Searchable metadata in database
- Indexed by UID and hash
- Supports keyword search
- Tracks ownership and permissions
Data Object Model
Integration with Components
Mission Component
ExCheck Component
Data Package Service
Enterprise Sync provides the storage backend for the Data Package service, handling file uploads and downloads.Advanced Features
Format Synchronization
TheEnterpriseSyncFormatSynchronizationController handles:
- Newline conversion for cross-platform compatibility
- Format normalization
- Encoding management
Hash-Based Deduplication
Data is identified by SHA256 hash, enabling:- Automatic deduplication
- Content-addressable storage
- Data integrity verification
Privacy Levels
Best Practices
- Always Use Hashes: Let the system auto-generate hashes for integrity
- Meaningful Keywords: Use descriptive keywords for searchability
- Proper MIME Types: Set correct MIME types for content handling
- Batch Operations: Use multiple get/update methods for efficiency
- Cleanup: Delete unused data to conserve storage
Performance Considerations
- Batch Retrieval: Use
get_multiple_enterprise_sync_data()for multiple objects - Metadata Only: Use metadata methods when full data isn’t needed
- Indexing: Keywords and UIDs are indexed for fast lookup
- Caching: Consider caching frequently accessed data