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

推荐订阅源

G
GRAHAM CLULEY
Security Latest
Security Latest
C
Cybersecurity and Infrastructure Security Agency CISA
C
Cyber Attacks, Cyber Crime and Cyber Security
K
Kaspersky official blog
P
Privacy & Cybersecurity Law Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
V
Vulnerabilities – Threatpost
S
Security @ Cisco Blogs
S
Schneier on Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Scott Helme
Scott Helme
TaoSecurity Blog
TaoSecurity Blog
Hacker News: Ask HN
Hacker News: Ask HN
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
CERT Recently Published Vulnerability Notes
The Last Watchdog
The Last Watchdog
T
Threat Research - Cisco Blogs
W
WeLiveSecurity
P
Privacy International News Feed
T
Threatpost
I
Intezer
Cisco Talos Blog
Cisco Talos Blog
Google Online Security Blog
Google Online Security Blog
Webroot Blog
Webroot Blog
Forbes - Security
Forbes - Security
N
News and Events Feed by Topic
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Simon Willison's Weblog
Simon Willison's Weblog
T
Tor Project blog
C
Cisco Blogs
P
Palo Alto Networks Blog
V2EX - 技术
V2EX - 技术
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
A
Arctic Wolf
Schneier on Security
Schneier on Security
H
Hacker News: Front Page
O
OpenAI News
Latest news
Latest news
T
Tenable Blog
Cloudbric
Cloudbric
Project Zero
Project Zero
Cyberwarzone
Cyberwarzone
S
Securelist
AWS News Blog
AWS News Blog
S
Secure Thoughts
Spread Privacy
Spread Privacy
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
H
Help Net Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

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
I Built a Tool That Gives Every Pull Request Its Own Isolated PostgreSQL Database in 28 Seconds
Kevin Andrew · 2026-06-28 · via DEV Community

I created this piece for the purposes of entering the H0 Hackathon. #H0Hackathon


The Problem Nobody Talks About

Your CI pipeline is green. Tests pass. Preview URL works. But there's one thing your team quietly accepts as a fact of life: everyone shares the same staging database.

This creates a class of bugs that are maddening to debug:

  • PR #14 adds a migration that drops a column. PR #15 (written before #14 merged) now fails — not because of bad code, but because the shared DB state changed.
  • Your QA team loads test data. Another engineer's automated test wipes it. Both were "doing the right thing."
  • A contractor needed read access to test something. Now your users' real emails, phone numbers, and home addresses are sitting in their local Postgres dump. The third one isn't just annoying. It's a compliance incident waiting to happen.

The Solution: Copy-on-Write Database Clones Per PR

I built STEM — a GitHub App + AWS backend that automatically provisions an isolated Aurora PostgreSQL clone for every pull request your team opens, anonymizes the PII in it, and injects the connection string directly into your Vercel preview environment.

The flow looks like this:

Developer opens PR
  → GitHub webhook fires
  → STEM clones your Aurora cluster (copy-on-write, ~28 seconds, zero data copied)
  → Writer instance spins up
  → PII columns detected and anonymized (emails, names, phones, SSNs, IPs)
  → DATABASE_URL injected into Vercel preview env
  → PR comment posted with connection details
  → Developer's preview hits an isolated, anonymized DB
Developer closes PR
  → Clone destroyed, env var removed, zero waste

Every PR gets a full production-shaped database — real schema, real query patterns, fake people.


How the Aurora Cloning Works

The magic is RestoreDBClusterToPointInTime with RestoreType: copy-on-write. Aurora's storage layer is log-structured — a clone shares the same underlying storage pages as the source and only diverges on writes. You get a full logical copy of your database in under 30 seconds regardless of how large it is.

await rds.send(new RestoreDBClusterToPointInTimeCommand({
  DBClusterIdentifier: `stem-pr-${prNumber}-${Date.now()}`,
  SourceDBClusterIdentifier: process.env.AURORA_SOURCE_CLUSTER_ID,
  RestoreType: 'copy-on-write',
  UseLatestRestorableTime: true,
  DBSubnetGroupName: process.env.AURORA_SUBNET_GROUP,
  VpcSecurityGroupIds: [process.env.AURORA_SECURITY_GROUP_ID],
}))

The copy-on-write restore type is the key. It does not copy data — it creates a new cluster that references the same storage. Your 500GB production database? 28-second clone. 5TB? Still 28 seconds.


PII Anonymization — Automatic, Zero Config

After the clone is ready, STEM connects and runs a detection + masking pass:

  1. Schema inspection — scans column names for patterns (email, phone, ssn, address, dob, ip_address, credit_card, etc.)
  2. Sample verification — pulls 10 rows per candidate column, runs regex validation to confirm actual PII values are present
  3. Mass UPDATE — replaces every matched row with deterministic fake values using a seeded generator (same fake value for the same real value, so foreign key joins still work)
  4. Audit log — writes the list of anonymized columns to the metadata store Developers never see real user data. QA runs against production-realistic schemas with fake values. Compliance teams can point to the audit log.

The Metadata Layer: Aurora DSQL

STEM uses Aurora DSQL as its metadata store — tracking branch states, clone cluster IDs, Vercel env var IDs, and anonymized column lists across the pipeline.

DSQL is serverless, scales to zero, and handles the concurrent writes from multiple simultaneous PR webhooks without contention. It also gives us a distributed transaction model that means the metadata state always stays consistent even when the pipeline is processing multiple PRs in parallel.

The branch state machine looks like:

CLONING → PROVISIONING → ACTIVE → DESTROYED

Each transition is written to DSQL atomically. The dashboard polls this table to show real-time pipeline progress.


Cross-Account AWS Security Model

STEM uses the standard SaaS cross-account IAM pattern — no long-lived customer credentials ever leave the customer's account.

When a customer connects their AWS:

  1. They deploy a CloudFormation stack (one command, auto-generated from STEM's UI)
  2. The stack creates an IAM role that trusts STEM's control-plane account
  3. The role is scoped to exactly the RDS actions STEM needs — nothing else
  4. STEM stores the role ARN and uses sts:AssumeRole to operate in the customer's account
{
  "Effect": "Allow",
  "Principal": { "AWS": "arn:aws:iam::STEM_ACCOUNT:root" },
  "Action": "sts:AssumeRole",
  "Condition": { "StringEquals": { "sts:ExternalId": "stem-<per-user-hmac>" } }
}

The ExternalId is HMAC-derived per user — prevents confused deputy attacks even if the role ARN is leaked.


The Stack

  • Backend: Next.js 15 App Router, TypeScript, deployed to Vercel
  • Metadata: Aurora DSQL (serverless, distributed)
  • Database cloning: Aurora PostgreSQL Serverless v2 via RestoreDBClusterToPointInTime
  • Auth: GitHub App OAuth, AES-256-GCM sealed sessions (Edge-compatible)
  • Frontend: Next.js 15, Tailwind, Recharts, SWR for live polling

- Infra security: Cross-account IAM with HMAC ExternalId, least-privilege RDS policy

The Numbers

From a real PR opened against a staging cluster:

Metric Value
Clone ready 28s
PII columns masked 5
Daily cost (2 active branches) $0.22
PR comment posted within 35s of open

The cost efficiency comes from Aurora Serverless v2's ACU-based billing — idle clones scale to near-zero. A branch that no one's querying costs fractions of a cent per hour.


What's Next

  • Multi-tenant AWS fan-out: wire the per-user connected role ARN into the webhook handler so each customer's clones provision in their own account
  • Org-level pooling: cap concurrent branches per org with a lease queue

- Anonymization policies: let teams define custom column patterns and masking strategies via a config file in their repo

Try It

STEM is live at stem-frontend-six.vercel.app. Connect your GitHub, hook up your Aurora cluster, and your next PR will have its own database.

Built for H0: Hack the Zero Stack — Vercel v0 + AWS Databases hackathon.

Source: github.com/Andrew-Kevin-007/stem-app


If you've ever spent 45 minutes debugging a test failure that turned out to be someone else's migration running against your shared staging DB, this one's for you.