Skip to main content
Ctrl+K
CCAT Data Center Logo CCAT Data Center Logo

CCAT Data Center

  • Overview & Introduction
  • Scientists Guide
  • Instrument Integration Guide
  • Data Center Operations
  • Component Developer Documentation
    • Observatory Systems
  • Overview & Introduction
  • Scientists Guide
  • Instrument Integration Guide
  • Data Center Operations
  • Component Developer Documentation
  • Observatory Systems

Section Navigation

  • Operations Database (ops-db)
    • Overview
    • Configuration
    • Observatory Hierarchy
    • Observation Model
    • Data Model
    • Location Model
    • Transfer Model
    • Database Layout
    • Table Reference
    • Core Database Functions
    • Models API Reference
    • Utilities
    • Related Components
  • Data Transfer System
    • Philosophy & Design Principles
    • The Transfer Route from CCAT to Cologne
    • Core Concepts
    • Pipeline Architecture
    • Routing & Queue Discovery
    • Monitoring & Failure Recovery
    • Data Lifecycle Management
    • API Reference
      • Managers
        • Raw Data Package Manager
        • Data Transfer Package Manager
        • Transfer Manager
        • Archive Manager
        • Deletion Manager
        • Staging Manager
      • Services
        • Data Integrity Manager
        • Buffer Manager
        • Disk Monitor
        • Health Check
        • Task Monitor Service
        • Task State Manager
        • Recovery Service Runner
      • Core Utilities
        • Database
        • Configuration
        • Exceptions
        • Utilities
        • Decorators
        • Logging Utils
        • Metrics
        • Notification Service
        • Operation Types
        • Queue Discovery
        • Settings Manager
      • Celery Tasks
        • Setup Celery App
  • Operations Database API (ops-db-api)
    • Quick Start Guide
      • Installation
      • Making Your First API Call
      • Running Locally with Docker Compose
    • Design Philosophy
      • Design Rationale
      • Distributed Architecture
      • Reliability First
    • Architecture Overview
      • System Overview
      • Database Topology
      • Site Configuration
      • Authentication System
      • Endpoint Categories
    • Deep Dive
      • Transaction Buffering
        • Transaction Buffering Overview
        • Transaction Builder
        • Transaction Manager
        • Background Processor
        • LSN Tracking
        • Smart Query Manager
        • Read Buffer Manager
      • Authentication Deep Dive
        • Unified Authentication
        • GitHub OAuth
        • API Tokens
        • Roles and Permissions
      • Routers Deep Dive
        • UI-Focused Routers
        • Operations-Focused Routers
        • Shared Routers
      • Data Flow Examples
      • Caching Strategy
    • Tutorials
      • Simple Endpoints
        • Simple Read Endpoint
        • Simple Write Endpoint
        • Adding Authentication
      • Complex Endpoints
        • Multi-Table Transactions
        • Buffered Critical Operations
        • Smart Queries with Buffering
        • WebSocket Updates
      • Observatory Integration
        • Recording Observations
        • Registering Data Files
        • Service Scripts Best Practices
        • Scheduler Interface
      • UI Integration
        • Dashboard Endpoints
        • Visibility Calculations
        • Transfer Monitoring
    • API Reference
      • Endpoints Reference
      • Schemas Reference
      • Database Models
    • Development Guide
      • Testing
      • Debugging Transaction Buffering
      • Redis Inspection
      • Contributing
  • Operations Database UI (ops-db-ui)
  • CCAT System Integration Documentation
    • Getting Started
    • Configuration
    • Deployment
    • Monitoring
    • Backup and Restore
  • Data Center Configuration

Related Components#

✓
Documentation Verified Last checked: 2025-01-21 Reviewer: Christof Buchbender

ops-db is the database schema and ORM layer that serves as the foundation for several other CCAT components. This page provides links to related documentation.

Related Components#

ops-db-api#

The ops-db-api provides a RESTful API for programmatic access to the operations database. Instrument teams and automated systems use this API to:

  • Register observations and data files

  • Query observation status

  • Update data package states

  • Manage long-term archive transfers

Documentation: Operations Database API (ops-db-api)

ops-db-ui#

The ops-db-ui is a Vue.js web interface for browsing and managing operations database records. It provides:

  • Web-based browsing of observations and data packages

  • Visualization of data flow and transfer status

  • User-friendly access to database records

  • Monitoring dashboards for system health

Documentation: Operations Database UI (ops-db-ui)

data-transfer#

The data-transfer package orchestrates the actual movement of data files based on records in ops-db. It:

  • Reads transfer routes and schedules from ops-db

  • Performs file transfers using BBCP, S3, or other methods

  • Updates transfer status and physical copy records

  • Manages long-term archive and staging operations

Documentation: Data Transfer System

Key Integration Points:

  • data-transfer reads DataTransferRoute, DataTransferPackage, and LongTermArchiveTransfer records

  • data-transfer updates Status, PhysicalCopy, and DataTransferLog records

  • For detailed data flow documentation, see the data-transfer documentation

system-integration#

The system-integration repository contains deployment configurations for ops-db and related components:

  • Docker Compose configurations

  • Kubernetes manifests

  • Ansible playbooks

  • CI/CD pipelines

Documentation: CCAT System Integration Documentation

Note: For database deployment and infrastructure setup, see system-integration documentation. This documentation (ops-db) covers only the database schema and Python API.

Using ops-db Programmatically#

If you’re building a new component that needs to interact with ops-db:

Direct Python Access (recommended for Python applications)#

Install ops-db as a Python package:

pip install -e /path/to/ops-db

Then use the ORM directly:

from ccat_ops_db import init_ccat_ops_db
from ccat_ops_db.models import ObsUnit, ExecutedObsUnit

session, engine = init_ccat_ops_db()
obs_unit = session.query(ObsUnit).filter_by(name="my_obs").first()

See Core Database Functions for connection details and Models API Reference for model reference.

RESTful API Access (recommended for non-Python applications)#

Use the ops-db-api for language-agnostic access:

GET /api/v1/obs_units
GET /api/v1/executed_obs_units/{id}
POST /api/v1/raw_data_packages

See the ops-db-api documentation for endpoint details.

Direct SQL Access (not recommended)#

You can connect directly to PostgreSQL, but you’ll miss the benefits of:

  • SQLAlchemy ORM (relationships, validation)

  • Type checking (enums, polymorphic models)

  • Business logic in model methods

If you must use direct SQL, refer to Database Layout for schema details.

Related Documentation#

  • Core functions: Core Database Functions

  • Models API: Models API Reference

  • Database concepts: Overview

previous

Utilities

next

Data Transfer System

On this page
  • Related Components
    • ops-db-api
    • ops-db-ui
    • data-transfer
    • system-integration
  • Using ops-db Programmatically
    • Direct Python Access (recommended for Python applications)
    • RESTful API Access (recommended for non-Python applications)
    • Direct SQL Access (not recommended)
  • Related Documentation

This Page

  • Show Source

© Copyright 2024, Christof Buchbender.

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.