udb 0.3.1

Universal Data Broker — a Rust gRPC broker over multiple databases (Postgres, MySQL, SQLite, MongoDB, ClickHouse, Cassandra, MSSQL, Redis, Qdrant, S3, Neo4j, …) with per-tenant RLS, 2PC, sagas, and CDC.
Documentation
# docker-compose.playground.yml — UDB local one-command playground
#
# Phase 7.3 of the UDB Critical Feature Implementation Plan.
#
# Brings up every core dependency + a pre-built UDB container so that a
# developer can validate the full stack locally with a single command:
#
#   docker compose -f docker-compose.playground.yml up
#
# Or via the helper scripts:
#   scripts/playground.sh   (Linux / macOS)
#   scripts/playground.ps1  (Windows)

version: "3.9"

# ── Shared defaults ───────────────────────────────────────────────────────────
x-common-env: &common-env
  RUST_LOG: "udb=debug,tower_http=info"
  UDB_PG_DSN: "postgres://udb:udb@postgres:5432/udb_dev"
  UDB_CACHE_DSN: "redis://redis:6379"
  UDB_VECTOR_DSN: "http://qdrant:6333"
  UDB_OBJECT_DSN: "http://minio:9000"
  AWS_ACCESS_KEY_ID: "minioadmin"
  AWS_SECRET_ACCESS_KEY: "minioadmin"
  UDB_S3_BUCKET: "udb-playground"
  UDB_ABAC_SCHEMA: "udb_system"
  UDB_ABAC_TABLE: "udb_abac_policies"
  UDB_SAGA_RECOVERY_ENABLED: "true"
  UDB_SAGA_RECOVERY_INTERVAL_SECONDS: "30"

services:

  # ── PostgreSQL ──────────────────────────────────────────────────────────────
  postgres:
    image: postgres:16-alpine
    environment:
      POSTGRES_DB: udb_dev
      POSTGRES_USER: udb
      POSTGRES_PASSWORD: udb
    ports:
      - "5432:5432"
    volumes:
      - pg_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U udb -d udb_dev"]
      interval: 5s
      timeout: 5s
      retries: 10

  # ── Redis ───────────────────────────────────────────────────────────────────
  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 3s
      retries: 10

  # ── Qdrant (vector DB) ───────────────────────────────────────────────────────
  qdrant:
    image: qdrant/qdrant:v1.9.0
    ports:
      - "6333:6333"
      - "6334:6334"
    volumes:
      - qdrant_data:/qdrant/storage
    healthcheck:
      test: ["CMD-SHELL", "curl -sf http://localhost:6333/health || exit 1"]
      interval: 10s
      timeout: 5s
      retries: 10

  # ── MinIO (S3-compatible object store) ────────────────────────────────────
  minio:
    image: minio/minio:RELEASE.2024-03-15T01-07-19Z
    command: server /data --console-address ":9001"
    environment:
      MINIO_ROOT_USER: minioadmin
      MINIO_ROOT_PASSWORD: minioadmin
    ports:
      - "9000:9000"
      - "9001:9001"
    volumes:
      - minio_data:/data
    healthcheck:
      test: ["CMD-SHELL", "curl -sf http://localhost:9000/minio/health/live || exit 1"]
      interval: 10s
      timeout: 5s
      retries: 10

  # ── MinIO bucket initialisation ────────────────────────────────────────────
  minio-init:
    image: minio/mc:latest
    depends_on:
      minio:
        condition: service_healthy
    entrypoint: >
      sh -c "
        mc alias set local http://minio:9000 minioadmin minioadmin &&
        mc mb --ignore-existing local/udb-playground &&
        echo 'MinIO bucket ready'
      "

  # ── Kafka (optional; CDC event journal publishing) ────────────────────────
  kafka:
    image: bitnami/kafka:3.7
    environment:
      KAFKA_CFG_NODE_ID: 1
      KAFKA_CFG_PROCESS_ROLES: broker,controller
      KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 1@kafka:9093
      KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093,EXTERNAL://:9094
      KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,EXTERNAL://localhost:9094
      KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,CONTROLLER:PLAINTEXT,EXTERNAL:PLAINTEXT
      KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
      KAFKA_CFG_INTER_BROKER_LISTENER_NAME: PLAINTEXT
      ALLOW_PLAINTEXT_LISTENER: "yes"
    ports:
      - "9094:9094"
    volumes:
      - kafka_data:/bitnami/kafka
    healthcheck:
      test: ["CMD-SHELL", "kafka-topics.sh --bootstrap-server localhost:9092 --list || exit 1"]
      interval: 15s
      timeout: 10s
      retries: 10

  # ── UDB service ─────────────────────────────────────────────────────────────
  udb:
    build:
      context: .
      dockerfile: Dockerfile
    environment:
      <<: *common-env
      UDB_PORT: "50051"
    ports:
      - "50051:50051"
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy
      qdrant:
        condition: service_healthy
      minio:
        condition: service_healthy
    healthcheck:
      test: ["CMD-SHELL", "grpcurl -plaintext localhost:50051 udb.services.v1.DataBroker/GetHealthReport 2>&1 | grep passed || exit 1"]
      interval: 15s
      timeout: 10s
      retries: 10
      start_period: 20s

volumes:
  pg_data:
  qdrant_data:
  minio_data:
  kafka_data: