惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Security Blog
Microsoft Security Blog
T
The Exploit Database - CXSecurity.com
MyScale Blog
MyScale Blog
D
Docker
GbyAI
GbyAI
MongoDB | Blog
MongoDB | Blog
Y
Y Combinator Blog
C
Check Point Blog
The GitHub Blog
The GitHub Blog
云风的 BLOG
云风的 BLOG
Vercel News
Vercel News
Engineering at Meta
Engineering at Meta
月光博客
月光博客
Microsoft Azure Blog
Microsoft Azure Blog
Google DeepMind News
Google DeepMind News
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Hugging Face - Blog
Hugging Face - Blog
Scott Helme
Scott Helme
C
Cybersecurity and Infrastructure Security Agency CISA
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Security Archives - TechRepublic
Security Archives - TechRepublic
I
Intezer
P
Proofpoint News Feed
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Simon Willison's Weblog
Simon Willison's Weblog
阮一峰的网络日志
阮一峰的网络日志
Project Zero
Project Zero
人人都是产品经理
人人都是产品经理
A
About on SuperTechFans
AWS News Blog
AWS News Blog
T
Tor Project blog
Know Your Adversary
Know Your Adversary
B
Blog
美团技术团队
A
Arctic Wolf
IT之家
IT之家
G
GRAHAM CLULEY
P
Privacy International News Feed
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Martin Fowler
Martin Fowler
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Cisco Blogs
博客园 - 【当耐特】
V
Visual Studio Blog
T
Threat Research - Cisco Blogs
L
LINUX DO - 热门话题
H
Hacker News: Front Page
PCI Perspectives
PCI Perspectives
Jina AI
Jina AI
腾讯CDC

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Effortless Data Migration: How to Export from PostgreSQL and Load into S3 as Parquet with Sling
Fritz Larco · 2026-06-18 · via DEV Community

Fritz Larco

Last updated: June 2026

Introduction

In today's data-driven landscape, efficiently moving data from PostgreSQL databases to cloud storage solutions like Amazon S3 is a critical requirement for many organizations. When combined with the Parquet file format's superior compression and query performance capabilities, this creates a powerful solution for data warehousing and analytics. However, setting up and maintaining such a data pipeline traditionally involves multiple tools, complex configurations, and significant overhead.

Enter Sling, a modern data movement tool that dramatically simplifies this process. In this guide, we'll explore how to use Sling to efficiently transfer data from PostgreSQL to S3, storing it in the Parquet format for optimal performance and cost efficiency. We'll cover everything from installation and setup to advanced configuration options, making your data pipeline both powerful and maintainable.

Sling: A Modern Solution

Sling is a modern data movement platform designed to simplify data operations between various sources and destinations. It provides both a powerful CLI tool and a comprehensive platform for managing data workflows.

Key Features

  • Efficient Data Transfer: Optimized for performance with built-in parallelization and streaming capabilities
  • Native Parquet Support: Direct conversion to Parquet format without intermediate steps
  • Schema Handling: Automatic schema detection and evolution support
  • Incremental Updates: Built-in support for incremental data loading
  • Security: Secure credential management for both PostgreSQL and S3

Getting Started with Sling

Let's begin by installing Sling on your system. Sling provides multiple installation methods to suit your environment:

# macOS / Linux
curl -fsSL https://slingdata.io/install.sh | bash

# Windows
irm https://slingdata.io/install.ps1 | iex

# Python
pip install sling

After installation, verify that Sling is properly installed:

# Check Sling version
sling --version

For more detailed installation instructions, visit the Sling CLI Getting Started Guide.

Setting Up Connections

Before we can transfer data, we need to configure our source (PostgreSQL) and target (S3) connections. Sling provides multiple ways to set up and manage connections securely.

PostgreSQL Connection Setup

You can set up a PostgreSQL connection using one of these methods:

Using Environment Variables

The simplest way is to use environment variables:

# Set PostgreSQL connection using environment variable
export POSTGRES='postgresql://myuser:mypassword@localhost:5432/mydatabase'

Using the Sling CLI

Alternatively, use the sling conns set command:

# Set up PostgreSQL connection with individual parameters
sling conns set POSTGRES type=postgres host=localhost user=myuser database=mydatabase password=mypassword port=5432

# Or use a connection URL
sling conns set POSTGRES url="postgresql://myuser:mypassword@localhost:5432/mydatabase"

Using the Sling Environment File

You can also add the connection details to your ~/.sling/env.yaml file:

connections:
  POSTGRES:
    type: postgres
    host: localhost
    user: myuser
    password: mypassword
    port: 5432
    database: mydatabase
    schema: public

S3 Connection Setup

For Amazon S3, you'll need to configure AWS credentials. Here are the available methods:

Using Environment Variables

# Set AWS credentials using environment variables
export AWS_ACCESS_KEY_ID='your_access_key'
export AWS_SECRET_ACCESS_KEY='your_secret_key'
export AWS_REGION='us-west-2'  # optional, defaults to us-east-1

Using the Sling CLI

# Set up S3 connection with credentials
sling conns set S3 type=s3 access_key_id=your_access_key secret_access_key=your_secret_key region=us-west-2

Using the Sling Environment File

Add the S3 connection to your ~/.sling/env.yaml:

connections:
  S3:
    type: s3
    access_key_id: your_access_key
    secret_access_key: your_secret_key
    region: us-west-2  # optional, defaults to us-east-1

Testing Connections

After setting up your connections, it's important to verify they work correctly:

# Test the PostgreSQL connection
sling conns test POSTGRES

# Test the S3 connection
sling conns test S3

You can also explore the PostgreSQL database schema:

# List available tables in the public schema
sling conns discover POSTGRES -p 'public.*'

For more details about connection configuration and options, refer to:

Basic Data Transfer with CLI Flags

Once you have your connections set up, you can start transferring data from PostgreSQL to S3 using Sling's CLI flags. Let's look at some common usage patterns.

Simple Transfer Example

The most basic way to transfer data is using the sling run command with source and target specifications:

# Export a single table to S3 as Parquet
sling run \
  --src-conn POSTGRES \
  --src-stream "public.users" \
  --tgt-conn S3 \
  --tgt-object "s3://my-bucket/data/users.parquet"

Understanding CLI Flag Options

Sling provides various CLI flags to customize your transfer:

# Export with specific columns and where clause
sling run \
  --src-conn POSTGRES \
  --src-stream "SELECT id, name, email FROM users WHERE created_at > '2024-01-01'" \
  --tgt-conn S3 \
  --tgt-object "s3://my-bucket/data/filtered_users.parquet" \
  --tgt-options '{ "compression": "snappy", "row_group_size": 100000 }'

# Export with custom Parquet options and table keys
sling run \
  --src-conn POSTGRES \
  --src-stream "public.orders" \
  --tgt-conn S3 \
  --tgt-object "s3://my-bucket/data/orders.parquet" \
  --tgt-options '{ "file_max_bytes": 100000000, "compression": "snappy" }'

Using Runtime Variables

Sling supports runtime variables that can be used in your object paths and queries:

# Export multiple tables with runtime variables
sling run \
  --src-conn POSTGRES \
  --src-stream "public.sales_*" \
  --tgt-conn S3 \
  --tgt-object "s3://my-bucket/data/{stream_table}/{date_yyyy_mm_dd}.parquet" \
  --tgt-options '{ "file_max_bytes": 100000000 }'

For a complete list of available CLI flags and runtime variables, refer to:

Advanced Data Transfer with Replication YAML

While CLI flags are great for simple transfers, YAML configuration files provide more flexibility and reusability for complex data transfer scenarios. Let's explore how to use YAML configurations with Sling.

Basic Multi-Stream Example

Create a file named postgres_to_s3.yaml with the following content:

# Basic configuration for exporting multiple tables
source: POSTGRES
target: S3

defaults:
  mode: full-refresh
  target_options:
    format: parquet
    compression: snappy
    file_max_bytes: 100000000

streams:
  # Export users table with specific columns
  public.users:
    object: s3://my-bucket/data/users/{YYYY}_{MM}_{DD}.parquet
    select: [id, name, email, created_at]

  # Export orders table with primary key and column selection
  public.orders:
    object: s3://my-bucket/data/orders/{YYYY}_{MM}_{DD}.parquet
    target_options:
      format: parquet
      compression: gzip

Advanced Configuration Example

Here's a more complex example with multiple streams and advanced options:

source: POSTGRES
target: S3

defaults:
  mode: incremental
  source_options:
    add_new_columns: true
  target_options:
    format: parquet
    compression: snappy
    row_group_size: 100000
    file_max_bytes: 100000000

streams:
  # Export all tables in sales schema
  sales.*:
    object: s3://my-bucket/data/{stream_schema}/{stream_table}.parquet
    mode: full-refresh
    target_options:
      format: parquet
      compression: snappy
      file_max_bytes: 500000000

  # Incremental export of customer transactions (partitioning)
  public.transactions:
    object: s3://my-bucket/data/transactions/{part_year}/{part_month}
    sql: |
      select transaction_id, customer_id, amount, status, created_at
      from public.transactions
      where created_at > coalesce({incremental_val}, '2001-01-01)

  # Export specific customer data with custom query
  public.customers:
    object: s3://my-bucket/data/customers.parquet
    mode: full-refresh
    query: |
      SELECT 
        c.customer_id,
        c.name,
        c.email,
        COUNT(o.order_id) as total_orders,
        SUM(o.total_amount) as lifetime_value
      FROM customers c
      LEFT JOIN orders o ON c.customer_id = o.customer_id
      GROUP BY c.customer_id, c.name, c.email

To run a replication configuration:

# Execute the replication configuration
sling run -r postgres_to_s3.yaml

For more details about replication configuration options, refer to:

Using the Sling Platform UI

While the CLI is powerful for automation and scripting, the Sling Platform provides a user-friendly web interface for managing and monitoring your data transfers.

Key Platform Features

The Sling Platform offers several advantages:

  • Visual Replication Editor: Create and edit replication configurations with a user-friendly interface
  • Real-time Monitoring: Track the progress of your data transfers in real-time
  • History and Logs: View detailed execution history and logs for troubleshooting
  • Team Collaboration: Share connections and configurations with team members
  • Scheduling: Set up recurring transfers with flexible scheduling options

Getting Started with the Platform

To get started with the Sling Platform:

  1. Visit app.slingdata.io to create an account
  2. Follow the onboarding process to set up your workspace
  3. Create your PostgreSQL and S3 connections
  4. Create your first replication using the visual editor
  5. Monitor your transfers in real-time

For more information about the Sling Platform, visit the Platform Documentation.

Getting Started and Next Steps

Now that you understand how to use Sling for transferring data from PostgreSQL to S3 in Parquet format, here are some next steps to explore:

Additional Resources

Best Practices

  1. Start Small: Begin with a single table and simple configuration
  2. Test Thoroughly: Use the --dry-run flag to validate your configuration
  3. Monitor Performance: Use the platform's monitoring features to optimize your transfers
  4. Use Version Control: Store your replication YAML files in version control
  5. Implement Security: Follow AWS best practices for S3 bucket policies and IAM roles

Next Steps

  1. Set up your first PostgreSQL to S3 transfer using the CLI
  2. Create a more complex replication using YAML configuration
  3. Explore the Sling Platform for visual configuration and monitoring
  4. Join the Sling community to share experiences and get help

With Sling, you can efficiently manage your data pipeline needs while maintaining flexibility and control over your data movement processes.

Related Guides

Parquet is the analytics-friendly choice, but Sling can write other formats from the same PostgreSQL source:

FAQ

Why choose Parquet over CSV or JSON for PostgreSQL exports to S3?

Parquet is columnar and compressed, so files are smaller and analytical queries that read a subset of columns run much faster than over row-based CSV or JSON. It also carries column types, which avoids the type-guessing that text formats require downstream.

Which Parquet compression codecs does Sling support?

Sling supports snappy, gzip, and zstd among others, set via the compression property under target_options. Snappy is a good default balancing speed and size, while zstd compresses more tightly for cold storage.

What is row_group_size and how should I set it?

row_group_size controls how many rows go into each Parquet row group, which affects read parallelism and memory use. Larger groups compress better, while smaller groups let query engines skip data more granularly. The default works for most workloads.

Does Sling preserve PostgreSQL data types in the Parquet schema?

Yes. Sling maps PostgreSQL types to Parquet logical types, so numerics, timestamps, and booleans stay typed instead of being coerced to strings the way they would in CSV.

How do I partition the Parquet output by date in S3?

Use partition runtime variables such as {part_year} and {part_month} in the object path. Sling routes each row to the correct prefix, producing a Hive-style partitioned layout that query engines can prune.

Can I add new columns to existing exports without a full reload?

Yes. Enable add_new_columns under target_options so that when the source picks up a new column, Sling adds it to the schema on the next run rather than failing or requiring a manual reload.

How large should each Parquet file be?

Aim for roughly 128 MB to 512 MB per file for good query-engine performance, and control it with file_max_bytes under target_options. Many tiny files hurt read throughput, while a few huge files limit parallelism.