Data Engineering

dbt at Scale: 6 Patterns We Use on 1000+ Model Projects

6 min read

Once a dbt project crosses 200 models, things break. Six patterns we apply to keep large projects fast and maintainable.

  1. 01Three-layer architecture: staging → intermediate → marts

    Each layer has clear rules. Staging has no joins; intermediate has business logic; marts are flat.

  2. 02Mandatory model tests at the staging layer

    not_null + unique on every primary key + freshness on every source.

  3. 03Incremental models with surrogate keys

    Use dbt_utils.generate_surrogate_key for stability.

  4. 04CI runs only changed models + downstream

    dbt build –select state:modified+ –defer.

  5. 05Slim CI on a 1% sample of source data

    Catches schema changes without full-scan cost.

  6. 06Documentation as a hard CI gate

    Models without descriptions fail the build.

Compliance-Grade RAG PipelineSOC 2 + audit-trail architectureDocuments14K pagesChunkingHierarchicalEmbeddingsVoyage-3pgvectorOn RDSRerankCohere v3Claude 3.7Citation-disciplinedAUDIT TRAIL · Every query → S3 Object Lock · 7-year retentionQuestion · Retrieved chunks (hashed) · Prompt version · Model version · Final answerZero audit findings · Q1 2026 SOC 296.4% answer satisfaction · 2,400+ queries/month · p95 retrieval 180ms
The compliance-grade RAG architecture Ohveda deployed for a regulated FinTech in Q4 2025.

The Slim CI Pipeline (GitHub Actions)

name: dbt slim CI
on: [pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: pip install dbt-snowflake==1.8.0
      - name: Fetch prod manifest
        run: aws s3 cp s3://dbt-artifacts/prod/manifest.json target/
      - name: dbt build (changed only)
        run: dbt build --select state:modified+ --defer --state target/
      - name: Upload manifest
        if: github.event_name == 'push'
        run: aws s3 cp target/manifest.json s3://dbt-artifacts/prod/

Ready to optimize your cloud or AI footprint?

Book a free 30-minute architecture review. We will deliver a written cost-and-architecture audit within 48 hours.

Book a free architecture review · sales@ohveda.com

Need help with dbt at scale?

Ohveda runs free 30-minute architecture reviews. We will identify your top opportunities in writing within 48 hours — at no cost.

Book a Free Architecture Review →