Skip to main content

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
Public Methods:
  • save_enterprise_sync_data() - Save data and metadata
  • get_enterprise_sync_data() - Retrieve data by UID or hash
  • get_multiple_enterprise_sync_data() - Batch retrieval
  • update_enterprise_sync_data() - Update existing data
  • delete_enterprise_sync_data() - Remove data
  • get_enterprise_sync_metadata() - Get metadata only
  • get_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
Usage Example:

Retrieving Data

Single Object Retrieval

Method: get_enterprise_sync_data()
Location: enterprise_sync_general_controller.py:179
Usage Example:

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:

Storage Architecture

Dual Storage Model

Enterprise Sync uses a dual storage approach:
  1. Filesystem Storage: Actual file data stored on disk
    • Organized by synctype
    • Accessed via EnterpriseSyncFilesystemController
    • Supports both binary and text data
  2. 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

The EnterpriseSyncFormatSynchronizationController 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

  1. Always Use Hashes: Let the system auto-generate hashes for integrity
  2. Meaningful Keywords: Use descriptive keywords for searchability
  3. Proper MIME Types: Set correct MIME types for content handling
  4. Batch Operations: Use multiple get/update methods for efficiency
  5. 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

Error Handling

  • Mission - Uses Enterprise Sync for mission content
  • ExCheck - Stores templates and checklists
  • Data Package Service - Backend for file operations