๐Ÿ“Š Data Engineering

Airbyte

Airbyte

An open-source data integration platform. A wide range of source connectors.

Detailed Explanation

Airbyte is an open-source ELT (Extract, Load, Transform) platform that extracts data from various sources and loads it into a data warehouse or data lake. It provides more than 300 pre-built connectors, and also offers the CDK (Connector Development Kit), which makes it easy to develop custom connectors.

Unlike traditional ETL tools, Airbyte follows the ELT paradigm, in which data transformation is performed at the destination. This allows raw data to be stored as is and transformed as needed with tools such as dbt, making it possible to build more flexible data pipelines.

Airbyte's core strength is its community-based connector ecosystem. Connectors exist for almost every data source, including REST APIs, databases, and SaaS applications, and new connectors are being actively added. It also supports enterprise-grade features such as incremental sync and schema change detection.

Deployment options include self-hosting (Docker, Kubernetes) and a managed cloud service. Even when self-hosted, a UI is provided so that non-developers can easily set up and monitor data pipelines, and automation through the API and the Terraform provider is also supported.

Code Example

YAML Click to copy
# Airbyte ์ปค๋„ฅํ„ฐ ์„ค์ • ์˜ˆ์ œ (connection.yaml)
# PostgreSQL์—์„œ BigQuery๋กœ ๋ฐ์ดํ„ฐ ๋™๊ธฐํ™”

version: "0.1.0"

# ์†Œ์Šค ์ปค๋„ฅํ„ฐ ์„ค์ • (PostgreSQL)
source:
  sourceType: postgres
  name: production-postgres
  config:
    host: db.example.com
    port: 5432
    database: analytics
    username: ${POSTGRES_USER}
    password: ${POSTGRES_PASSWORD}
    schemas:
      - public
      - sales
    replication_method:
      method: CDC
      replication_slot: airbyte_slot
      publication: airbyte_publication

# ๋ชฉ์ ์ง€ ์ปค๋„ฅํ„ฐ ์„ค์ • (BigQuery)
destination:
  destinationType: bigquery
  name: analytics-warehouse
  config:
    project_id: my-gcp-project
    dataset_id: raw_data
    dataset_location: asia-northeast3
    credentials_json: ${BIGQUERY_CREDENTIALS}
    loading_method:
      method: GCS Staging
      gcs_bucket_name: airbyte-staging
      gcs_bucket_path: /staging

# ๋™๊ธฐํ™” ์„ค์ •
connection:
  name: postgres-to-bigquery-sync
  namespaceDefinition: source
  namespaceFormat: "${SOURCE_NAMESPACE}"
  prefix: "raw_"

  # ๋™๊ธฐํ™” ์Šค์ผ€์ค„
  schedule:
    scheduleType: cron
    cronExpression: "0 */6 * * *"  # 6์‹œ๊ฐ„๋งˆ๋‹ค

  # ์ŠคํŠธ๋ฆผ ์„ค์ • (ํ…Œ์ด๋ธ”๋ณ„ ๋™๊ธฐํ™” ๋ฐฉ์‹)
  syncCatalog:
    streams:
      - stream:
          name: orders
          namespace: sales
        config:
          syncMode: incremental
          cursorField:
            - updated_at
          destinationSyncMode: append_dedup
          primaryKey:
            - - order_id

      - stream:
          name: customers
          namespace: public
        config:
          syncMode: incremental
          cursorField:
            - modified_date
          destinationSyncMode: append_dedup
          primaryKey:
            - - customer_id

      - stream:
          name: products
          namespace: public
        config:
          syncMode: full_refresh
          destinationSyncMode: overwrite

# Airbyte Terraform ์„ค์ • ์˜ˆ์ œ
# terraform/airbyte.tf
---
resource "airbyte_source_postgres" "production" {
  name         = "production-postgres"
  workspace_id = var.airbyte_workspace_id

  configuration = {
    host     = var.postgres_host
    port     = 5432
    database = "analytics"
    username = var.postgres_user
    password = var.postgres_password

    replication_method = {
      replication_method_cdc = {
        replication_slot = "airbyte_slot"
        publication      = "airbyte_publication"
      }
    }
  }
}

resource "airbyte_destination_bigquery" "warehouse" {
  name         = "analytics-warehouse"
  workspace_id = var.airbyte_workspace_id

  configuration = {
    project_id       = var.gcp_project_id
    dataset_id       = "raw_data"
    dataset_location = "asia-northeast3"
    credentials_json = var.bigquery_credentials

    loading_method = {
      gcs_staging = {
        gcs_bucket_name = "airbyte-staging"
        gcs_bucket_path = "/staging"
      }
    }
  }
}

How It's Used in Practice

Data Engineer: "We've ended up with too many custom scripts because of SaaS data integration. They're hard to maintain."

Tech Lead: "How about adopting Airbyte? It has connectors for Salesforce and HubSpot, and it supports CDC too."

Data Engineer: "What about scheduling and monitoring? Can it integrate with our existing Airflow?"

Tech Lead: "You can trigger it from Airflow through the Airbyte API. Failure alerts also integrate with Slack, and incremental sync can reduce costs as well."

Interviewer: "Is there a reason you chose Airbyte instead of commercial tools like Fivetran or Stitch?"

Candidate: "It's because of cost and flexibility. Airbyte is open source, so there are no license fees, and custom connectors can be easily developed with the CDK. We built and used a custom connector to integrate with our legacy system."

Interviewer: "So you have experience with CDC-based incremental sync. How did you manage the load on the source DB?"

Candidate: "We used PostgreSQL's logical replication to perform CDC from a read-only replica, and we also scheduled the sync interval to avoid peak hours."

Take a mock interview on this topic โ†’ WIA SOOM AI Interview ยท Start for free

Reviewer: "This connector configuration uses full_refresh, but the table seems large. Wouldn't it be better to switch to incremental?"

Developer: "This table doesn't have an updated_at column, so incremental sync is difficult."

Reviewer: "Then you could add updated_at to the source table with a trigger, or use Airbyte's CDC mode, which can capture only the changes based on the WAL. If the data volume is large, the sync time will get longer, so please review it."

Cautions

Related Terms

Learn More